ffplay - fullscreen toggle fix.
Resolve an incorrect condition match and return in video_open()
when toggling to fullscreen a video window which
already matches the display resolution.
e.g. a 1920x1080 HD stream in a -geometry 1920x1080+0+22 window
on a 1920x1080 display.
NOTE:
I'm not familiar with the ffplay code, and this was just a
quick and dirty fix for an issue I was having. There may be
cleaner ways to do this.
Removing the condition check completely also seems to work
but as video_open() is called by other things than
toggle_full_screen() I decided doing it this way would have
less chance of having side-effects.
gary.langshaw@ntlworld.com
|
old
|
new
|
static char *vfilters = NULL;
|
| 280 | 280 | |
| 281 | 281 | /* current context */ |
| 282 | 282 | static int is_full_screen; |
| | 283 | static int full_screen_toggle; |
| 283 | 284 | static int64_t audio_callback_time; |
| 284 | 285 | |
| 285 | 286 | static AVPacket flush_pkt; |
| … |
… |
static int video_open(VideoState *is){
|
| 949 | 950 | h = 480; |
| 950 | 951 | } |
| 951 | 952 | if(screen && is->width == screen->w && screen->w == w |
| 952 | | && is->height== screen->h && screen->h == h) |
| | 953 | && is->height == screen->h && screen->h == h && !full_screen_toggle) |
| 953 | 954 | return 0; |
| 954 | 955 | screen = SDL_SetVideoMode(w, h, 0, flags); |
| 955 | 956 | if (!screen) { |
| … |
… |
static void toggle_full_screen(VideoStat
|
| 2783 | 2784 | is->pictq[i].reallocate = 1; |
| 2784 | 2785 | } |
| 2785 | 2786 | #endif |
| | 2787 | full_screen_toggle=1; |
| 2786 | 2788 | video_open(is); |
| | 2789 | full_screen_toggle=0; |
| 2787 | 2790 | } |
| 2788 | 2791 | |
| 2789 | 2792 | static void toggle_pause(VideoState *is) |