Engine will never be in playing state on error
This commit is contained in:
parent
f7c666584e
commit
63135b9c54
|
@ -838,13 +838,13 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) {
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
g_free(debugs);
|
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.
|
// 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.
|
// 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";
|
qLog(Info) << "Ignoring error when loading next track";
|
||||||
GstPad *sinkpad = gst_element_get_static_pad(audiobin_, "sink");
|
GstPad *pad = gst_element_get_static_pad(audiobin_, "sink");
|
||||||
gst_pad_send_event(sinkpad, gst_event_new_eos());
|
gst_pad_send_event(pad, gst_event_new_eos());
|
||||||
gst_object_unref(sinkpad);
|
gst_object_unref(pad);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue