Changeset 402
- Timestamp:
- 04/05/07 18:43:49 (1 year ago)
- Files:
-
- trunk/MatroskaImport.h (modified) (1 diff)
- trunk/MatroskaImportPrivate.cpp (modified) (1 diff)
- trunk/bitstream_info.c (modified) (3 diffs)
- trunk/bitstream_info.h (modified) (1 diff)
- trunk/ff_private.c (modified) (4 diffs)
- trunk/ff_private.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaImport.h
r401 r402 108 108 uint8 isEnabled; 109 109 uint32_t defaultDuration; 110 uint8 passthrough;111 110 112 111 // laced tracks can have multiple frames per block, it's easier to ignore them trunk/MatroskaImportPrivate.cpp
r401 r402 848 848 switch ((*desc)->dataFormat) { 849 849 case kAudioFormatAC3: 850 replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0) , passthrough);850 replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0)); 851 851 break; 852 852 } trunk/bitstream_info.c
r401 r402 64 64 */ 65 65 66 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size , int passthrough)66 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size) 67 67 { 68 68 int offset = ac3_synchronize(buffer, buff_size); 69 int passthrough = 0; 69 70 if(offset == -1) 70 71 return 0; … … 72 73 if(buff_size < offset + 7) 73 74 return 0; 75 CFTypeRef pass = CFPreferencesCopyAppValue(CFSTR("attemptPassthrough"), CFSTR("com.cod3r.a52codec")); 76 if(pass != NULL) 77 { 78 CFTypeID type = CFGetTypeID(pass); 79 if(type == CFStringGetTypeID()) 80 passthrough = CFStringGetIntValue((CFStringRef)pass); 81 else if(type == CFNumberGetTypeID()) 82 CFNumberGetValue((CFNumberRef)pass, kCFNumberIntType, &passthrough); 83 CFRelease(pass); 84 } 74 85 75 86 uint8_t fscod_and_frmsizecod = buffer[offset + 4]; … … 102 113 shift = bsid - 8; 103 114 104 if(passthrough)105 {106 if(acmod > 2)107 acmod = 0;108 lfe = 0;109 }110 115 /* Setup the AudioStreamBasicDescription and AudioChannelLayout */ 111 116 memset(asbd, 0, sizeof(AudioStreamBasicDescription)); trunk/bitstream_info.h
r401 r402 15 15 #endif 16 16 17 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size , int passthrough);17 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size); 18 18 19 19 #ifdef __cplusplus trunk/ff_private.c
r401 r402 106 106 initialize_video_map(map, targetTrack, dataRef, dataRefType, storage->firstFrames + st->index); 107 107 else if(st->codec->codec_type == CODEC_TYPE_AUDIO) 108 initialize_audio_map(map, targetTrack, dataRef, dataRefType, storage->firstFrames + st->index , storage->passthrough);108 initialize_audio_map(map, targetTrack, dataRef, dataRefType, storage->firstFrames + st->index); 109 109 110 110 /* return the map */ … … 179 179 180 180 /* Initializes the map & targetTrack to receive audio data */ 181 void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame , int passthrough)181 void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame) 182 182 { 183 183 Media media; … … 258 258 if(asbd.mFormatID == kAudioFormatAC3 || asbd.mFormatID == 'ms \0') 259 259 { 260 if(parse_ac3_bitstream(&asbd, &acl, firstFrame->data, firstFrame->size , passthrough))260 if(parse_ac3_bitstream(&asbd, &acl, firstFrame->data, firstFrame->size)) 261 261 { 262 262 useDefault = 0; … … 525 525 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { 526 526 track = NewMovieTrack(theMovie, 0, 0, kFullVolume); 527 initialize_audio_map(&map[j], track, dataRef, dataRefType, storage->firstFrames + j , storage->passthrough);527 initialize_audio_map(&map[j], track, dataRef, dataRefType, storage->firstFrames + j); 528 528 529 529 if (first_audio_track == NULL) trunk/ff_private.h
r401 r402 78 78 int64_t header_offset; 79 79 80 int passthrough;81 80 AVPacket firstFrames[MAX_STREAMS]; 82 81 }; … … 97 96 int prepare_movie(ff_global_ptr storage, Movie theMovie, Handle dataRef, OSType dataRefType); 98 97 void initialize_video_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame); 99 void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame , int passthrough);98 void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame); 100 99 101 100 int determine_header_offset(ff_global_ptr storage);
