mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-18 04:18:20 +00:00
hlsdemux: Propagate error messages from the source element up in the hierarchy
Instead of inventing our own generic error strings which are mostly useless.
This commit is contained in:
parent
213883eb51
commit
1e795ccce1
|
@ -365,6 +365,8 @@ gst_hls_demux_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
/* error, but ask to retry */
|
/* error, but ask to retry */
|
||||||
g_mutex_lock (&demux->fragment_download_lock);
|
g_mutex_lock (&demux->fragment_download_lock);
|
||||||
demux->last_ret = GST_FLOW_CUSTOM_ERROR;
|
demux->last_ret = GST_FLOW_CUSTOM_ERROR;
|
||||||
|
g_clear_error (&demux->last_error);
|
||||||
|
demux->last_error = g_error_copy (err);
|
||||||
g_cond_signal (&demux->fragment_download_cond);
|
g_cond_signal (&demux->fragment_download_cond);
|
||||||
g_mutex_unlock (&demux->fragment_download_lock);
|
g_mutex_unlock (&demux->fragment_download_lock);
|
||||||
|
|
||||||
|
@ -1311,6 +1313,8 @@ gst_hls_demux_reset (GstHLSDemux * demux, gboolean dispose)
|
||||||
gst_element_set_state (demux->src, GST_STATE_NULL);
|
gst_element_set_state (demux->src, GST_STATE_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_clear_error (&demux->last_error);
|
||||||
|
|
||||||
if (demux->adapter)
|
if (demux->adapter)
|
||||||
gst_adapter_clear (demux->adapter);
|
gst_adapter_clear (demux->adapter);
|
||||||
if (demux->pending_buffer)
|
if (demux->pending_buffer)
|
||||||
|
@ -1978,6 +1982,7 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
|
||||||
|
|
||||||
/* Reset last flow return */
|
/* Reset last flow return */
|
||||||
demux->last_ret = GST_FLOW_OK;
|
demux->last_ret = GST_FLOW_OK;
|
||||||
|
g_clear_error (&demux->last_error);
|
||||||
|
|
||||||
if (!gst_hls_demux_update_source (demux, next_fragment_uri,
|
if (!gst_hls_demux_update_source (demux, next_fragment_uri,
|
||||||
demux->client->main ? demux->client->main->uri : NULL,
|
demux->client->main ? demux->client->main->uri : NULL,
|
||||||
|
@ -2028,9 +2033,15 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
|
||||||
|
|
||||||
if (demux->last_ret != GST_FLOW_OK) {
|
if (demux->last_ret != GST_FLOW_OK) {
|
||||||
gst_element_set_state (demux->src, GST_STATE_NULL);
|
gst_element_set_state (demux->src, GST_STATE_NULL);
|
||||||
if (*err == NULL)
|
if (*err == NULL) {
|
||||||
|
if (demux->last_error) {
|
||||||
|
*err = demux->last_error;
|
||||||
|
demux->last_error = NULL;
|
||||||
|
} else {
|
||||||
*err = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
|
*err = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
|
||||||
"Failed to download fragment");
|
"Failed to download fragment");
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
gst_element_set_state (demux->src, GST_STATE_READY);
|
gst_element_set_state (demux->src, GST_STATE_READY);
|
||||||
if (demux->segment.rate > 0)
|
if (demux->segment.rate > 0)
|
||||||
|
|
|
@ -125,6 +125,7 @@ struct _GstHLSDemux
|
||||||
gint64 download_total_time;
|
gint64 download_total_time;
|
||||||
gint64 download_total_bytes;
|
gint64 download_total_bytes;
|
||||||
GstFlowReturn last_ret;
|
GstFlowReturn last_ret;
|
||||||
|
GError *last_error;
|
||||||
|
|
||||||
/* decryption tooling */
|
/* decryption tooling */
|
||||||
#ifdef HAVE_NETTLE
|
#ifdef HAVE_NETTLE
|
||||||
|
|
Loading…
Reference in a new issue