diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 7c90f10b52..f1de873c6c 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -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) {