Advice on handling GST_RESOURCE_ERROR_NOT_FOUND for a stream

elboulangero elboulangero at gmail.com
Fri Dec 16 11:24:24 UTC 2016


Dear Gst developers,

I'd like some advice on the correct way to handle a specific error:

    GST_RESOURCE_ERROR: GST_RESOURCE_ERROR_NOT_FOUND
    Could not resolve server name.

I use gstreamer to play online radios. I just create a 'playbin'
element, everything is then handled auto-magically, there's nothing
fancy here.

I have two very different use-case that lead to the same error, and I
need to distinguish between both.

First case
----------

The network is down. I get the following error message on the bus:

Gst error msg: gst-resource-error-quark:3: Could not resolve server name.
Gst error debug: gstsouphttpsrc.c(1315): gst_soup_http_src_parse_status
(): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
Error resolving 'direct.fipradio.fr': Temporary failure in name
resolution (2), URL: http://direct.fipradio.fr/live/fip-midfi.mp3,
Redirect to: (NULL)

In this case, I want to continue trying to play the stream. Ultimately,
the network will be brought up, and the playback will start.

Second case
-----------

I'm trying to play an invalid url (the server url is wrong).

Gst error msg: gst-resource-error-quark:3: Could not resolve server name.
Gst error debug: gstsouphttpsrc.c(1315): gst_soup_http_src_parse_status
(): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
Error resolving 'direct.fipxxxxx.fr': Name or service not known (2),
URL: http://direct.fipxxxxx.fr/live/fip-midfi.mp3, Redirect to: (NULL)

In this case, I want to stop trying to play the stream, and report the
error to the user.

Issue
-----

As you can see from the logs, both situation lead to the same error,
with the same error message (1st line in the logs). The only way for me
to know what's really happening would be to parse the debug message. The
3rd line (coming directly from libsoup I guess) tells me what I want to
know.

But parsing the debug message is probably not the right thing to do it.
Or is it ?

If I don't parse use the debug message, then what would be the right way
to distinguish between these two errors ? Is there an easy way through Gst ?

Thanks for your advice !

Best regards,
Arnaud



More information about the gstreamer-devel mailing list