Ticket #736: ffplay-fix-fullscreen_toggle.diff

File ffplay-fix-fullscreen_toggle.diff, 1.6 KB (added by Gary Langshaw, 15 years ago)
  • ffmpeg-0.9

    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;  
    280280
    281281/* current context */
    282282static int is_full_screen;
     283static int full_screen_toggle;
    283284static int64_t audio_callback_time;
    284285
    285286static AVPacket flush_pkt;
    static int video_open(VideoState *is){  
    949950        h = 480;
    950951    }
    951952    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)
    953954        return 0;
    954955    screen = SDL_SetVideoMode(w, h, 0, flags);
    955956    if (!screen) {
    static void toggle_full_screen(VideoStat  
    27832784        is->pictq[i].reallocate = 1;
    27842785    }
    27852786#endif
     2787    full_screen_toggle=1;
    27862788    video_open(is);
     2789    full_screen_toggle=0;
    27872790}
    27882791
    27892792static void toggle_pause(VideoState *is)