qtmux: Don't forget to update pad->last_buf

buf is the current pad->last_buf value. If ever it gets copied/unreffed,
we need to make sure to write back the new  pointer to the last_buf
variable.

Fixes using wrong pointer values in the case of decrasing DTS value
This commit is contained in:
Edward Hervey 2017-04-12 13:26:59 +02:00 committed by Edward Hervey
parent 7e9b7658e5
commit 7077425c3d

View file

@ -3276,7 +3276,7 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
GST_ERROR ("decreasing DTS value %" GST_TIME_FORMAT " < %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DTS (buf)),
GST_TIME_ARGS (GST_BUFFER_DTS (last_buf)));
buf = gst_buffer_make_writable (buf);
pad->last_buf = buf = gst_buffer_make_writable (buf);
GST_BUFFER_DTS (buf) = GST_BUFFER_DTS (last_buf);
}