diff options
| -rw-r--r-- | lib/qmmp/Input/ffmpeg/decoder_ffmpeg.cpp | 4 | ||||
| -rw-r--r-- | lib/qmmp/Input/ffmpeg/decoder_ffmpeg.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.cpp b/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.cpp index 49d3a4d66..a23a470a9 100644 --- a/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.cpp @@ -262,9 +262,11 @@ void DecoderFFmpeg::run() inbuf_ptr = pkt.data; out_size = 0; + while (size > 0) { - l = avcodec_decode_audio(c, (int16_t *)(wma_outbuf), &out_size, inbuf_ptr, size); + out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t); + l = avcodec_decode_audio2(c, (int16_t *)(wma_outbuf), &out_size, inbuf_ptr, size); if(l < 0) goto end; diff --git a/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.h b/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.h index 412d43f0f..956e5f32b 100644 --- a/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.h +++ b/lib/qmmp/Input/ffmpeg/decoder_ffmpeg.h @@ -63,7 +63,7 @@ private: AVFormatContext *ic; AVCodecContext *c; - int wma_st_buff, wma_idx, wma_idx2; + uint wma_st_buff, wma_idx, wma_idx2; uint8_t *wma_outbuf; unsigned int bks; @@ -75,4 +75,4 @@ private: }; -#endif // __decoder_mpc_h +#endif // __decoder_ffmpeg_h |
