gst/mpegaudioparse/gstmpegaudioparse.c: Handler buffers without valid timestamp more correctly: Don't drop them and d...

Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Handler buffers without valid timestamp more correctly: Don't drop
them and don't use the invalid timestamp to calculate the next
timestamp. Fixes bug #516811.
This commit is contained in:
Sebastian Dröge 2008-02-18 10:25:16 +00:00
parent 98ce07188f
commit 2a179a3b1a
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,11 @@
2008-02-18 Sebastian Dröge <slomo@circular-chaos.org>
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Handler buffers without valid timestamp more correctly: Don't drop
them and don't use the invalid timestamp to calculate the next
timestamp. Fixes bug #516811.
2008-02-18 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Tal Shalif <tshalif at nargila dot org>

View file

@ -563,7 +563,9 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
if (GST_BUFFER_TIMESTAMP (outbuf) == 0)
mp3parse->exact_position = TRUE;
if (mp3parse->exact_position && (!mp3parse->seek_table ||
if (mp3parse->exact_position && GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
mp3parse->cur_offset != GST_BUFFER_OFFSET_NONE &&
(!mp3parse->seek_table ||
(mp3parse_seek_table_last_entry (mp3parse))->byte <
GST_BUFFER_OFFSET (outbuf))) {
MPEGAudioSeekEntry *entry = g_new0 (MPEGAudioSeekEntry, 1);
@ -582,8 +584,10 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
}
mp3parse->tracked_offset += size;
mp3parse->next_ts =
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf);
if (GST_BUFFER_TIMESTAMP_IS_VALID (outbuf)
&& GST_BUFFER_DURATION_IS_VALID (outbuf))
mp3parse->next_ts =
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf);
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (mp3parse->srcpad));
@ -623,6 +627,8 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
}
if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (push_start) &&
GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
GST_BUFFER_DURATION_IS_VALID (outbuf) &&
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf)
< push_start)
|| (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop)