Make MP4GetTrackMediaDataName aware of multiple sample descriptions. Only the first one is ready at the moment.

This commit is contained in:
Damiano Galassi committed 2021-12-09 12:03:28 +01:00
1 parent deb2e3b0fe
commit 45552f45c0
6 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -214,10 +214,10 @@ FourCharCode getTrackMediaType(MP4FileHandle fileHandle, MP4TrackId Id)
return kMP42MediaType_Unknown;
}
FourCharCode getTrackMediaSubType(MP4FileHandle fileHandle, MP4TrackId Id)
FourCharCode getTrackMediaSubType(MP4FileHandle fileHandle, MP4TrackId Id, uint32_t index)
{
const char *type = MP4GetTrackType(fileHandle, Id);
const char *dataName = MP4GetTrackMediaDataName(fileHandle, Id);
const char *dataName = MP4GetTrackMediaDataName(fileHandle, Id, index);
if (dataName && strlen(dataName) == 4) {
if (!strcmp(dataName, "avc1")) {
return kMP42VideoCodecType_H264;