From 47f6f2aed6ac674fdb203d2951eb0c90780a48bf Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Thu, 13 Mar 2008 08:30:40 +0000 Subject: [PATCH] Replaced deprecated function avcodec_decode_audio() with nondeprecated version avcodec_decode_audio2() in audio_provider_lavc.cpp. Maybe possibly potentially hopefully fixes mp3 decoding problems? Originally committed to SVN as r2041. --- aegisub/audio_provider_lavc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/audio_provider_lavc.cpp b/aegisub/audio_provider_lavc.cpp index 896843976..9a36f5cd5 100644 --- a/aegisub/audio_provider_lavc.cpp +++ b/aegisub/audio_provider_lavc.cpp @@ -165,8 +165,8 @@ void LAVCAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) AVPacket packet; while (_count > 0 && av_read_frame(lavcfile->fctx, &packet) >= 0) { while (packet.stream_index == audStream) { - int bytesout = 0, samples; - if (avcodec_decode_audio(codecContext, buffer, &bytesout, packet.data, packet.size) < 0) + int bytesout = 0, samples; /* why is the output buffer size 0? */ + if (avcodec_decode_audio2(codecContext, buffer, &bytesout, packet.data, packet.size) < 0) throw _T("Failed to decode audio"); if (bytesout == 0) break;