Make MP4GetTrackMediaDataName aware of multiple sample descriptions. Only the first one is ready at the moment.
This commit is contained in:
6 files changed
+7
-7
No files matched your search
@@ -24,7 +24,7 @@ MP42_OBJC_DIRECT_MEMBERS
|
||||
|
||||
if (self) {
|
||||
MP4GetTrackFloatProperty(fileHandle, self.trackId, "tkhd.volume", &_volume);
|
||||
const char *dataName = MP4GetTrackMediaDataName(fileHandle, self.trackId);
|
||||
const char *dataName = MP4GetTrackMediaDataName(fileHandle, self.trackId, 0);
|
||||
_extensionType = kMP42AudioEmbeddedExtension_None;
|
||||
|
||||
if (dataName && !strcmp(dataName, "mp4a")) {
|
||||
|
||||
@@ -62,7 +62,7 @@ typedef struct MP4DemuxHelper {
|
||||
MP4TrackId srcTrackId = track.sourceId;
|
||||
|
||||
const char *trackType = MP4GetTrackType(_fileHandle, srcTrackId);
|
||||
const char *media_data_name = MP4GetTrackMediaDataName(_fileHandle, srcTrackId);
|
||||
const char *media_data_name = MP4GetTrackMediaDataName(_fileHandle, srcTrackId, 0);
|
||||
|
||||
if (!trackType) {
|
||||
return nil;
|
||||
|
||||
@@ -47,7 +47,7 @@ uint16_t getFixedVideoWidth(MP4FileHandle fileHandle, MP4TrackId videoTrack);
|
||||
|
||||
NSString * getTrackName(MP4FileHandle fileHandle, MP4TrackId videoTrack);
|
||||
FourCharCode getTrackMediaType(MP4FileHandle fileHandle, MP4TrackId Id);
|
||||
FourCharCode getTrackMediaSubType(MP4FileHandle fileHandle, MP4TrackId Id);
|
||||
FourCharCode getTrackMediaSubType(MP4FileHandle fileHandle, MP4TrackId Id, uint32_t index);
|
||||
|
||||
NSString * getTrackLanguage(MP4FileHandle fileHandle, MP4TrackId Id);
|
||||
NSString * getFilenameLanguage(CFStringRef filename);
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ typedef struct muxer_helper {
|
||||
_updatedProperty = [[NSMutableDictionary alloc] init];
|
||||
|
||||
if (fileHandle) {
|
||||
_format = getTrackMediaSubType(fileHandle, _trackId);
|
||||
_format = getTrackMediaSubType(fileHandle, _trackId, 0);
|
||||
_mediaType = getTrackMediaType(fileHandle, _trackId);
|
||||
|
||||
NSString *trackName = getTrackName(fileHandle, _trackId);
|
||||
|
||||
@@ -30,7 +30,7 @@ MP42_OBJC_DIRECT_MEMBERS
|
||||
MP4GetTrackFloatProperty(fileHandle, self.trackId, "tkhd.height", &_trackHeight);
|
||||
|
||||
_transform = CGAffineTransformIdentity;
|
||||
|
||||
|
||||
uint8_t *val;
|
||||
uint8_t nval[36];
|
||||
uint32_t *ptr32 = (uint32_t*) nval;
|
||||
|
||||
Reference in new issue
Block a user