Do not use a implicit codec delay for now.

This commit is contained in:
Damiano Galassi committed 2017-09-19 12:35:17 +02:00
1 parent 7539ac68bd
commit 2991bb2f9b
1 file changed
+4 -3
+4 -3
View File
@@ -608,10 +608,10 @@ static NSString * TrackNameToString(TrackInfo *track)
TrackInfo *trackInfo = mkv_GetTrackInfo(_matroskaFile, Id); TrackInfo *trackInfo = mkv_GetTrackInfo(_matroskaFile, Id);
int64_t codecDelay = trackInfo->CodecDelay; int64_t codecDelay = trackInfo->CodecDelay;
if (codecDelay == 0 && trackInfo->Type == TT_AUDIO && !strcmp(trackInfo->CodecID, "A_AAC")) { /*if (codecDelay == 0 && trackInfo->Type == TT_AUDIO && !strcmp(trackInfo->CodecID, "A_AAC")) {
NSUInteger sampleRate = mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq); NSUInteger sampleRate = mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq);
codecDelay = 2112 * SCALE_FACTOR * 1000 / sampleRate; codecDelay = 2112 * SCALE_FACTOR * 1000 / sampleRate;
} }*/
return (((double)StartTime) - codecDelay) / SCALE_FACTOR; return (((double)StartTime) - codecDelay) / SCALE_FACTOR;
} }
@@ -787,7 +787,8 @@ static NSString * TrackNameToString(TrackInfo *track)
- (BOOL)audioTrackUsesExplicitEncoderDelay:(MP42Track *)track; - (BOOL)audioTrackUsesExplicitEncoderDelay:(MP42Track *)track;
{ {
return YES; TrackInfo *trackInfo = mkv_GetTrackInfo(_matroskaFile, track.sourceId);
return trackInfo->CodecDelay != 0;
} }
// Methods to extract all the samples from the active tracks at the same time // Methods to extract all the samples from the active tracks at the same time