From 63135b9c54110f9a10258b6478662fee061784ca Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 21 Oct 2020 23:27:15 +0200 Subject: [PATCH] Engine will never be in playing state on error --- src/engine/gstenginepipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index ef313c33f..ee6361166 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -838,13 +838,13 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) { g_error_free(error); g_free(debugs); - if (state() == GST_STATE_PLAYING && pipeline_is_initialized_ && next_uri_set_ && (domain == GST_RESOURCE_ERROR || domain == GST_STREAM_ERROR)) { + if (pipeline_is_initialized_ && next_uri_set_ && (domain == GST_RESOURCE_ERROR || domain == GST_STREAM_ERROR)) { // A track is still playing and the next uri is not playable. We ignore the error here so it can play until the end. // But there is no message send to the bus when the current track finishes, we have to add an EOS ourself. qLog(Info) << "Ignoring error when loading next track"; - GstPad *sinkpad = gst_element_get_static_pad(audiobin_, "sink"); - gst_pad_send_event(sinkpad, gst_event_new_eos()); - gst_object_unref(sinkpad); + GstPad *pad = gst_element_get_static_pad(audiobin_, "sink"); + gst_pad_send_event(pad, gst_event_new_eos()); + gst_object_unref(pad); return; }