This commit is contained in:
Damiano Galassi committed 2013-11-03 17:10:49 +01:00
1 parent 077f0ff2f6
commit 05cf06cfa9
31 files changed
+528 -102

No files matched your search

+21 -1
View File
@@ -13,7 +13,7 @@
#include <zlib.h>
#include <bzlib.h>
#import "SBLanguages.h"
#import "MP42Languages.h"
#import "MP42MediaFormat.h"
#include "intreadwrite.h"
#include "avcodec.h"
@@ -150,6 +150,26 @@ MP4TrackId findChapterTrackId(MP4FileHandle fileHandle)
return (MP4TrackId) trackRef;
}
}
return 0;
}
MP4TrackId findChapterPreviewTrackId(MP4FileHandle fileHandle)
{
MP4TrackId trackId = 0;
uint64_t trackRef = 0;
unsigned int i;
for (i = 0; i< MP4GetNumberOfTracks( fileHandle, 0, 0); i++ ) {
trackId = MP4FindTrackId(fileHandle, i, 0, 0);
if (MP4HaveTrackAtom(fileHandle, trackId, "tref.chap")) {
uint64_t entryCount = 0;
MP4GetTrackIntegerProperty(fileHandle, trackId, "tref.chap.entryCount", &entryCount);
if (entryCount > 1 && MP4GetTrackIntegerProperty(fileHandle, trackId, "tref.chap.entries.trackId[1]", &trackRef))
if (trackRef > 0)
return (MP4TrackId) trackRef;
}
}
return 0;
}