Fix potential use of streamer element after deletion.

If ReplaceDecodeBin fails from TransitionToNext, uridecodebin_ will not be
replaced with a new element. Since TransitionToNext does not check the return
value, it unknowingly deletes uridecodebin_.
This commit is contained in:
Jim Broadus 2019-03-19 18:47:19 -07:00
parent 50e1158106
commit 102c529f80
1 changed files with 4 additions and 1 deletions

View File

@ -1004,7 +1004,10 @@ void GstEnginePipeline::TransitionToNext() {
ignore_tags_ = true;
ReplaceDecodeBin(next_url_);
if (!ReplaceDecodeBin(next_url_)) {
qLog(Error) << "ReplaceDecodeBin failed with " << next_url_;
return;
}
gst_element_set_state(uridecodebin_, GST_STATE_PLAYING);
MaybeLinkDecodeToAudio();