From 6e9e5b6907935d3482614b28bacae894874f56a4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 20 Mar 2016 19:14:58 +0100 Subject: [PATCH] Put up with deprecations --- cores/libretro-ffmpeg/ffmpeg_core.c | 19 +------------------ record/drivers/record_ffmpeg.c | 19 ++----------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/cores/libretro-ffmpeg/ffmpeg_core.c b/cores/libretro-ffmpeg/ffmpeg_core.c index 8475767390..799f54c016 100644 --- a/cores/libretro-ffmpeg/ffmpeg_core.c +++ b/cores/libretro-ffmpeg/ffmpeg_core.c @@ -1166,24 +1166,11 @@ static void decode_thread(void *data) if (video_stream >= 0) { - AVPicture *converted_frame = (AVPicture*)conv_frame; - -#if FF_API_AVPICTURE - frame_size = av_image_get_buffer_size(PIX_FMT_RGB32, media.width, media.height, 1); -#else frame_size = avpicture_get_size(PIX_FMT_RGB32, media.width, media.height); -#endif conv_frame = av_frame_alloc(); conv_frame_buf = av_malloc(frame_size); -#if FF_API_AVPICTURE - av_image_fill_arrays(converted_frame->data, - converted_frame->linesize, - (const uint8_t*)conv_frame_buf, - PIX_FMT_RGB32, media.width, media.height, 1); -#else - avpicture_fill(converted_frame, (const uint8_t*)conv_frame_buf, + avpicture_fill((AVPicture*)conv_frame, (const uint8_t*)conv_frame_buf, PIX_FMT_RGB32, media.width, media.height); -#endif } while (!decode_thread_dead) @@ -1324,11 +1311,7 @@ static void decode_thread(void *data) avsubtitle_free(&sub); } -#if FF_API_AVPICTURE - av_packet_unref(&pkt); -#else av_free_packet(&pkt); -#endif } if (sws) diff --git a/record/drivers/record_ffmpeg.c b/record/drivers/record_ffmpeg.c index 0016e805e7..3935471481 100644 --- a/record/drivers/record_ffmpeg.c +++ b/record/drivers/record_ffmpeg.c @@ -507,28 +507,13 @@ static bool ffmpeg_init_video(ffmpeg_t *handle) video->frame_drop_ratio = params->frame_drop_ratio; -#if FF_API_AVPICTURE - size = av_image_get_buffer_size(video->pix_fmt, param->out_width, - param->out_height, 1); -#else size = avpicture_get_size(video->pix_fmt, param->out_width, param->out_height); -#endif video->conv_frame_buf = (uint8_t*)av_malloc(size); video->conv_frame = av_frame_alloc(); - { - AVPicture *converted_frame = (AVPicture*)video->conv_frame; -#if FF_API_AVPICTURE - av_image_fill_arrays(converted_frame->data, - converted_frame->linesize, - video->conv_frame_buf, - video->pix_fmt, param->out_width, param->out_height, 1); -#else - avpicture_fill(converted_frame, video->conv_frame_buf, - video->pix_fmt, param->out_width, param->out_height); -#endif - } + avpicture_fill((AVPicture*)video->conv_frame, video->conv_frame_buf, + video->pix_fmt, param->out_width, param->out_height); video->conv_frame->width = param->out_width; video->conv_frame->height = param->out_height;