From 21d3faa40070b2ddc10a1c572bd4d4a7dd28af39 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 24 Nov 2011 16:31:38 +0000 Subject: [PATCH] flvdemux: fix seeking Which I accidentally broke when fixing flv videos breaking on spurious timestamp discontinuities in broken files. https://bugzilla.gnome.org/show_bug.cgi?id=631430 --- gst/flv/gstflvdemux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 7d3c992fe1..6e95f95c57 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -763,10 +763,10 @@ gst_flv_demux_push_tags (GstFlvDemux * demux) } static void -gst_flv_demux_update_resync (GstFlvDemux * demux, guint32 pts, guint32 * last, - GstClockTime * offset) +gst_flv_demux_update_resync (GstFlvDemux * demux, guint32 pts, gboolean discont, + guint32 * last, GstClockTime * offset) { - if (ABS (pts - *last) >= RESYNC_THRESHOLD) { + if (!discont && ABS (pts - *last) >= 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. */ @@ -966,8 +966,8 @@ gst_flv_demux_parse_tag_audio (GstFlvDemux * demux, GstBuffer * buffer) } /* detect (and deem to be resyncs) large pts gaps */ - gst_flv_demux_update_resync (demux, pts, &demux->last_audio_pts, - &demux->audio_time_offset); + gst_flv_demux_update_resync (demux, pts, demux->audio_need_discont, + &demux->last_audio_pts, &demux->audio_time_offset); /* Fill buffer with data */ GST_BUFFER_TIMESTAMP (outbuf) = pts * GST_MSECOND + demux->audio_time_offset; @@ -1338,8 +1338,8 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer) } /* detect (and deem to be resyncs) large pts gaps */ - gst_flv_demux_update_resync (demux, pts, &demux->last_video_pts, - &demux->video_time_offset); + gst_flv_demux_update_resync (demux, pts, demux->video_need_discont, + &demux->last_video_pts, &demux->video_time_offset); /* Fill buffer with data */ GST_BUFFER_TIMESTAMP (outbuf) = pts * GST_MSECOND + demux->video_time_offset; -- 2.34.1