[MPlayer-dev-eng] Reverted patch of time-based PTS locking

Pásztor Szilárd don at tricon.hu
Thu Aug 16 11:22:02 CEST 2012


Reimar Döffinger:
> Hm, I couldn't really think of a solution that is 100% sure to work
> in any case imaginable.
> Though something a bit less like that might be ok, but I'm not convinced
> it's going to be easy still.

Ok here is the concept.
H264 elementary streams, as I found out, contain no PTS info (sorry I'm not
that expert on video codecs, so I didn't know that). But containers have PTS
in the wrong order, so it's better to correct that in place, right after
demuxing.
In video_read_frame() where demuxing is separated by codecs, PTS correction
in the H264 part cannot affect any other streams. I already have a working
patch for it, just need to make it a bit more reliable.

> I admit I'm not able to see the difference.
> Though I don't understand why it should get _worse_ with -mc 1,
> with -mc 100 yes, but with -mc 1 it should ignore those A-V sync
> jumps.

It only ignores jumps at -mc 0. All other values mean jerk, even if not much.
It is a conceptional problem, and very visible at continuous camera spans and
fluid movement. I inserted this frametime dump (in ms) into mplayer.c ("PLAY
VIDEO" part):

{
static struct timeval last_tv;
struct timeval tv;

gettimeofday(&tv, NULL);
fprintf(stderr, "Frametime: %6.2f\n", (tv.tv_sec*1000 + tv.tv_usec/1000.0) -
    (last_tv.tv_sec*1000 + last_tv.tv_usec/1000.0));
last_tv = tv;
}

and here is the result without a PTS patch:

Frametime:  36.15
Frametime:  49.60
Frametime:  22.76
Frametime:  61.26
Frametime:  32.90
Frametime:  34.58
Frametime:  34.42
Frametime:  59.18
Frametime:  22.47
Frametime:  41.95
Frametime:  55.81
Frametime:  23.51

After patching it looks like this:

Frametime:  39.60
Frametime:  38.31
Frametime:  40.64
Frametime:  39.31
Frametime:  40.48
Frametime:  41.82
Frametime:  38.09
Frametime:  41.08
Frametime:  38.96
Frametime:  39.54
Frametime:  40.72
Frametime:  39.71

Good patch is coming :)

                  --------------------------------------------
                  |  Don't panic! Count to ten. Then panic.  |
                  --------------------------------------------


More information about the MPlayer-dev-eng mailing list