avimux: don't make the buffer writable unless absolutely necessary

https://bugzilla.gnome.org/show_bug.cgi?id=722396
This commit is contained in:
Michael Olbrich 2013-12-11 09:36:22 +01:00 committed by Thiago Santos
parent 3978f6ae6c
commit 447556fe6b

View file

@ -1998,13 +1998,16 @@ gst_avi_mux_do_buffer (GstAviMux * avimux, GstAviPad * avipad)
gulong total_size, pad_bytes = 0;
guint flags;
gsize datasize;
GstClockTime time;
data = gst_collect_pads_pop (avimux->collect, avipad->collect);
/* arrange downstream running time */
data = gst_buffer_make_writable (data);
GST_BUFFER_TIMESTAMP (data) =
gst_segment_to_running_time (&avipad->collect->segment,
time = gst_segment_to_running_time (&avipad->collect->segment,
GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (data));
if (time != GST_BUFFER_TIMESTAMP (data)) {
data = gst_buffer_make_writable (data);
GST_BUFFER_TIMESTAMP (data) = time;
}
/* Prepend a special buffer to the first one for some formats */
if (avipad->is_video) {