summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--dxr3audiodecoder.c12
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<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;