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.
This commit is contained in:
Karl Blomster 2008-03-13 08:30:40 +00:00
parent e0d98de508
commit 47f6f2aed6
1 changed files with 2 additions and 2 deletions

View File

@ -165,8 +165,8 @@ void LAVCAudioProvider::GetAudio(void *buf, int64_t start, int64_t count)
AVPacket packet; AVPacket packet;
while (_count > 0 && av_read_frame(lavcfile->fctx, &packet) >= 0) { while (_count > 0 && av_read_frame(lavcfile->fctx, &packet) >= 0) {
while (packet.stream_index == audStream) { while (packet.stream_index == audStream) {
int bytesout = 0, samples; int bytesout = 0, samples; /* why is the output buffer size 0? */
if (avcodec_decode_audio(codecContext, buffer, &bytesout, packet.data, packet.size) < 0) if (avcodec_decode_audio2(codecContext, buffer, &bytesout, packet.data, packet.size) < 0)
throw _T("Failed to decode audio"); throw _T("Failed to decode audio");
if (bytesout == 0) if (bytesout == 0)
break; break;