gst/mpegaudioparse/gstmpegaudioparse.c: Fix a calculation that was causing mp3parse to drop every incoming frame when...

Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Fix a calculation that was causing mp3parse to drop every incoming
frame when upstream delivered a segment in TIME format, breaking
playback of all mpeg system streams.
This commit is contained in:
Jan Schmidt 2007-07-15 19:39:46 +00:00
parent 0a7fe9557b
commit 4039063c80
3 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2007-07-15 Jan Schmidt <thaytan@noraisin.net>
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Fix a calculation that was causing mp3parse to drop every incoming
frame when upstream delivered a segment in TIME format, breaking
playback of all mpeg system streams.
2007-07-13 Jan Schmidt <thaytan@mad.scientist.com>
* Makefile.am:

2
common

@ -1 +1 @@
Subproject commit 5167bced491ffe62251c62d6c5e7b9a7541e97e5
Subproject commit fb4b30ebbec59a8944cacae5fb5cf40bff5dfcaa

View file

@ -582,7 +582,7 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
if (mp3parse->segment.start == 0) {
push_start = 0;
} else if (GST_CLOCK_TIME_IS_VALID (mp3parse->max_bitreservoir)) {
if (mp3parse->segment.start - mp3parse->max_bitreservoir >= 0)
if (mp3parse->segment.start > mp3parse->max_bitreservoir)
push_start = mp3parse->segment.start - mp3parse->max_bitreservoir;
else
push_start = 0;
@ -590,14 +590,16 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size)
push_start = mp3parse->segment.start;
}
if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (mp3parse->segment.start) &&
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))) {
GST_DEBUG_OBJECT (mp3parse,
"Buffer outside of configured segment, dropping, timestamp %"
"Buffer outside of 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_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
GST_BUFFER_OFFSET (outbuf));
gst_buffer_unref (outbuf);