|
|
@@ -148,7 +148,11 @@ FfmpegAudioCursor(FfmpegAudio *src) :
|
|
|
_can_seek = true;
|
|
|
_can_seek_fast = true;
|
|
|
|
|
|
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
|
|
+ _frame = av_frame_alloc();
|
|
|
+#else
|
|
|
_frame = avcodec_alloc_frame();
|
|
|
+#endif
|
|
|
|
|
|
_packet = new AVPacket;
|
|
|
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
|
|
@@ -194,7 +198,9 @@ FfmpegAudioCursor::
|
|
|
void FfmpegAudioCursor::
|
|
|
cleanup() {
|
|
|
if (_frame) {
|
|
|
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
|
|
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101)
|
|
|
+ av_frame_free(&_frame);
|
|
|
+#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
|
|
avcodec_free_frame(&_frame);
|
|
|
#else
|
|
|
av_free(&_frame);
|
|
|
@@ -313,8 +319,7 @@ reload_buffer() {
|
|
|
#ifdef HAVE_SWRESAMPLE
|
|
|
if (_resample_ctx) {
|
|
|
// Resample the data to signed 16-bit sample format.
|
|
|
- uint8_t* out[SWR_CH_MAX] = {(uint8_t*) _buffer, NULL};
|
|
|
- bufsize = swr_convert(_resample_ctx, out, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
|
|
|
+ bufsize = swr_convert(_resample_ctx, (uint8_t **)&_buffer, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
|
|
|
bufsize *= _audio_channels * 2;
|
|
|
} else
|
|
|
#endif
|