mpeg2: fix interpolation of GOP TSN from new PTS.

New GOP TSN base could be mis-calculated. In particular, this fixes
decoding of uruseiyatsura.vob from <http://samples.mplayerhq.hu/>.
This commit is contained in:
Gwenole Beauchesne 2012-04-02 18:09:21 +02:00
parent 9c8b85b3c7
commit 2d36f6199e

View file

@ -128,7 +128,8 @@ pts_sync(PTSGenerator *tsg, GstClockTime gop_pts)
/* Interpolate GOP TSN from this valid PTS */
if (GST_CLOCK_TIME_IS_VALID(tsg->gop_pts))
gop_tsn = tsg->gop_tsn + gst_util_uint64_scale(
gop_pts - tsg->gop_pts, tsg->fps_n, GST_SECOND * tsg->fps_d);
gop_pts - tsg->gop_pts + pts_get_duration(tsg, 1) - 1,
tsg->fps_n, GST_SECOND * tsg->fps_d);
else
gop_tsn = 0;
}