mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
androidmedia: fix access to invalid buffers in the decoding loop
Flushing the decoder invalidates all buffers, so it should be done after quiting the decoding loop. Otherwise we can jump into "failed_release" and stop everything https://bugzilla.gnome.org/show_bug.cgi?id=711156
This commit is contained in:
parent
0baac2ffb9
commit
6b49683447
2 changed files with 2 additions and 4 deletions
|
@ -1017,8 +1017,6 @@ gst_amc_audio_dec_flush (GstAudioDecoder * decoder, gboolean hard)
|
|||
}
|
||||
|
||||
self->flushing = TRUE;
|
||||
gst_amc_codec_flush (self->codec);
|
||||
|
||||
/* Wait until the srcpad loop is finished,
|
||||
* unlock GST_AUDIO_DECODER_STREAM_LOCK to prevent deadlocks
|
||||
* caused by using this lock from inside the loop function */
|
||||
|
@ -1026,6 +1024,7 @@ gst_amc_audio_dec_flush (GstAudioDecoder * decoder, gboolean hard)
|
|||
GST_PAD_STREAM_LOCK (GST_AUDIO_DECODER_SRC_PAD (self));
|
||||
GST_PAD_STREAM_UNLOCK (GST_AUDIO_DECODER_SRC_PAD (self));
|
||||
GST_AUDIO_DECODER_STREAM_LOCK (self);
|
||||
gst_amc_codec_flush (self->codec);
|
||||
self->flushing = FALSE;
|
||||
|
||||
/* Start the srcpad loop again */
|
||||
|
|
|
@ -1507,8 +1507,6 @@ gst_amc_video_dec_flush (GstVideoDecoder * decoder)
|
|||
}
|
||||
|
||||
self->flushing = TRUE;
|
||||
gst_amc_codec_flush (self->codec);
|
||||
|
||||
/* Wait until the srcpad loop is finished,
|
||||
* unlock GST_VIDEO_DECODER_STREAM_LOCK to prevent deadlocks
|
||||
* caused by using this lock from inside the loop function */
|
||||
|
@ -1516,6 +1514,7 @@ gst_amc_video_dec_flush (GstVideoDecoder * decoder)
|
|||
GST_PAD_STREAM_LOCK (GST_VIDEO_DECODER_SRC_PAD (self));
|
||||
GST_PAD_STREAM_UNLOCK (GST_VIDEO_DECODER_SRC_PAD (self));
|
||||
GST_VIDEO_DECODER_STREAM_LOCK (self);
|
||||
gst_amc_codec_flush (self->codec);
|
||||
self->flushing = FALSE;
|
||||
|
||||
/* Start the srcpad loop again */
|
||||
|
|
Loading…
Reference in a new issue