mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gst/wavparse/gstwavparse.*: Apply DISCONT to buffers.
Original commit message from CVS: * gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek), (gst_wavparse_stream_headers), (gst_wavparse_stream_data): * gst/wavparse/gstwavparse.h: Apply DISCONT to buffers. Only apply timestamp to the first sample after a DISCONT, too many VBR files cause random jitter in the timestamps. Fixes #433119.
This commit is contained in:
parent
6937be1a09
commit
88bf47c911
3 changed files with 34 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-04-26 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek),
|
||||
(gst_wavparse_stream_headers), (gst_wavparse_stream_data):
|
||||
* gst/wavparse/gstwavparse.h:
|
||||
Apply DISCONT to buffers.
|
||||
Only apply timestamp to the first sample after a DISCONT, too many VBR
|
||||
files cause random jitter in the timestamps. Fixes #433119.
|
||||
|
||||
2007-04-25 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/rtsp/gstrtpdec.c: (gst_rtp_dec_class_init),
|
||||
|
|
|
@ -905,6 +905,9 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
|
|||
wav->segment.format, wav->segment.last_stop, stop,
|
||||
wav->segment.last_stop);
|
||||
|
||||
/* mark discont */
|
||||
wav->discont = TRUE;
|
||||
|
||||
/* and start the streaming task again */
|
||||
wav->segment_running = TRUE;
|
||||
if (!wav->streaming) {
|
||||
|
@ -1167,6 +1170,9 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
size = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf) + 4);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (wav, "Got TAG: %" GST_FOURCC_FORMAT,
|
||||
GST_FOURCC_ARGS (tag));
|
||||
|
||||
gst_wavparse_get_upstream_size (wav, &upstream_size);
|
||||
|
||||
/* wav is a st00pid format, we don't know for sure where data starts.
|
||||
|
@ -1222,6 +1228,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
wav->fact = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf));
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
GST_DEBUG_OBJECT (wav, "have fact %u", wav->fact);
|
||||
wav->offset += 8 + 4;
|
||||
break;
|
||||
}
|
||||
|
@ -1541,10 +1548,23 @@ iterate_adapter:
|
|||
|
||||
/* update current running segment position */
|
||||
gst_segment_set_last_stop (&wav->segment, GST_FORMAT_TIME, next_timestamp);
|
||||
|
||||
/* only apply the timestamp to the first DISCONT buffer because we might be
|
||||
* dealing with VBR data that can make the timestamps drift a lot */
|
||||
if (wav->discont) {
|
||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||
wav->discont = FALSE;
|
||||
} else {
|
||||
timestamp = GST_CLOCK_TIME_NONE;
|
||||
duration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
} else {
|
||||
/* no bitrate, don't timestamp */
|
||||
timestamp = GST_CLOCK_TIME_NONE;
|
||||
next_timestamp = GST_CLOCK_TIME_NONE;
|
||||
/* no bitrate, all we know is that the first sample has timestamp 0, all
|
||||
* other positions and durations have unknown timestamp. */
|
||||
if (pos == 0)
|
||||
timestamp = 0;
|
||||
else
|
||||
timestamp = GST_CLOCK_TIME_NONE;
|
||||
duration = GST_CLOCK_TIME_NONE;
|
||||
/* update current running segment position with byte offset */
|
||||
gst_segment_set_last_stop (&wav->segment, GST_FORMAT_BYTES, nextpos);
|
||||
|
|
|
@ -110,6 +110,8 @@ struct _GstWavParse {
|
|||
|
||||
/* for late pad configuration */
|
||||
gboolean first;
|
||||
/* discont after seek */
|
||||
gboolean discont;
|
||||
};
|
||||
|
||||
struct _GstWavParseClass {
|
||||
|
|
Loading…
Reference in a new issue