diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-06-08 11:24:37 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-10-24 11:54:30 -0400 |
commit | ad9e9bedfbe40044d46c807f217280504a2312aa (patch) | |
tree | 2db53332e76cf01103b8dcdca2a4ed0d92bb1bef /gst/flv | |
parent | 6beadb90624bba04dc6a27d0daae026e6699f43c (diff) |
flvmux: Assume PTS is DTS when PTS is missing
This fixes issue for encoders that only sets the DTS. We assume that
there was no re-ordering when that happens.
https://bugzilla.gnome.org/show_bug.cgi?id=762207
Diffstat (limited to 'gst/flv')
-rw-r--r-- | gst/flv/gstflvmux.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gst/flv/gstflvmux.c b/gst/flv/gstflvmux.c index 2080a3cc9..fec8f9397 100644 --- a/gst/flv/gstflvmux.c +++ b/gst/flv/gstflvmux.c @@ -152,6 +152,20 @@ _gst_buffer_new_and_alloc (gsize size, GstBuffer ** buffer, guint8 ** data) *buffer = _gst_buffer_new_wrapped (*data, size, g_free); } +static GstFlowReturn +gst_flv_mux_clip_running_time (GstCollectPads * pads, + GstCollectData * cdata, GstBuffer * buf, GstBuffer ** outbuf, + gpointer user_data) +{ + buf = gst_buffer_make_writable (buf); + + if (!GST_CLOCK_TIME_IS_VALID (GST_BUFFER_PTS (buf))) + GST_BUFFER_PTS (buf) = GST_BUFFER_DTS (buf); + + return gst_collect_pads_clip_running_time (pads, cdata, buf, outbuf, + user_data); +} + static void gst_flv_mux_class_init (GstFlvMuxClass * klass) { @@ -217,7 +231,7 @@ gst_flv_mux_init (GstFlvMux * mux) gst_collect_pads_set_event_function (mux->collect, GST_DEBUG_FUNCPTR (gst_flv_mux_handle_sink_event), mux); gst_collect_pads_set_clip_function (mux->collect, - GST_DEBUG_FUNCPTR (gst_collect_pads_clip_running_time), mux); + GST_DEBUG_FUNCPTR (gst_flv_mux_clip_running_time), mux); gst_flv_mux_reset (GST_ELEMENT (mux)); } |