Commit a993883b authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

qtmux: Don't calculate PTS offset and DTS with GST_CLOCK_TIME_NONE

Just error out if there is no valid PTS.

https://bugzilla.gnome.org/show_bug.cgi?id=772143
parent 52879dac
...@@ -3302,13 +3302,15 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf) ...@@ -3302,13 +3302,15 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
sync = TRUE; sync = TRUE;
} }
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (last_buf))) { if (!GST_BUFFER_PTS_IS_VALID (last_buf))
goto no_pts;
if (GST_BUFFER_DTS_IS_VALID (last_buf)) {
last_dts = gst_util_uint64_scale_round (GST_BUFFER_DTS (last_buf), last_dts = gst_util_uint64_scale_round (GST_BUFFER_DTS (last_buf),
atom_trak_get_timescale (pad->trak), GST_SECOND); atom_trak_get_timescale (pad->trak), GST_SECOND);
pts_offset = pts_offset =
(gint64) (gst_util_uint64_scale_round (GST_BUFFER_PTS (last_buf), (gint64) (gst_util_uint64_scale_round (GST_BUFFER_PTS (last_buf),
atom_trak_get_timescale (pad->trak), GST_SECOND) - last_dts); atom_trak_get_timescale (pad->trak), GST_SECOND) - last_dts);
} else { } else {
pts_offset = 0; pts_offset = 0;
last_dts = gst_util_uint64_scale_round (GST_BUFFER_PTS (last_buf), last_dts = gst_util_uint64_scale_round (GST_BUFFER_PTS (last_buf),
...@@ -3388,6 +3390,11 @@ fragmented_sample: ...@@ -3388,6 +3390,11 @@ fragmented_sample:
("Audio buffer contains fragmented sample.")); ("Audio buffer contains fragmented sample."));
goto bail; goto bail;
} }
no_pts:
{
GST_ELEMENT_ERROR (qtmux, STREAM, MUX, (NULL), ("Buffer has no PTS."));
goto bail;
}
not_negotiated: not_negotiated:
{ {
GST_ELEMENT_ERROR (qtmux, CORE, NEGOTIATION, (NULL), GST_ELEMENT_ERROR (qtmux, CORE, NEGOTIATION, (NULL),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment