GNOME Bugzilla – Bug 750104
rtmpsink: Do not crash when receiving buffers after GST_FLOW_ERROR
Last modified: 2015-05-29 14:33:17 UTC
Created attachment 304256 [details] [review] Patch file If the RTMP URI is invalid, the rtmpsink will return GST_FLOW_ERROR. If it still receives buffers after that, it shouldn't crash.
Review of attachment 304256 [details] [review]: Thanks! good catch. A couple of comments. ::: ext/rtmp/gstrtmpsink.c @@ +187,1 @@ I think this would be better if it were named "have_write_error" and the logic inverted. @@ +220,3 @@ + GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, (NULL), ("Failed to write data")); + return GST_FLOW_ERROR; + } This should definitely go in as-is - silly oversight setting the rtmp object to null on a connect error . I'm surprised more people haven't complained. @@ +256,3 @@ } + if (sink->keep_pushing) { Just check the condition and jump to write_error to minimise the diff @@ +403,3 @@ +static GstStateChangeReturn +gst_rtmp_sink_change_state (GstElement * element, GstStateChange transition) +{ This change_state function is unnecessary - the variable will already be set in start() above.
Created attachment 304258 [details] [review] Patch file after comments Thanks for the comments. New patch attached.
Thanks - pushed :)