From c2c7dec76c05d8ed1bf8d06ecbb61f0cf26e9527 Mon Sep 17 00:00:00 2001 From: scop Date: Tue, 3 Apr 2007 14:13:47 +0000 Subject: Use avcodec_decode_audio2() if available. --- HISTORY | 1 + dxr3audiodecoder.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 1c71934..4977b11 100644 --- a/HISTORY +++ b/HISTORY @@ -321,4 +321,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - add Polish translation (Mikolaj Tutak) - sync "make install" with VDR 1.4.2-2 (Ville Skyttä) - use cCondWait::SleepMs() instead of usleep (Ville Skyttä) +- avoid deprecation warnings with newish libavcodec (Ville Skyttä) - various minor tweaks diff --git a/dxr3audiodecoder.c b/dxr3audiodecoder.c index 53faca0..2b0a0d9 100644 --- a/dxr3audiodecoder.c +++ b/dxr3audiodecoder.c @@ -93,7 +93,7 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, } int len; - int out_size; + int out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; enum audioException { @@ -141,9 +141,13 @@ void cDxr3AudioDecoder::Decode(const uint8_t* buf, int length, uint32_t pts, { while (length > 0 && decodeAudio) { - len = avcodec_decode_audio(&Codec.codec_context, - (short *)(&pcmbuf), &out_size, - const_cast(buf), length); +#if LIBAVCODEC_VERSION_INT < ((51<<16)+(29<<8)+0) + len = avcodec_decode_audio( +#else + len = avcodec_decode_audio2( +#endif + &Codec.codec_context, (short *)(&pcmbuf), &out_size, + const_cast(buf), length); if (len < 0 || out_size < 0) throw WRONG_LENGTH; -- cgit v1.2.3