Closed tifroz closed 10 years ago
If not accounted for, silent videos (0 audio tracks) would crash on this line:
self.audioOutput = [AVAssetReaderAudioMixOutput assetReaderAudioMixOutputWithAudioTracks:audioTracks audioSettings:nil];
This implements a simple fix by skipping the audioOutput code when no tracks are present in the video file
NSArray *audioTracks = [self.asset tracksWithMediaType:AVMediaTypeAudio]; if (audioTracks.count > 0) { //..do the audio stuffs }
If not accounted for, silent videos (0 audio tracks) would crash on this line:
This implements a simple fix by skipping the audioOutput code when no tracks are present in the video file