mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
flvdemux: fix discontinuity threshold check when timestamps go backwards
Since unsigned types are used, a negative value would show as very, very positive. Fixes A/V sync on some... less than well made files where timestamps go backwards.
This commit is contained in:
parent
1e974b1581
commit
7a7db8cbaf
1 changed files with 2 additions and 2 deletions
|
@ -766,11 +766,11 @@ static void
|
|||
gst_flv_demux_update_resync (GstFlvDemux * demux, guint32 pts, gboolean discont,
|
||||
guint32 * last, GstClockTime * offset)
|
||||
{
|
||||
if (!discont && ABS (pts - *last) >= RESYNC_THRESHOLD) {
|
||||
gint32 dpts = pts - *last;
|
||||
if (!discont && ABS (dpts) >= RESYNC_THRESHOLD) {
|
||||
/* Theoretically, we should use substract the duration of the last buffer,
|
||||
but this demuxer sends no durations on buffers, not sure if it cannot
|
||||
know, or just does not care to calculate. */
|
||||
gint32 dpts = pts - *last;
|
||||
*offset -= dpts * GST_MSECOND;
|
||||
GST_WARNING_OBJECT (demux,
|
||||
"Large pts gap (%" G_GINT32_FORMAT " ms), assuming resync, offset now %"
|
||||
|
|
Loading…
Reference in a new issue