gst/mpegaudioparse/gstmpegaudioparse.c: Return GST_FLOW_UNEXPECTED if we get data that is after our configured segmen...

Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Return GST_FLOW_UNEXPECTED if we get data that is after our
configured segment. This makes upstream go EOS immediately instead
of sending us the complete stream. Also improve debugging a bit.
This commit is contained in:
Sebastian Dröge 2008-02-14 13:58:42 +00:00
parent 79f25f10db
commit 451f53d7de
2 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2008-02-14 Sebastian Dröge <slomo@circular-chaos.org>
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Return GST_FLOW_UNEXPECTED if we get data that is after our
configured segment. This makes upstream go EOS immediately instead
of sending us the complete stream. Also improve debugging a bit.
2008-02-13 Jan Schmidt <jan.schmidt@sun.com>
* ext/dvdread/dvdreadsrc.c:

View file

@ -624,18 +624,31 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (push_start) &&
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf)
< push_start)
|| (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop)
&& GST_BUFFER_TIMESTAMP (outbuf) >= mp3parse->segment.stop))) {
< push_start))) {
GST_DEBUG_OBJECT (mp3parse,
"Buffer outside of configured segment range %" GST_TIME_FORMAT
"Buffer before configured segment range %" GST_TIME_FORMAT
" to %" GST_TIME_FORMAT ", dropping, timestamp %"
GST_TIME_FORMAT ", offset 0x%08" G_GINT64_MODIFIER "x",
GST_TIME_ARGS (push_start), GST_TIME_ARGS (mp3parse->segment.stop),
GST_TIME_FORMAT " duration %" GST_TIME_FORMAT
", offset 0x%08" G_GINT64_MODIFIER "x", GST_TIME_ARGS (push_start),
GST_TIME_ARGS (mp3parse->segment.stop),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
GST_BUFFER_OFFSET (outbuf));
gst_buffer_unref (outbuf);
ret = GST_FLOW_OK;
} else if (G_UNLIKELY (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop)
&& GST_BUFFER_TIMESTAMP (outbuf) >= mp3parse->segment.stop)) {
GST_DEBUG_OBJECT (mp3parse,
"Buffer after configured segment range %" GST_TIME_FORMAT
" to %" GST_TIME_FORMAT ", returning GST_FLOW_UNEXPECTED, timestamp %"
GST_TIME_FORMAT " duration %" GST_TIME_FORMAT ", offset 0x%08"
G_GINT64_MODIFIER "x", GST_TIME_ARGS (push_start),
GST_TIME_ARGS (mp3parse->segment.stop),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
GST_BUFFER_OFFSET (outbuf));
gst_buffer_unref (outbuf);
ret = GST_FLOW_UNEXPECTED;
} else {
GST_DEBUG_OBJECT (mp3parse,
"pushing buffer of %d bytes, timestamp %" GST_TIME_FORMAT