mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
mssdemux: add some more error handling
Post error in some more scenarios: * when the manifest has no streams * when getting the fragment url fails
This commit is contained in:
parent
529b248a89
commit
0f1ef317f0
1 changed files with 14 additions and 3 deletions
|
@ -301,7 +301,10 @@ gst_mss_demux_create_streams (GstMssDemux * mssdemux)
|
||||||
|
|
||||||
if (streams == NULL) {
|
if (streams == NULL) {
|
||||||
GST_INFO_OBJECT (mssdemux, "No streams found in the manifest");
|
GST_INFO_OBJECT (mssdemux, "No streams found in the manifest");
|
||||||
/* TODO post eos? */
|
GST_ELEMENT_ERROR (mssdemux, STREAM, DEMUX,
|
||||||
|
(_("This file contains no playable streams.")),
|
||||||
|
("no streams found at the Manifest"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iter = streams; iter; iter = g_slist_next (iter)) {
|
for (iter = streams; iter; iter = g_slist_next (iter)) {
|
||||||
|
@ -434,7 +437,7 @@ gst_mss_demux_stream_loop (GstMssDemuxStream * stream)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!path) {
|
if (!path) {
|
||||||
/* TODO */
|
goto no_url_error;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (mssdemux, "Got url path '%s' for stream %p", path, stream);
|
GST_DEBUG_OBJECT (mssdemux, "Got url path '%s' for stream %p", path, stream);
|
||||||
|
|
||||||
|
@ -448,7 +451,7 @@ gst_mss_demux_stream_loop (GstMssDemuxStream * stream)
|
||||||
buffer = gst_buffer_make_metadata_writable (buffer);
|
buffer = gst_buffer_make_metadata_writable (buffer);
|
||||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (stream->pad));
|
gst_buffer_set_caps (buffer, GST_PAD_CAPS (stream->pad));
|
||||||
|
|
||||||
ret = gst_pad_push (stream->pad, buffer); /* TODO check return */
|
ret = gst_pad_push (stream->pad, buffer);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case GST_FLOW_UNEXPECTED:
|
case GST_FLOW_UNEXPECTED:
|
||||||
goto eos; /* EOS ? */
|
goto eos; /* EOS ? */
|
||||||
|
@ -473,6 +476,14 @@ eos:
|
||||||
gst_task_stop (stream->stream_task);
|
gst_task_stop (stream->stream_task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
no_url_error:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (mssdemux, STREAM, DEMUX,
|
||||||
|
(_("Failed to get fragment URL.")),
|
||||||
|
("An error happened when getting fragment URL"));
|
||||||
|
gst_task_stop (stream->stream_task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
error:
|
error:
|
||||||
{
|
{
|
||||||
GST_WARNING_OBJECT (mssdemux, "Error while pushing fragment");
|
GST_WARNING_OBJECT (mssdemux, "Error while pushing fragment");
|
||||||
|
|
Loading…
Reference in a new issue