Do not try to read the esds if there isn't one.

This commit is contained in:
Damiano Galassi committed 2017-08-30 10:58:55 +02:00
1 parent 271b4de7a3
commit e3a9f6b4e2
1 file changed
+3
+3
View File
@@ -34,7 +34,9 @@
if (self) { if (self) {
MP4GetTrackFloatProperty(fileHandle, self.trackId, "tkhd.volume", &_volume); MP4GetTrackFloatProperty(fileHandle, self.trackId, "tkhd.volume", &_volume);
const char *dataName = MP4GetTrackMediaDataName(fileHandle, self.trackId);
if (dataName && !strcmp(dataName, "mp4a")) {
u_int8_t audioType = MP4GetTrackEsdsObjectTypeId(fileHandle, self.trackId); u_int8_t audioType = MP4GetTrackEsdsObjectTypeId(fileHandle, self.trackId);
if (audioType != MP4_INVALID_AUDIO_TYPE) { if (audioType != MP4_INVALID_AUDIO_TYPE) {
@@ -74,6 +76,7 @@
MP4GetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.mp4a.channels", &channels_count); MP4GetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.mp4a.channels", &channels_count);
_channels = channels_count; _channels = channels_count;
} }
}
else if (MP4HaveTrackAtom(fileHandle, self.trackId, "mdia.minf.stbl.stsd.ac-3.dac3")) { else if (MP4HaveTrackAtom(fileHandle, self.trackId, "mdia.minf.stbl.stsd.ac-3.dac3")) {
uint64_t acmod, lfeon; uint64_t acmod, lfeon;