mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
audiodecoder: return EOS when segment is over
if a buffer is clipped by being completely out of segment, check if this buffer is after the end of the segment and return EOS upstream https://bugzilla.gnome.org/show_bug.cgi?id=709224
This commit is contained in:
parent
d3ca7271dc
commit
09b8f902ea
1 changed files with 8 additions and 0 deletions
|
@ -901,6 +901,7 @@ gst_audio_decoder_push_forward (GstAudioDecoder * dec, GstBuffer * buf)
|
||||||
GstAudioDecoderPrivate *priv;
|
GstAudioDecoderPrivate *priv;
|
||||||
GstAudioDecoderContext *ctx;
|
GstAudioDecoderContext *ctx;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
GstClockTime ts;
|
||||||
|
|
||||||
klass = GST_AUDIO_DECODER_GET_CLASS (dec);
|
klass = GST_AUDIO_DECODER_GET_CLASS (dec);
|
||||||
priv = dec->priv;
|
priv = dec->priv;
|
||||||
|
@ -914,6 +915,7 @@ gst_audio_decoder_push_forward (GstAudioDecoder * dec, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->had_output_data = TRUE;
|
ctx->had_output_data = TRUE;
|
||||||
|
ts = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
|
||||||
GST_LOG_OBJECT (dec,
|
GST_LOG_OBJECT (dec,
|
||||||
"clipping buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT
|
"clipping buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT
|
||||||
|
@ -926,6 +928,12 @@ gst_audio_decoder_push_forward (GstAudioDecoder * dec, GstBuffer * buf)
|
||||||
ctx->info.bpf);
|
ctx->info.bpf);
|
||||||
if (G_UNLIKELY (!buf)) {
|
if (G_UNLIKELY (!buf)) {
|
||||||
GST_DEBUG_OBJECT (dec, "no data after clipping to segment");
|
GST_DEBUG_OBJECT (dec, "no data after clipping to segment");
|
||||||
|
if (dec->output_segment.rate >= 0) {
|
||||||
|
if (ts >= dec->output_segment.stop)
|
||||||
|
ret = GST_FLOW_EOS;
|
||||||
|
} else if (ts < dec->output_segment.start) {
|
||||||
|
ret = GST_FLOW_EOS;
|
||||||
|
}
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue