diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2006-01-18 18:54:02 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2006-01-18 18:54:02 +0000 |
commit | 017bbb0338c9b94237c3124abdcc3121cb612810 (patch) | |
tree | 50bbafa5f9d3c0b4dc036e100ebe4065e296eeec /gst | |
parent | e8cbc6feedbedc57f58293a20c5d6892f061ab02 (diff) | |
download | gst-plugins-bad-017bbb0338c9b94237c3124abdcc3121cb612810.tar.gz gst-plugins-bad-017bbb0338c9b94237c3124abdcc3121cb612810.tar.bz2 gst-plugins-bad-017bbb0338c9b94237c3124abdcc3121cb612810.zip |
Ronald's patch applied. see bug #326318.
Original commit message from CVS:
Ronald's patch applied. see bug #326318.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/qtdemux/qtdemux.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index b1a507e6..ee0383cb 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -2000,20 +2000,33 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) } else { if (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4) == GST_MAKE_FOURCC ('a', 'v', 'c', '1')) { - gint len = QTDEMUX_GUINT32_GET (stsd->data); + gint len = QTDEMUX_GUINT32_GET (stsd->data) - 0x66; + guint8 *stsddata = stsd->data + 0x66; + - if (len > 0x6E && - QTDEMUX_FOURCC_GET (stsd->data + 0x6A) == + /* find avcC */ + while (len >= 0x8 && + QTDEMUX_FOURCC_GET (stsddata + 0x4) != + GST_MAKE_FOURCC ('a', 'v', 'c', 'C') && + QTDEMUX_GUINT32_GET (stsddata) < len) { + len -= QTDEMUX_GUINT32_GET (stsddata); + stsddata += QTDEMUX_GUINT32_GET (stsddata); + } + + /* parse, if found */ + if (len > 0x8 && + QTDEMUX_FOURCC_GET (stsddata + 0x4) == GST_MAKE_FOURCC ('a', 'v', 'c', 'C')) { GstBuffer *buf; gint size; - if (QTDEMUX_GUINT32_GET (stsd->data + 0x66) < len - 0x66) - size = QTDEMUX_GUINT32_GET (stsd->data + 0x66) - 8; + if (QTDEMUX_GUINT32_GET (stsddata) < len) + size = QTDEMUX_GUINT32_GET (stsddata) - 0x8; else - size = len - 0x6E; + size = len - 0x8; + buf = gst_buffer_new_and_alloc (size); - memcpy (GST_BUFFER_DATA (buf), (guint8 *) stsd->data + 0x6E, size); + memcpy (GST_BUFFER_DATA (buf), (guint8 *) stsd->data + 0x8, size); gst_caps_set_simple (stream->caps, "codec_data", GST_TYPE_BUFFER, buf, NULL); gst_buffer_unref (buf); |