[MPlayer-dev-eng] [PATCH] mpegts
nicola.sabbi at poste.it
Tue Jan 12 23:38:26 CET 2010
Il giorno sab, 09/01/2010 alle 17.16 +0100, Dan Oscarsson ha scritto:
> A friend of mine is recording from DVB-T and gets a mpeg-ts file with
> AAC for audio and h264 for video. It did not play very well in mplayer.
> Looking at it I found that pts values for audio and video were not very
> good and pts for video were out of order.
> Playing with -correct-pts fixes the pts order when using -demuxer lavf
> but only partially when using the normal demux_ts.c.
> Audio pts were best using demux_ts.c compared to lavf demuxer.
> Analysing quality of pts values for demux_ts.c I found that they were
> bad due to using float instead of double for pts values. The attached
> patch fixes that. Now pts values from demux_ts.c are very good.
> The audio pts values in the demux stream packets from demux_ts.c are
> very good. They are not when using lavf demuxer where the pts values on
> demux stream packets do not match the data in the stream very well. I
> have looked at the code but the pts handling in demux_ts.c and lavf
> demuxer are very different and I have not found why they are so much
> better when using demux_ts.c.
> When using -correct-pts the pts order was corrected in lavf demuxer but
> only partially with demux_ts.c, after a seek. From what I have found out
> it looks like lavf demuxer after a seek have the first video pcket be
> aligned on stream buffer start so that its pts value is defined, but
> with demux_ts.c a seek often results in first packet not being on buffer
> start so first packets gets pts value MP_NOPTS_VALUE. This results in
> dec_video.c that the first packet is not added to reorder table.
> This movie needed 4 values (h264 says 4 b-frames) to do correction but
> when the first frame was of undefined pts, the correct pts code skipped
> first frame and then only managed 3 values which results in some pts
> values not being corrected.
> The attached patch fixes this by allowing the MP_NOPTS_VALUE in pts
> correction as it is less then other pts values and should do no harm,
> from what I can see. At lest it works for the movies I have tested it
> on. If you have a better idea of how to fix this, please do that
The first patch is ok, the second one... someone else.
More information about the MPlayer-dev-eng