Merge pull request #3842 from uplusplus/patch-5

frame_size fixed
This commit is contained in:
akallabeth 2017-03-09 08:20:48 +01:00 committed by GitHub
commit e23039fd99

View File

@ -428,18 +428,23 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE *data, UI
decoded_frame->nb_samples, mdecoder->codec_context->sample_fmt, 1);
memcpy(dst, decoded_frame->data[0], frame_size);
}
else
{
frame_size = 0;
}
av_free(decoded_frame);
}
#endif
if (len <= 0 || frame_size <= 0)
if (len > 0)
{
WLog_ERR(TAG, "error decoding");
break;
src += len;
src_size -= len;
}
if(frame_size > 0)
{
mdecoder->decoded_size += frame_size;
dst += frame_size;
}
src += len;
src_size -= len;
mdecoder->decoded_size += frame_size;
dst += frame_size;
}
if (mdecoder->decoded_size == 0)
{