qtdemux: Use already parsed stsd entries instead of parsing them again
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
This commit is contained in:
parent
cf2b1909ec
commit
bb50741b73
@ -14508,8 +14508,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
|
|
||||||
QtDemuxStream *stream = NULL;
|
QtDemuxStream *stream = NULL;
|
||||||
const guint8 *stsd_data;
|
const guint8 *stsd_data;
|
||||||
const guint8 *stsd_entry_data;
|
|
||||||
guint remaining_stsd_len;
|
|
||||||
guint stsd_entry_count;
|
guint stsd_entry_count;
|
||||||
guint stsd_index;
|
guint stsd_index;
|
||||||
guint16 lang_code; /* quicktime lang code or packed iso code */
|
guint16 lang_code; /* quicktime lang code or packed iso code */
|
||||||
@ -14713,18 +14711,21 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
GST_LOG_OBJECT (qtdemux, "stsd len: %d", stsd_len);
|
GST_LOG_OBJECT (qtdemux, "stsd len: %d", stsd_len);
|
||||||
GST_LOG_OBJECT (qtdemux, "stsd entry count: %u", stsd_entry_count);
|
GST_LOG_OBJECT (qtdemux, "stsd entry count: %u", stsd_entry_count);
|
||||||
|
|
||||||
stsd_entry_data = stsd_data + 16;
|
|
||||||
remaining_stsd_len = stsd_len - 16;
|
|
||||||
for (stsd_index = 0; stsd_index < stsd_entry_count; stsd_index++) {
|
for (stsd_index = 0; stsd_index < stsd_entry_count; stsd_index++) {
|
||||||
|
GNode *stsd_entry;
|
||||||
|
const guint8 *stsd_entry_data;
|
||||||
guint32 fourcc;
|
guint32 fourcc;
|
||||||
gchar *codec = NULL;
|
gchar *codec = NULL;
|
||||||
QtDemuxStreamStsdEntry *entry = &stream->stsd_entries[stsd_index];
|
QtDemuxStreamStsdEntry *entry = &stream->stsd_entries[stsd_index];
|
||||||
|
|
||||||
/* and that entry should fit within stsd */
|
stsd_entry = qtdemux_tree_get_child_by_index (stsd, stsd_index);
|
||||||
len = QT_UINT32 (stsd_entry_data);
|
if (!stsd_entry)
|
||||||
if (len > remaining_stsd_len)
|
|
||||||
goto corrupt_file;
|
goto corrupt_file;
|
||||||
|
|
||||||
|
stsd_entry_data = stsd_entry->data;
|
||||||
|
|
||||||
|
len = QT_UINT32 (stsd_entry_data);
|
||||||
|
|
||||||
entry->fourcc = fourcc = QT_FOURCC (stsd_entry_data + 4);
|
entry->fourcc = fourcc = QT_FOURCC (stsd_entry_data + 4);
|
||||||
GST_LOG_OBJECT (qtdemux, "stsd type: %" GST_FOURCC_FORMAT,
|
GST_LOG_OBJECT (qtdemux, "stsd type: %" GST_FOURCC_FORMAT,
|
||||||
GST_FOURCC_ARGS (entry->fourcc));
|
GST_FOURCC_ARGS (entry->fourcc));
|
||||||
@ -17036,10 +17037,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
} else if (entry->fourcc == FOURCC_mp4a) {
|
} else if (entry->fourcc == FOURCC_mp4a) {
|
||||||
entry->sampled = TRUE;
|
entry->sampled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stsd_entry_data += len;
|
|
||||||
remaining_stsd_len -= len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sample grouping support */
|
/* Sample grouping support */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user