Opened 12 years ago

Closed 12 years ago

#2174 closed defect (fixed)

ffplay: eliminate possible resize of the window for first frame

Reported by: ami_stuff Owned by: Marton Balint
Priority: normal Component: ffplay
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

    if (is_full_screen && fs_screen_width) {
        w = fs_screen_width;
        h = fs_screen_height;
        fprintf(stderr,"1\n");
    } else if vp->width {
        calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
        w = rect.w;
        h = rect.h;
        fprintf(stderr,"2\n");
    } else if (!is_full_screen && screen_width && screen_height) {
        w = screen_width;
        h = screen_height;
        fprintf(stderr,"3\n");
    } else {
        w = 640;
        h = 480;
        fprintf(stderr,"4\n");
    }
    if (screen && is->width == screen->w && screen->w == w
       && is->height== screen->h && screen->h == h && !force_set_video_mode)
        return 0;

sometimes when I play a video at the beginning ffplay resizes window from 640x480 to actual
resolution of the video because code enters for first frame to "else" statement
(the rest of the 4 queued frames are displayed with correct size under (vp->width) statement),
so if possible I would like to see this unnecessary resize (flickering) for first frame removed.

this seems to remove (or reduce) the problem, but the first frame is not displayed at all
(so it fails for images)

display:
            /* display picture */
-            if (!display_disable && is->show_mode == SHOW_MODE_VIDEO)
-                video_display(is);

            pictq_next_picture(is);


+            if (!display_disable && is->show_mode == SHOW_MODE_VIDEO)
+                video_display(is);
            

            if (is->step && !is->paused)
                stream_toggle_pause(is);

No FFplay's output since it happens randomly with various video files
(sometimes easier to reproduce when -lowres option is enabled)

Attachments (1)

fix-modeset-order.patch (639 bytes ) - added by Marton Balint 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by ami_stuff, 12 years ago

It also happens with image as an input when you press "f" to enter fullscreen mode and go back again pressing "f" to windowed mode.

comment:2 by Carl Eugen Hoyos, 12 years ago

Component: undeterminedFFplay

by Marton Balint, 12 years ago

Attachment: fix-modeset-order.patch added

comment:3 by Marton Balint, 12 years ago

Owner: set to Marton Balint
Status: newopen

Does the attached patch help for the original problem?

in reply to:  3 comment:4 by ami_stuff, 12 years ago

Replying to cus:

Does the attached patch help for the original problem?

yes your patch fixes the problem, thanks

comment:5 by Carl Eugen Hoyos, 12 years ago

Is this problem still reproducible?

in reply to:  5 comment:6 by ami_stuff, 12 years ago

Resolution: fixed
Status: openclosed

Replying to cehoyos:

Is this problem still reproducible?

I belive it's fixed by 4fd6e5af1e334875eca4f803bbcfac9219b0524a.

Note: See TracTickets for help on using tickets.