Ticket #798: auto-ac3-disable.diff
File auto-ac3-disable.diff, 4.2 KB (added by , 20 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
2784 2784 #ifdef USING_DIRECTX 2785 2785 audioOutput->Reset(); 2786 2786 #endif 2787 if (decoder) 2788 { 2789 bool disable = audio_stretchfactor < 0.99 || 2790 audio_stretchfactor > 1.01; 2791 decoder->DisableAC3PassThrough(disable); 2792 VERBOSE(VB_IMPORTANT, QString("stretchfactor %1 disable %2") 2793 .arg(audio_stretchfactor) 2794 .arg(disable)); 2795 } 2787 2796 } 2788 2797 2789 2798 //cout << "setting unpaused" << endl << endl; -
libs/libmythtv/avformatdecoder.cpp
177 177 ccd(new CCDecoder(this)), 178 178 // Audio 179 179 audioSamples(new short int[AVCODEC_MAX_AUDIO_FRAME_SIZE]), 180 allow_ac3_passthru(false),180 disable_ac3_passthru(false), allow_ac3_passthru(false), 181 181 // Audio selection 182 182 wantedAudioStream(), selectedAudioStream(), 183 183 // Subtitle selection … … 449 449 #endif 450 450 } 451 451 452 void AvFormatDecoder::DisableAC3PassThrough(bool disable) 453 { 454 AVStream *curstream = NULL; 455 AVCodecContext *codec_ctx = NULL; 456 curstream = ic->streams[selectedAudioStream.av_stream_index]; 457 if (!curstream) 458 return; 459 codec_ctx = curstream->codec; 460 if (!codec_ctx) 461 return; 462 463 bool do_ac3_passthru = (allow_ac3_passthru && !transcoding && 464 !disable_ac3_passthru && 465 (codec_ctx->codec_id == CODEC_ID_AC3)); 466 467 disable_ac3_passthru = disable; 468 469 if (disable_ac3_passthru == do_ac3_passthru) 470 { 471 // Force ac3_passthru state to be reanalyzed 472 VERBOSE(VB_AUDIO, QString("DisableAC3PassThrough: %1") 473 .arg(disable_ac3_passthru)); 474 475 setCurrentAudioTrack(currentAudioTrack); 476 } 477 } 478 452 479 bool AvFormatDecoder::CanHandle(char testbuf[2048], const QString &filename) 453 480 { 454 481 av_register_all(); … … 2467 2494 assert(curstream->codec); 2468 2495 codec_ctx = curstream->codec; 2469 2496 bool do_ac3_passthru = (allow_ac3_passthru && !transcoding && 2497 !disable_ac3_passthru && 2470 2498 (codec_ctx->codec_id == CODEC_ID_AC3)); 2471 2499 info = AudioInfo(codec_ctx->codec_id, 2472 2500 codec_ctx->sample_rate, codec_ctx->channels, -
libs/libmythtv/avformatdecoder.h
83 83 void CloseContext(); 84 84 void Reset(void); 85 85 void Reset(bool reset_video_data = true, bool seek_reset = true); 86 void DisableAC3PassThrough(bool disable); 86 87 87 88 /// Perform an av_probe_input_format on the passed data to see if we 88 89 /// can decode it with this class. … … 232 233 233 234 // Audio 234 235 short int *audioSamples; 236 bool disable_ac3_passthru; 235 237 bool allow_ac3_passthru; 236 238 237 239 AudioInfo audioIn; -
libs/libmythtv/decoderbase.cpp
62 62 ateof = false; 63 63 } 64 64 65 void DecoderBase::DisableAC3PassThrough(bool disable) 66 { 67 (void)disable; 68 } 69 65 70 void DecoderBase::SeekReset(long long newKey, int skipFrames, bool needFlush) 66 71 { 67 72 (void)newKey, (void)skipFrames, (void)needFlush; -
libs/libmythtv/decoderbase.h
18 18 virtual ~DecoderBase(); 19 19 20 20 virtual void Reset(void); 21 virtual void DisableAC3PassThrough(bool disable); 21 22 22 23 virtual int OpenFile(RingBuffer *rbuffer, bool novideo, 23 24 char testbuf[2048]) = 0;