diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-25 00:49:18 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-25 22:45:17 +0200 |
commit | 1d6c82d40541936fe67061a8374b5bae8fbc4cbb (patch) | |
tree | 352ce252b3e77f80eb7d9bde2c17c089f452ef88 /ffplay.c | |
parent | 54ad8e06f48392332a3fedc468eba38d823c60ea (diff) | |
download | ffmpeg-1d6c82d40541936fe67061a8374b5bae8fbc4cbb.tar.gz |
ffplay: fix logic for selecting the show mode in case of missing video
Also automatically select the show mode only if not specified by the
user.
Fix trac issue #109.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -168,7 +168,7 @@ typedef struct VideoState { AVAudioConvert *reformat_ctx; enum ShowMode { - SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB + SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB } show_mode; int16_t sample_array[SAMPLE_ARRAY_SIZE]; int sample_array_index; @@ -264,7 +264,7 @@ static int exit_on_keydown; static int exit_on_mousedown; static int loop=1; static int framedrop=1; -static enum ShowMode show_mode = SHOW_MODE_VIDEO; +static enum ShowMode show_mode = SHOW_MODE_NONE; static int rdftspeed=20; #if CONFIG_AVFILTER @@ -2471,10 +2471,8 @@ static int decode_thread(void *arg) ret= stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]); } is->refresh_tid = SDL_CreateThread(refresh_thread, is); - if(ret<0) { - if (!display_disable) - is->show_mode = SHOW_MODE_RDFT; - } + if (is->show_mode == SHOW_MODE_NONE) + is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT; if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) { stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]); |