diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 6392f2d9e..7a2c966d4 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -197,11 +197,23 @@ int SWScale::Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint } /* Fill in the buffers */ - if(!avpicture_fill( (AVPicture*)input_avframe, (uint8_t*)in_buffer, in_pf, width, height ) ) { +#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) + if (av_image_fill_arrays(input_avframe->data, input_avframe->linesize, + (uint8_t*) in_buffer, in_pf, width, height, 1) <= 0) { +#else + if (avpicture_fill((AVPicture*) input_avframe, (uint8_t*) in_buffer, + in_pf, width, height) <= 0) { +#endif Error("Failed filling input frame with input buffer"); return -7; } - if(!avpicture_fill( (AVPicture*)output_avframe, out_buffer, out_pf, width, height ) ) { +#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) + if (av_image_fill_arrays(output_avframe->data, output_avframe->linesize, + out_buffer, out_pf, width, height, 1) <= 0) { +#else + if (avpicture_fill((AVPicture*) output_avframe, out_buffer, out_pf, width, + height) <= 0) { +#endif Error("Failed filling output frame with output buffer"); return -8; } @@ -330,8 +342,7 @@ int hacked_up_context2_for_older_ffmpeg(AVFormatContext **avctx, AVOutputFormat } } -static void zm_log_fps(double d, const char *postfix) -{ +static void zm_log_fps(double d, const char *postfix) { uint64_t v = lrintf(d * 100); if (!v) { Debug(3, "%1.4f %s", d, postfix);