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 _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Fri, 2016-12-16 at 18:24 +0700, elboulangero wrote:
> > 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 ? There's currently not better way, but parsing those strings is also not guaranteed to work (they might just change at any time). Please file a bug about this. There are ways to add additional information to error messages now, which you could use here. Maybe some kind of "try-again" flag. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
Free forum by Nabble | Edit this page |