diff --git a/MP42/MP42AVFImporter.m b/MP42/MP42AVFImporter.m index a6b2c50..58c97df 100644 --- a/MP42/MP42AVFImporter.m +++ b/MP42/MP42AVFImporter.m @@ -618,12 +618,12 @@ if (err && AudioChannelLayoutTag_GetNumberOfChannels(channelLayout->mChannelLayoutTag) == 6) channelBitmap = 0x3F; - uint8_t fscod = 0; - uint8_t bsid = 8; - uint8_t bsmod = 0; - uint8_t acmod = 7; - uint8_t lfeon = (channelBitmap & kAudioChannelBit_LFEScreen) ? 1 : 0; - uint8_t bit_rate_code = 15; + uint64_t fscod = 0; + uint64_t bsid = 8; + uint64_t bsmod = 0; + uint64_t acmod = 7; + uint64_t lfeon = (channelBitmap & kAudioChannelBit_LFEScreen) ? 1 : 0; + uint64_t bit_rate_code = 15; switch (AudioChannelLayoutTag_GetNumberOfChannels(channelLayout->mChannelLayoutTag) - lfeon) { case 1: diff --git a/MP42/MP42ChapterTrack.m b/MP42/MP42ChapterTrack.m index 7f4da0f..bf9f453 100644 --- a/MP42/MP42ChapterTrack.m +++ b/MP42/MP42ChapterTrack.m @@ -235,7 +235,7 @@ } removeAllChapterTrackReferences(fileHandle); - MP4SetChapters(fileHandle, fileChapters, i, MP4ChapterTypeAny); + MP4SetChapters(fileHandle, fileChapters, i, MP4ChapterTypeQt); free(fileChapters); success = _Id = findChapterTrackId(fileHandle); diff --git a/MP42/MP42MkvImporter.m b/MP42/MP42MkvImporter.m index 779d8ce..6437cf5 100644 --- a/MP42/MP42MkvImporter.m +++ b/MP42/MP42MkvImporter.m @@ -491,7 +491,7 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t return NSMakeSize([(MP42VideoTrack*)track width], [(MP42VideoTrack*) track height]); } -- (NSData*)magicCookieForTrack:(MP42Track *)track +- (NSData *)magicCookieForTrack:(MP42Track *)track { if (!_matroskaFile) return nil; @@ -522,7 +522,7 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t if (readMkvPacket(_ioStream, trackInfo, FilePos, &frame, &FrameSize)) { // parse AC3 header // collect all the necessary meta information - uint32_t fscod, frmsizecod, bsid, bsmod, acmod, lfeon; + uint64_t fscod, frmsizecod, bsid, bsmod, acmod, lfeon; uint32_t lfe_offset = 4; fscod = (*(frame+4) >> 6) & 0x3; diff --git a/MP42/MP42Muxer.m b/MP42/MP42Muxer.m index 20d0248..6ed4d26 100644 --- a/MP42/MP42Muxer.m +++ b/MP42/MP42Muxer.m @@ -115,7 +115,7 @@ NSSize size = [helper->importer sizeForTrack:track]; - uint8_t *avcCAtom = (uint8_t*)[magicCookie bytes]; + uint8_t *avcCAtom = (uint8_t *)[magicCookie bytes]; dstTrackId = MP4AddH264VideoTrack(_fileHandle, timeScale, MP4_INVALID_DURATION, size.width, size.height, @@ -140,7 +140,7 @@ uint16_t ppsSize = (avcCAtom[ptrPos++] << 8) & 0xff00; ppsSize += avcCAtom[ptrPos++] & 0xff; MP4AddH264PictureParameterSet(_fileHandle, dstTrackId, - avcCAtom+ptrPos, ppsSize); + avcCAtom + ptrPos, ppsSize); ptrPos += ppsSize; } diff --git a/MP42/MP42SubUtilities.m b/MP42/MP42SubUtilities.m index abe0559..409c749 100644 --- a/MP42/MP42SubUtilities.m +++ b/MP42/MP42SubUtilities.m @@ -241,7 +241,7 @@ canOutput: unsigned ParseSubTime(const char *time, unsigned secondScale, BOOL hasSign) { unsigned hour, minute, second, subsecond, timeval; - char separator; + char separator[3]; int sign = 1; if (hasSign && *time == '-') { @@ -249,13 +249,16 @@ unsigned ParseSubTime(const char *time, unsigned secondScale, BOOL hasSign) time++; } - if (sscanf(time,"%u:%u:%u%[,.:]%u",&hour,&minute,&second,&separator,&subsecond) < 5) + if (sscanf(time, "%u:%u:%u%[,.:]%u", &hour, &minute, &second, separator, &subsecond) < 5) { return 0; + } - if (second > 60) + if (second > 60) { second = 0; - if (subsecond > secondScale) + } + if (subsecond > secondScale) { subsecond = 0; + } timeval = hour * 60 * 60 + minute * 60 + second; timeval = secondScale * timeval + subsecond; diff --git a/MP42/MP42VobSubImporter.m b/MP42/MP42VobSubImporter.m index 15d50d7..3870332 100644 --- a/MP42/MP42VobSubImporter.m +++ b/MP42/MP42VobSubImporter.m @@ -176,7 +176,7 @@ static NSArray* LoadVobSubSubtitles(NSURL *theDirectory, NSString *filename) case VOB_SUB_STATE_READING_TRACK_HEADER: if([line hasPrefix:@"id: "]) { - char *langStr = (char *)malloc([line length]); + char *langStr = (char *)malloc(line.length * sizeof(char)); int index; sscanf([line UTF8String], "id: %s index: %d", langStr, &index); size_t langLength = strlen(langStr); @@ -195,9 +195,9 @@ static NSArray* LoadVobSubSubtitles(NSURL *theDirectory, NSString *filename) break; case VOB_SUB_STATE_READING_TRACK_DATA: { - char *timeStr = (char *)malloc([line length]); + char *timeStr = (char *)malloc(line.length * sizeof(char)); unsigned int position; - sscanf([line UTF8String], "timestamp: %s filepos: %x", timeStr, &position); + sscanf(line.UTF8String, "timestamp: %s filepos: %x", timeStr, &position); long time = ParseSubTime(timeStr, 1000, YES); free(timeStr); if(position > subFileSize)