Changeset 401

Show
Ignore:
Timestamp:
04/04/07 10:42:56 (2 years ago)
Author:
gbooker
Message:

Some of the code for the passthrough hack in the a52codec. If enabled, this does work on the ATV, but you must make sure the ATV's output sample rate matches that of the AC3 stream.

Files:

Legend:

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

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

    r400 r401  
    848848        switch ((*desc)->dataFormat) { 
    849849                case kAudioFormatAC3: 
    850                         replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0)); 
     850                        replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0), passthrough); 
    851851                        break; 
    852852        } 
  • trunk/bitstream_info.c

    r362 r401  
    6464 */ 
    6565 
    66 int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size
     66int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size, int passthrough
    6767{ 
    6868        int offset = ac3_synchronize(buffer, buff_size); 
     
    102102                shift = bsid - 8; 
    103103         
     104        if(passthrough) 
     105        { 
     106                if(acmod > 2) 
     107                        acmod = 0; 
     108                lfe = 0; 
     109        } 
    104110        /* Setup the AudioStreamBasicDescription and AudioChannelLayout */ 
    105111        memset(asbd, 0, sizeof(AudioStreamBasicDescription)); 
  • trunk/bitstream_info.h

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

    r374 r401  
    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); 
     108                initialize_audio_map(map, targetTrack, dataRef, dataRefType, storage->firstFrames + st->index, storage->passthrough); 
    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
     181void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame, int passthrough
    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)) 
     260                if(parse_ac3_bitstream(&asbd, &acl, firstFrame->data, firstFrame->size, passthrough)) 
    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); 
     527                        initialize_audio_map(&map[j], track, dataRef, dataRefType, storage->firstFrames + j, storage->passthrough); 
    528528                         
    529529                        if (first_audio_track == NULL) 
  • trunk/ff_private.h

    r295 r401  
    7878        int64_t header_offset; 
    7979         
     80        int passthrough; 
    8081        AVPacket firstFrames[MAX_STREAMS]; 
    8182}; 
     
    9697int prepare_movie(ff_global_ptr storage, Movie theMovie, Handle dataRef, OSType dataRefType); 
    9798void initialize_video_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame); 
    98 void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame); 
     99void initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef, OSType dataRefType, AVPacket *firstFrame, int passthrough); 
    99100 
    100101int determine_header_offset(ff_global_ptr storage);