Added stopped disc blue display. Fixed single file video loading. Oops.

This commit is contained in:
Scott Duensing 2020-01-06 18:18:31 -06:00
parent b03a96f3b6
commit a8d8fc8556
3 changed files with 15 additions and 9 deletions

View file

@ -20,6 +20,10 @@
*/ */
// -v singe/ActionMax/frame_SonicFury.txt singe/ActionMax/SonicFury.singe
// -v singe/ActionMax/BlueThunder.mp4 singe/test.singe
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
@ -58,10 +62,6 @@ typedef struct ModeS {
void showUsage(char *name, char *message); void showUsage(char *name, char *message);
// /home/scott/code/singe2/videotest/Stargate.singe
// /home/scott/code/singe2/videotest/TestClip_720x480_29.97fps_2000_frames.avi
__attribute__((noreturn)) __attribute__((noreturn))
void showUsage(char *name, char *message) { void showUsage(char *name, char *message) {
int result = 0; int result = 0;

View file

@ -2293,9 +2293,14 @@ void singe(SDL_Window *window, SDL_Renderer *renderer) {
} }
// Update display // Update display
if (_refreshDisplay) { if (_refreshDisplay || _discStopped) {
//***TODO*** Handle overlay and blank disk frames if (_discStopped) {
// Stopped discs display blue like the good old days
SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255);
SDL_RenderClear(renderer);
} else {
SDL_RenderCopy(_renderer, _videoTexture, NULL, NULL); SDL_RenderCopy(_renderer, _videoTexture, NULL, NULL);
}
overlayTexture = SDL_CreateTextureFromSurface(_renderer, _overlay); overlayTexture = SDL_CreateTextureFromSurface(_renderer, _overlay);
if (!overlayTexture) utilDie("%s", SDL_GetError()); if (!overlayTexture) utilDie("%s", SDL_GetError());
if (!_confStretchVideo) { if (!_confStretchVideo) {

View file

@ -212,6 +212,7 @@ int _loadVideoAndAudio(char *vFilename, char *aFilename, char *indexPath, bool s
} else { } else {
vIndex = _createIndex(vFilename, indexPath, true, true, v); vIndex = _createIndex(vFilename, indexPath, true, true, v);
aIndex = vIndex; aIndex = vIndex;
aFilename = vFilename;
} }
// Find video track // Find video track
@ -243,10 +244,10 @@ int _loadVideoAndAudio(char *vFilename, char *aFilename, char *indexPath, bool s
// Indicies are now part of audioSource & videoSource, so release these // Indicies are now part of audioSource & videoSource, so release these
FFMS_DestroyIndex(vIndex); FFMS_DestroyIndex(vIndex);
vIndex = NULL; vIndex = NULL;
if (aIndex) { if (aFilename != vFilename) {
FFMS_DestroyIndex(aIndex); FFMS_DestroyIndex(aIndex);
aIndex = NULL;
} }
aIndex = NULL;
// Create video texture // Create video texture
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");