Ticket #8134: afd_based_solution_to_8134.diff

File afd_based_solution_to_8134.diff, 1.6 KB (added by skamithi, 14 years ago)

ffmpeg alias suggested not changing the audio codec on the fly. this approach uses AvformatDecoder? calls to avoid generating an audio codec for the stream when channels == 0, and if an audio stream with no codec is found, call scanstreams to generate the correct stream. made it dvd specific and pcm_dvd/pcm_s16be specific so it doesn't affect detection of other audio codecs.

  • mythtv/libs/libavcodec/pcm.c

    diff --git a/mythtv/libs/libavcodec/pcm.c b/mythtv/libs/libavcodec/pcm.c
    index b16f663..572ee94 100644
    a b static int pcm_decode_frame(AVCodecContext *avctx, 
    373373
    374374    n = buf_size/sample_size;
    375375
    376     switch(avctx->codec_id) {
     376    switch(avctx->codec->id) {
    377377    case CODEC_ID_PCM_U32LE:
    378378        DECODE(uint32_t, le32, src, samples, n, 0, 0x80000000)
    379379        break;
  • mythtv/libs/libmythtv/avformatdecoder.cpp

    diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
    index c332004..419e60e 100644
    a b int AvFormatDecoder::ScanStreams(bool novideo) 
    20302030                        .arg(codec_id_string(enc->codec_id))
    20312031                        .arg(enc->channels));
    20322032
     2033                if (ringBuffer && ringBuffer->isDVD() && enc->channels == 0)
     2034                    continue;
    20332035#if 0
    20342036                // HACK MULTICHANNEL DTS passthru disabled for multichannel,
    20352037                // dont know how to handle this
    bool AvFormatDecoder::GetFrame(DecodeType decodetype) 
    39113913                    .arg(codec_id_string(curstream->codec->codec_id))
    39123914                    .arg(curstream->codec->codec_id));
    39133915            av_free_packet(pkt);
     3916
     3917            // workaround for #8134.
     3918            if (ringBuffer && ringBuffer->isDVD() &&
     3919                curstream->codec->codec_id == CODEC_ID_PCM_S16BE)
     3920            {
     3921                ScanStreams(false);
     3922            }
    39143923            continue;
    39153924        }
    39163925