Fix leaks and read the webvtt magic cookie from mp4.

This commit is contained in:
Damiano Galassi committed 2016-02-18 13:25:40 +01:00
1 parent 5ba205be44
commit a33fcd02a0
5 files changed
+31 -5

No files matched your search

+16
View File
@@ -112,6 +112,7 @@
uint32_t pValueSize;
MP4GetTrackBytesProperty(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.ec-3.dec3.content", &ppValue, &pValueSize);
magicCookie = [NSData dataWithBytes:ppValue length:pValueSize];
free(ppValue);
}
}
else if (!strcmp(media_data_name, "alac")) {
@@ -120,6 +121,7 @@
uint32_t pValueSize;
MP4GetTrackBytesProperty(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.alac.alac.AppleLosslessMagicCookie", &ppValue, &pValueSize);
magicCookie = [NSData dataWithBytes:ppValue length:pValueSize];
free(ppValue);
}
}
else {
@@ -233,6 +235,20 @@
}
}
else if ((!strcasecmp(trackType, MP4_TEXT_TRACK_TYPE))) {
if (!strcmp(media_data_name, "wvtt")) {
if (MP4HaveTrackAtom(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.wvtt.vttC")) {
uint8_t *ppValue;
uint32_t pValueSize;
MP4GetTrackBytesProperty(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.wvtt.vttC.config", &ppValue, &pValueSize);
magicCookie = [NSData dataWithBytes:ppValue length:pValueSize];
free(ppValue);
return magicCookie;
}
}
}
return nil;
}