From fdfc6a2a86dfd95f2d059b1b031e694cce09f67f Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 25 Nov 2013 12:13:43 +1100 Subject: [PATCH] qtdemux: Discard 2 byte subpicture packets As for text subtitles and as suggested in #712643, throw away the 2 byte terminator packets that some encoders insert. This will make things better when remuxing and causes generation of gap events. --- gst/isomp4/qtdemux.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 8a7bdf683f..a8c3fcb9b9 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -3940,12 +3940,11 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, if (stream->pending_event && stream->pad) gst_pad_push_event (stream->pad, stream->pending_event); stream->pending_event = NULL; - /* no further processing needed */ - stream->need_process = FALSE; } if (G_UNLIKELY (stream->subtype != FOURCC_text - && stream->subtype != FOURCC_sbtl)) { + && stream->subtype != FOURCC_sbtl && + stream->subtype != FOURCC_subp)) { return buf; } @@ -3957,6 +3956,11 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, gst_buffer_unref (buf); return NULL; } + if (stream->subtype == FOURCC_subp) { + /* That's all the processing needed for subpictures */ + gst_buffer_unmap (buf, &map); + return buf; + } nsize = GST_READ_UINT16_BE (map.data); nsize = MIN (nsize, map.size - 2); @@ -10157,7 +10161,6 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream, /* store event and trigger custom processing */ stream->pending_event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s); - stream->need_process = TRUE; } else { /* Generic codec_data handler puts it on the caps */ data_ptr = ptr; @@ -10989,6 +10992,7 @@ qtdemux_sub_caps (GstQTDemux * qtdemux, QtDemuxStream * stream, case GST_MAKE_FOURCC ('m', 'p', '4', 's'): _codec ("DVD subtitle"); caps = gst_caps_new_empty_simple ("subpicture/x-dvd"); + stream->need_process = TRUE; break; case GST_MAKE_FOURCC ('t', 'e', 'x', 't'): _codec ("Quicktime timed text");