[MPlayer-dev-eng] [PATCH] further dvr-ms playback improvements
John Donaghy
johnfdonaghy at gmail.com
Tue Oct 3 05:49:31 CEST 2006
I've fixed the av sync problem after a seek. It was caused by a simple
logic error where the code didnt start recalculating averages etc
until after the seek function was complete. But you have to fill the
buffer - and recalculate - during the seek. It now seems to work.
> I wonder if it has anything to do with this code:
>
> if (asf->dvr_last_vid_pts > 0.0)
> dp->pts=asf->dvr_last_vid_pts+asf->avg_vid_frame_time;
> asf->dvr_last_vid_pts = dp->pts;
>
> Isn't dp->pts wrong? After a seek, dvr_last_vid_pts is reset to 0. This
> code sets dvr_last_vid_pts based on dp->pts (which was wrong). The next
> frame's pts will be based on this wrong dvr_last_vid_pts value plus the
> estimate of average frame time.
You're right that dp->pts is wrong immediately after a stream_seek -
but it always seems to be close enough. I dont know if there's any
alternative but to use the file pts here.
BTW - the file pts value in an ASF file is supposed to be the same for
every segment of the frame but for a dvr-ms file it seems to increase
by 1ms for each segment. Then the pts jumps by a small amount for the
first segment of the next frame - just enough to keep the value near
what it would be if the values were evenly spaced - but never
accurately enough for playback. I've no idea why it does this but
knowing the reason might help. The current code uses the pts in the
first segment of the frame but it could just as well use the last - or
the mid-point. None of these choices seem to be useful for smooth
playback however.
More information about the MPlayer-dev-eng
mailing list