mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
mpeg2: fix PTS cache for GOP start.
If the GOP temporal sequence number (TSN) is interpolated from a valid PTS, then we need to compensate that PTS corresponding to the start of GOP with the next picture to be decoded, which shall be an I-frame, based on its sequence number. https://bugzilla.gnome.org/show_bug.cgi?id=748676
This commit is contained in:
parent
d6255be939
commit
efc07f6bb1
1 changed files with 6 additions and 1 deletions
|
@ -128,11 +128,16 @@ pts_eval(PTSGenerator *tsg, GstClockTime pic_pts, guint pic_tsn)
|
|||
GstClockTime pts;
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID(tsg->gop_pts))
|
||||
tsg->gop_pts = 0;
|
||||
tsg->gop_pts = pts_get_duration(tsg, pic_tsn);
|
||||
|
||||
pts = pic_pts;
|
||||
if (!GST_CLOCK_TIME_IS_VALID (pts))
|
||||
pts = tsg->gop_pts + pts_get_duration(tsg, tsg->ovl_tsn * 1024 + pic_tsn);
|
||||
else if (pts == tsg->gop_pts) {
|
||||
/* The picture following the GOP header shall be an I-frame.
|
||||
So we can compensate for the GOP start time from here */
|
||||
tsg->gop_pts -= pts_get_duration(tsg, pic_tsn);
|
||||
}
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID(tsg->max_pts) || tsg->max_pts < pts)
|
||||
tsg->max_pts = pts;
|
||||
|
|
Loading…
Reference in a new issue