From 3cade86767f7e17e3c6c0b1a6046d1df0a220e24 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Thu, 13 Mar 2008 08:41:21 +0000 Subject: [PATCH] check the return value of avcodec_decode_audio2() against <= 0, not just < 0 (both indicate no audio decoded) Originally committed to SVN as r2042. --- aegisub/audio_provider_lavc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/audio_provider_lavc.cpp b/aegisub/audio_provider_lavc.cpp index 9a36f5cd5..5e97aa071 100644 --- a/aegisub/audio_provider_lavc.cpp +++ b/aegisub/audio_provider_lavc.cpp @@ -166,7 +166,7 @@ void LAVCAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) while (_count > 0 && av_read_frame(lavcfile->fctx, &packet) >= 0) { while (packet.stream_index == audStream) { int bytesout = 0, samples; /* why is the output buffer size 0? */ - if (avcodec_decode_audio2(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"); if (bytesout == 0) break;