Changeset 402

Show
Ignore:
Timestamp:
04/05/07 18:43:49 (1 year ago)
Author:
gbooker
Message:

Reverted [401] and did it right.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/MatroskaImport.h

    r401 r402  
    108108        uint8                                   isEnabled; 
    109109        uint32_t                                defaultDuration; 
    110         uint8                                   passthrough; 
    111110         
    112111        // laced tracks can have multiple frames per block, it's easier to ignore them 
  • trunk/MatroskaImportPrivate.cpp

    r401 r402  
    848848        switch ((*desc)->dataFormat) { 
    849849                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)); 
    851851                        break; 
    852852        } 
  • trunk/bitstream_info.c

    r401 r402  
    6464 */ 
    6565 
    66 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size, int passthrough
     66int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size
    6767{ 
    6868        int offset = ac3_synchronize(buffer, buff_size); 
     69        int passthrough = 0; 
    6970        if(offset == -1) 
    7071                return 0; 
     
    7273        if(buff_size < offset + 7) 
    7374                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        } 
    7485         
    7586        uint8_t fscod_and_frmsizecod = buffer[offset + 4]; 
     
    102113                shift = bsid - 8; 
    103114         
    104         if(passthrough) 
    105         { 
    106                 if(acmod > 2) 
    107                         acmod = 0; 
    108                 lfe = 0; 
    109         } 
    110115        /* Setup the AudioStreamBasicDescription and AudioChannelLayout */ 
    111116        memset(asbd, 0, sizeof(AudioStreamBasicDescription)); 
  • trunk/bitstream_info.h

    r401 r402  
    1515#endif 
    1616 
    17 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size, int passthrough); 
     17int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size); 
    1818 
    1919#ifdef __cplusplus 
  • trunk/ff_private.c

    r401 r402  
    106106                initialize_video_map(map, targetTrack, dataRef, dataRefType, storage->firstFrames + st->index); 
    107107        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); 
    109109         
    110110        /* return the map */ 
     
    179179 
    180180/* 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
     181void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame
    182182{ 
    183183        Media media; 
     
    258258        if(asbd.mFormatID == kAudioFormatAC3 || asbd.mFormatID == 'ms \0') 
    259259        { 
    260                 if(parse_ac3_bitstream(&asbd, &acl, firstFrame->data, firstFrame->size, passthrough)) 
     260                if(parse_ac3_bitstream(&asbd, &acl, firstFrame->data, firstFrame->size)) 
    261261                { 
    262262                        useDefault = 0; 
     
    525525                } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { 
    526526                        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); 
    528528                         
    529529                        if (first_audio_track == NULL) 
  • trunk/ff_private.h

    r401 r402  
    7878        int64_t header_offset; 
    7979         
    80         int passthrough; 
    8180        AVPacket firstFrames[MAX_STREAMS]; 
    8281}; 
     
    9796int prepare_movie(ff_global_ptr storage, Movie theMovie, Handle dataRef, OSType dataRefType); 
    9897void 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); 
     98void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame); 
    10099 
    101100int determine_header_offset(ff_global_ptr storage);