mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 15:36:42 +00:00
mpegaudioparse: Remove useless checks for valid buffer duration.
The buffer duration is set to a valid value at the very top of emit_frame(), we therefore don't need to check it later on.
This commit is contained in:
parent
21d2fffb13
commit
c1953235fa
1 changed files with 3 additions and 5 deletions
|
@ -684,8 +684,7 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size,
|
||||||
}
|
}
|
||||||
mp3parse->tracked_offset += size;
|
mp3parse->tracked_offset += size;
|
||||||
|
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (outbuf)
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (outbuf))
|
||||||
&& GST_BUFFER_DURATION_IS_VALID (outbuf))
|
|
||||||
mp3parse->next_ts =
|
mp3parse->next_ts =
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf);
|
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf);
|
||||||
|
|
||||||
|
@ -775,7 +774,6 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size,
|
||||||
|
|
||||||
if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (push_start) &&
|
if (G_UNLIKELY ((GST_CLOCK_TIME_IS_VALID (push_start) &&
|
||||||
GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
|
GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
|
||||||
GST_BUFFER_DURATION_IS_VALID (outbuf) &&
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf)
|
GST_BUFFER_TIMESTAMP (outbuf) + GST_BUFFER_DURATION (outbuf)
|
||||||
< push_start))) {
|
< push_start))) {
|
||||||
GST_DEBUG_OBJECT (mp3parse,
|
GST_DEBUG_OBJECT (mp3parse,
|
||||||
|
@ -792,12 +790,12 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size,
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
} else if (G_UNLIKELY (GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
|
} else if (G_UNLIKELY (GST_BUFFER_TIMESTAMP_IS_VALID (outbuf) &&
|
||||||
GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop) &&
|
GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop) &&
|
||||||
GST_BUFFER_DURATION_IS_VALID (outbuf) &&
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) >=
|
GST_BUFFER_TIMESTAMP (outbuf) >=
|
||||||
mp3parse->segment.stop + GST_BUFFER_DURATION (outbuf))) {
|
mp3parse->segment.stop + GST_BUFFER_DURATION (outbuf))) {
|
||||||
/* Some mp3 streams have an offset in the timestamps, for which we have to
|
/* Some mp3 streams have an offset in the timestamps, for which we have to
|
||||||
* push the frame *after* the end position in order for the decoder to be
|
* push the frame *after* the end position in order for the decoder to be
|
||||||
* able to decode everything up until the segment.stop position */
|
* able to decode everything up until the segment.stop position.
|
||||||
|
* That is the reason of the calculated offset */
|
||||||
GST_DEBUG_OBJECT (mp3parse,
|
GST_DEBUG_OBJECT (mp3parse,
|
||||||
"Buffer after configured segment range %" GST_TIME_FORMAT " to %"
|
"Buffer after configured segment range %" GST_TIME_FORMAT " to %"
|
||||||
GST_TIME_FORMAT ", returning GST_FLOW_UNEXPECTED, timestamp %"
|
GST_TIME_FORMAT ", returning GST_FLOW_UNEXPECTED, timestamp %"
|
||||||
|
|
Loading…
Reference in a new issue