mirror of https://git.ffmpeg.org/ffmpeg.git
ffplay: do not cycle through unavailable show modes
Fixes ticket #2200. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
d0c6ed7da0
commit
ac37d21f49
16
ffplay.c
16
ffplay.c
|
@ -2943,10 +2943,17 @@ static void toggle_full_screen(VideoState *is)
|
||||||
static void toggle_audio_display(VideoState *is)
|
static void toggle_audio_display(VideoState *is)
|
||||||
{
|
{
|
||||||
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
|
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
|
||||||
is->show_mode = (is->show_mode + 1) % SHOW_MODE_NB;
|
int next = is->show_mode;
|
||||||
fill_rectangle(screen,
|
do {
|
||||||
is->xleft, is->ytop, is->width, is->height,
|
next = (next + 1) % SHOW_MODE_NB;
|
||||||
bgcolor, 1);
|
} while (next != is->show_mode && (next == SHOW_MODE_VIDEO && !is->video_st || next != SHOW_MODE_VIDEO && !is->audio_st));
|
||||||
|
if (is->show_mode != next) {
|
||||||
|
fill_rectangle(screen,
|
||||||
|
is->xleft, is->ytop, is->width, is->height,
|
||||||
|
bgcolor, 1);
|
||||||
|
is->force_refresh = 1;
|
||||||
|
is->show_mode = next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) {
|
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) {
|
||||||
|
@ -3008,7 +3015,6 @@ static void event_loop(VideoState *cur_stream)
|
||||||
break;
|
break;
|
||||||
case SDLK_w:
|
case SDLK_w:
|
||||||
toggle_audio_display(cur_stream);
|
toggle_audio_display(cur_stream);
|
||||||
cur_stream->force_refresh = 1;
|
|
||||||
break;
|
break;
|
||||||
case SDLK_PAGEUP:
|
case SDLK_PAGEUP:
|
||||||
incr = 600.0;
|
incr = 600.0;
|
||||||
|
|
Loading…
Reference in New Issue