From 516a0b8acb423c16fd207ac2463c261f869f9f4f Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Thu, 21 Mar 2013 02:53:24 +0100 Subject: [PATCH] qtdemux: ignore empty subtitle buffers https://bugzilla.gnome.org/show_bug.cgi?id=696244 --- gst/isomp4/qtdemux.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index ad5c04901d..d6a85319c3 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -3597,6 +3597,13 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, gst_buffer_map (buf, &map, GST_MAP_READ); + /* empty buffer can be send to terminate previous entry */ + if (map.size == 2 && map.data[0] == 0 && map.data[1] == 0) { + gst_buffer_unmap (buf, &map); + gst_buffer_unref (buf); + return NULL; + } + if (G_LIKELY (map.size >= 2)) { nsize = GST_READ_UINT16_BE (map.data); nsize = MIN (nsize, map.size - 2); @@ -3626,7 +3633,7 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, * Also checks for additional actions and custom processing that may * need to be done first. */ -static gboolean +static GstFlowReturn gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, GstBuffer * buf, guint64 dts, guint64 pts, guint64 duration, gboolean keyframe, @@ -3688,6 +3695,10 @@ gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux, if (G_UNLIKELY (stream->need_process)) buf = gst_qtdemux_process_buffer (qtdemux, stream, buf); + if (!buf) { + goto exit; + } + GST_BUFFER_DTS (buf) = dts; GST_BUFFER_PTS (buf) = pts; GST_BUFFER_DURATION (buf) = duration;