From aa7d597120a7a772fbd922202b6063a3806cf5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 19 Jul 2013 19:35:26 +0100 Subject: [PATCH] qtdemux: make files from Vivotek camera play Skip tracks of 'vivo' subtype with empty stsd instead of erroring out saying that the file is broken. https://bugzilla.gnome.org/show_bug.cgi?id=699791 --- gst/isomp4/qtdemux.c | 11 +++++++++-- gst/isomp4/qtdemux_fourcc.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index e25aa90e05..3361679ca3 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -7053,8 +7053,15 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) /* stsd should at least have one entry */ stsd_len = QT_UINT32 (stsd_data); - if (stsd_len < 24) - goto corrupt_file; + if (stsd_len < 24) { + /* .. but skip stream with empty stsd produced by some Vivotek cameras */ + if (stream->subtype == FOURCC_vivo) { + g_free (stream); + return TRUE; + } else { + goto corrupt_file; + } + } GST_LOG_OBJECT (qtdemux, "stsd len: %d", stsd_len); diff --git a/gst/isomp4/qtdemux_fourcc.h b/gst/isomp4/qtdemux_fourcc.h index 9e660726f4..9a34dfdd10 100644 --- a/gst/isomp4/qtdemux_fourcc.h +++ b/gst/isomp4/qtdemux_fourcc.h @@ -180,6 +180,7 @@ G_BEGIN_DECLS #define FOURCC_apco GST_MAKE_FOURCC('a','p','c','o') #define FOURCC_ap4h GST_MAKE_FOURCC('a','p','4','h') #define FOURCC_m1v GST_MAKE_FOURCC('m','1','v',' ') +#define FOURCC_vivo GST_MAKE_FOURCC('v','i','v','o') /* SVQ3 fourcc */ #define FOURCC_SEQH GST_MAKE_FOURCC('S','E','Q','H')