}
done:
- if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err))
+ if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err)) {
+ if (self->flushing) {
+ g_clear_error (&err);
+ goto flushing;
+ }
goto failed_release;
+ }
if (is_eos || flow_ret == GST_FLOW_EOS) {
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
GST_AUDIO_DECODER_STREAM_LOCK (self);
if (idx < 0) {
- if (self->flushing) {
+ if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) {
g_clear_error (&err);
goto flushing;
}
if (idx >= self->n_input_buffers)
goto invalid_buffer_index;
- if (self->flushing)
+ if (self->flushing) {
+ memset (&buffer_info, 0, sizeof (buffer_info));
+ gst_amc_codec_queue_input_buffer (self->codec, idx, &buffer_info, NULL);
goto flushing;
+ }
if (self->downstream_flow_ret != GST_FLOW_OK) {
memset (&buffer_info, 0, sizeof (buffer_info));
/*} */
if (idx < 0) {
- if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) {
+ if (self->flushing) {
g_clear_error (&err);
goto flushing;
}
flow_ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
}
- if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err))
+ if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err)) {
+ if (self->flushing) {
+ g_clear_error (&err);
+ goto flushing;
+ }
goto failed_release;
+ }
if (is_eos || flow_ret == GST_FLOW_EOS) {
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
GST_VIDEO_DECODER_STREAM_LOCK (self);
if (idx < 0) {
- if (self->flushing) {
+ if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) {
g_clear_error (&err);
goto flushing;
}
if (idx >= self->n_input_buffers)
goto invalid_buffer_index;
- if (self->flushing)
+ if (self->flushing) {
+ memset (&buffer_info, 0, sizeof (buffer_info));
+ gst_amc_codec_queue_input_buffer (self->codec, idx, &buffer_info, NULL);
goto flushing;
+ }
if (self->downstream_flow_ret != GST_FLOW_OK) {
memset (&buffer_info, 0, sizeof (buffer_info));
/*} */
if (idx < 0 || self->amc_format) {
- if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) {
+ if (self->flushing) {
g_clear_error (&err);
goto flushing;
}
flow_ret =
gst_amc_video_enc_handle_output_frame (self, buf, &buffer_info, frame);
- if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err))
+ if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err)) {
+ if (self->flushing) {
+ g_clear_error (&err);
+ goto flushing;
+ }
goto failed_release;
+ }
if (is_eos || flow_ret == GST_FLOW_EOS) {
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
GST_VIDEO_ENCODER_STREAM_LOCK (self);
if (idx < 0) {
- if (self->flushing) {
+ if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) {
g_clear_error (&err);
goto flushing;
}
if (idx >= self->n_input_buffers)
goto invalid_buffer_index;
- if (self->flushing)
+ if (self->flushing) {
+ memset (&buffer_info, 0, sizeof (buffer_info));
+ gst_amc_codec_queue_input_buffer (self->codec, idx, &buffer_info, NULL);
goto flushing;
+ }
if (self->downstream_flow_ret != GST_FLOW_OK) {
memset (&buffer_info, 0, sizeof (buffer_info));