Fix HEVC from mp4.
This commit is contained in:
1 parent
ee6a471bf2
commit
2fcf67f7f6
2 files changed
+17
-2
No files matched your search
@@ -237,6 +237,14 @@
|
||||
free(ppValue);
|
||||
return magicCookie;
|
||||
}
|
||||
else if (!strcmp(media_data_name, "hvc1")) {
|
||||
uint8_t *ppValue;
|
||||
uint32_t pValueSize;
|
||||
MP4GetTrackBytesProperty(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.hvc1.hvcC.content", &ppValue, &pValueSize);
|
||||
magicCookie = [NSData dataWithBytes:ppValue length:pValueSize];
|
||||
free(ppValue);
|
||||
return magicCookie;
|
||||
}
|
||||
else if (!strcmp(media_data_name, "mp4v")) {
|
||||
uint8_t *ppConfig; uint32_t pConfigSize;
|
||||
MP4GetTrackESConfiguration(_fileHandle, srcTrackId, &ppConfig, &pConfigSize);
|
||||
|
||||
+9
-2
@@ -135,6 +135,7 @@
|
||||
if ([track isMemberOfClass:[MP42VideoTrack class]] && track.format == kMP42VideoCodecType_H264) {
|
||||
|
||||
if (magicCookie.length < sizeof(uint8_t) * 6) {
|
||||
[unsupportedTracks addObject:track];
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -207,10 +208,12 @@
|
||||
[helper->importer setActiveTrack:track];
|
||||
}
|
||||
else {
|
||||
[unsupportedTracks addObject:track];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
[unsupportedTracks addObject:track];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -260,8 +263,10 @@
|
||||
|
||||
// AC-3 audio track
|
||||
else if ([track isMemberOfClass:[MP42AudioTrack class]] && track.format == kMP42AudioCodecType_AC3) {
|
||||
if ([magicCookie length] < sizeof(uint64_t) * 6)
|
||||
if (magicCookie.length < sizeof(uint64_t) * 6) {
|
||||
[unsupportedTracks addObject:track];
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint64_t *ac3Info = (const uint64_t *)[magicCookie bytes];
|
||||
|
||||
@@ -399,8 +404,10 @@
|
||||
|
||||
// VobSub bitmap track
|
||||
else if ([track isMemberOfClass:[MP42SubtitleTrack class]] && track.format == kMP42SubtitleCodecType_VobSub) {
|
||||
if (magicCookie.length < sizeof(uint32_t) * 16)
|
||||
if (magicCookie.length < sizeof(uint32_t) * 16) {
|
||||
[unsupportedTracks addObject:track];
|
||||
continue;
|
||||
}
|
||||
|
||||
dstTrackId = MP4AddSubpicTrack(_fileHandle, timeScale, 640, 480);
|
||||
|
||||
|
||||
Reference in new issue
Block a user