diff --git a/ChangeLog b/ChangeLog index d64678a1db..4d90bb24b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-04-04 Tim-Philipp Müller + + Patch by: Mark Nauwelaerts + + * plugins/elements/gstfilesink.c: (gst_file_sink_render): + Don't error out on empty buffers (#336945). + 2006-04-04 Jan Schmidt * docs/libs/gstreamer-libs-sections.txt: diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 1cf513f5c1..de6f669e75 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -412,10 +412,12 @@ gst_file_sink_render (GstBaseSink * sink, GstBuffer * buffer) GST_DEBUG_OBJECT (filesink, "writing %u bytes at %" G_GUINT64_FORMAT, size, cur_pos); - if (fwrite (GST_BUFFER_DATA (buffer), size, 1, filesink->file) != 1) - goto handle_error; + if (size > 0 && GST_BUFFER_DATA (buffer) != NULL) { + if (fwrite (GST_BUFFER_DATA (buffer), size, 1, filesink->file) != 1) + goto handle_error; - filesink->data_written += size - back_pending; + filesink->data_written += size - back_pending; + } return GST_FLOW_OK;