mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-17 21:06:17 +00:00
qtdemux: parse the track id from the track header
Signed-off-by: Andoni Morales Alastruey <amorales@flumotion.com> https://bugzilla.gnome.org/show_bug.cgi?id=596321
This commit is contained in:
parent
2fa531ee3c
commit
c9b866a994
1 changed files with 13 additions and 4 deletions
|
@ -205,6 +205,9 @@ struct _QtDemuxStream
|
||||||
/* if the stream has a redirect URI in its headers, we store it here */
|
/* if the stream has a redirect URI in its headers, we store it here */
|
||||||
gchar *redirect_uri;
|
gchar *redirect_uri;
|
||||||
|
|
||||||
|
/* track id */
|
||||||
|
guint track_id;
|
||||||
|
|
||||||
/* duration/scale */
|
/* duration/scale */
|
||||||
guint64 duration; /* in timescale */
|
guint64 duration; /* in timescale */
|
||||||
guint32 timescale;
|
guint32 timescale;
|
||||||
|
@ -5173,7 +5176,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
guint32 tkhd_flags = 0;
|
guint32 tkhd_flags = 0;
|
||||||
guint8 tkhd_version = 0;
|
guint8 tkhd_version = 0;
|
||||||
guint32 fourcc;
|
guint32 fourcc;
|
||||||
guint len;
|
guint value_size, len;
|
||||||
|
|
||||||
stream = g_new0 (QtDemuxStream, 1);
|
stream = g_new0 (QtDemuxStream, 1);
|
||||||
/* new streams always need a discont */
|
/* new streams always need a discont */
|
||||||
|
@ -5191,8 +5194,14 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
|| !gst_byte_reader_get_uint24_be (&tkhd, &tkhd_flags))
|
|| !gst_byte_reader_get_uint24_be (&tkhd, &tkhd_flags))
|
||||||
goto corrupt_file;
|
goto corrupt_file;
|
||||||
|
|
||||||
GST_LOG_OBJECT (qtdemux, "track[tkhd] version/flags: 0x%02x/%06x",
|
/* pick between 64 or 32 bits */
|
||||||
tkhd_version, tkhd_flags);
|
value_size = tkhd_version == 1 ? 8 : 4;
|
||||||
|
if (!gst_byte_reader_skip (&tkhd, value_size * 2) ||
|
||||||
|
!gst_byte_reader_get_uint32_be (&tkhd, &stream->track_id))
|
||||||
|
goto corrupt_file;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (qtdemux, "track[tkhd] version/flags/id: 0x%02x/%06x/%u",
|
||||||
|
tkhd_version, tkhd_flags, stream->track_id);
|
||||||
|
|
||||||
if (!(mdia = qtdemux_tree_get_child_by_type (trak, FOURCC_mdia)))
|
if (!(mdia = qtdemux_tree_get_child_by_type (trak, FOURCC_mdia)))
|
||||||
goto corrupt_file;
|
goto corrupt_file;
|
||||||
|
@ -5311,7 +5320,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
stream->sampled = TRUE;
|
stream->sampled = TRUE;
|
||||||
|
|
||||||
/* version 1 uses some 64-bit ints */
|
/* version 1 uses some 64-bit ints */
|
||||||
if (!gst_byte_reader_skip (&tkhd, (tkhd_version == 1) ? 84 : 72)
|
if (!gst_byte_reader_skip (&tkhd, 56 + value_size)
|
||||||
|| !gst_byte_reader_get_uint32_be (&tkhd, &w)
|
|| !gst_byte_reader_get_uint32_be (&tkhd, &w)
|
||||||
|| !gst_byte_reader_get_uint32_be (&tkhd, &h))
|
|| !gst_byte_reader_get_uint32_be (&tkhd, &h))
|
||||||
goto corrupt_file;
|
goto corrupt_file;
|
||||||
|
|
Loading…
Reference in a new issue