mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
decoder: mpeg2: respect any input PTS provided for a frame.
The timestamp generator in gstvaapidecoder_mpeg2.c always interpolated frame timestamps within a GOP, even when it's been fed input PTS for every frame. That leads to incorrect output timestamps in some situations - for example live playback where input timestamps have been scaled based on arrival time from the network and don't exactly match the framerate. https://bugzilla.gnome.org/show_bug.cgi?id=732719
This commit is contained in:
parent
99bf1b1f98
commit
22dc8c4251
1 changed files with 4 additions and 1 deletions
|
@ -130,6 +130,8 @@ pts_eval(PTSGenerator *tsg, GstClockTime pic_pts, guint pic_tsn)
|
|||
if (!GST_CLOCK_TIME_IS_VALID(tsg->gop_pts))
|
||||
tsg->gop_pts = 0;
|
||||
|
||||
pts = pic_pts;
|
||||
if (!GST_CLOCK_TIME_IS_VALID (pts))
|
||||
pts = tsg->gop_pts + pts_get_duration(tsg, tsg->ovl_tsn * 1024 + pic_tsn);
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID(tsg->max_pts) || tsg->max_pts < pts)
|
||||
|
@ -142,6 +144,7 @@ pts_eval(PTSGenerator *tsg, GstClockTime pic_pts, guint pic_tsn)
|
|||
tsg->ovl_tsn++;
|
||||
}
|
||||
tsg->lst_tsn = pic_tsn;
|
||||
|
||||
return pts;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue