diff --git a/ext/hls/gsthlssink.c b/ext/hls/gsthlssink.c index 7180755689..8a3c305c82 100644 --- a/ext/hls/gsthlssink.c +++ b/ext/hls/gsthlssink.c @@ -283,8 +283,14 @@ gst_hls_sink_handle_message (GstBin * bin, GstMessage * message) title, duration, sink->index, discont); g_free (entry_location); playlist_content = gst_m3u8_playlist_render (sink->playlist); - g_file_set_contents (sink->playlist_location, - playlist_content, -1, &error); + if (!g_file_set_contents (sink->playlist_location, + playlist_content, -1, &error)) { + GST_ERROR ("Failed to write playlist: %s", error->message); + GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, + (("Failed to write playlist '%s'."), error->message), (NULL)); + g_error_free (error); + error = NULL; + } g_free (playlist_content); /* multifilesink is starting a new file. It means that upstream sent a key