frame_size fixed
if got_frame is not set, set frame_size to 0.
@@ -428,19 +428,24 @@ 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;
}
+ }
if (mdecoder->decoded_size == 0)
{
free(mdecoder->decoded_data);
