diff options
author | scop <scop> | 2007-04-03 14:13:47 +0000 |
---|---|---|
committer | scop <scop> | 2007-04-03 14:13:47 +0000 |
commit | c2c7dec76c05d8ed1bf8d06ecbb61f0cf26e9527 (patch) | |
tree | d0d6418bc10ff1e2eab0536c8d621097ceea1ebb /dxr3audiodecoder.c | |
parent | f7224c226b1631eeae81cd5542a953c024e27d31 (diff) | |
download | vdr-plugin-dxr3-c2c7dec76c05d8ed1bf8d06ecbb61f0cf26e9527.tar.gz vdr-plugin-dxr3-c2c7dec76c05d8ed1bf8d06ecbb61f0cf26e9527.tar.bz2 |
Use avcodec_decode_audio2() if available.
Diffstat (limited to 'dxr3audiodecoder.c')
-rw-r--r-- | dxr3audiodecoder.c | 12 |
1 files changed, 8 insertions, 4 deletions
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<uint8_t *>(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<uint8_t *>(buf), length); if (len < 0 || out_size < 0) throw WRONG_LENGTH; |