hurf de durf, didn't consider the fact that some audio packets might not have any actual content. return value of avcodec_decode_audio2() is now checked against < 0 again.

Originally committed to SVN as r2051.
This commit is contained in:
Karl Blomster 2008-03-14 04:38:30 +00:00
parent 828ada86b0
commit 56370f0f4a
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;
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)
int bytesout = 0, samples;
if (avcodec_decode_audio2(codecContext, buffer, &bytesout, packet.data, packet.size) < 0)
throw _T("Failed to decode audio");
if (bytesout == 0)
break;