forked from mia/Aegisub
check the return value of avcodec_decode_audio2() against <= 0, not just < 0 (both indicate no audio decoded)
Originally committed to SVN as r2042.
This commit is contained in:
parent
47f6f2aed6
commit
3cade86767
1 changed files with 1 additions and 1 deletions
|
@ -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 (_count > 0 && av_read_frame(lavcfile->fctx, &packet) >= 0) {
|
||||||
while (packet.stream_index == audStream) {
|
while (packet.stream_index == audStream) {
|
||||||
int bytesout = 0, samples; /* why is the output buffer 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)
|
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;
|
||||||
|
|
Loading…
Reference in a new issue