qtmux: Use buffer PTS if DTS is not set

Avoids ending up with completely bogus scaled duration/pts when new
buffers have invalid DTS.
This commit is contained in:
Edward Hervey 2013-08-04 16:52:15 +02:00
parent 67eb029a50
commit 4f4f6432cc

View file

@ -2229,7 +2229,10 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
if (pad->have_dts) { if (pad->have_dts) {
gint64 scaled_dts; gint64 scaled_dts;
if (pad->last_buf) { if (pad->last_buf) {
pad->last_dts = GST_BUFFER_DTS (pad->last_buf); if (GST_BUFFER_DTS_IS_VALID (pad->last_buf))
pad->last_dts = GST_BUFFER_DTS (pad->last_buf);
else
pad->last_dts = GST_BUFFER_PTS (pad->last_buf);
} else { } else {
pad->last_dts = GST_BUFFER_DTS (last_buf) + pad->last_dts = GST_BUFFER_DTS (last_buf) +
GST_BUFFER_DURATION (last_buf); GST_BUFFER_DURATION (last_buf);