From 7b09cb2de43446e2263dc13637e6a2abcf74c307 Mon Sep 17 00:00:00 2001 From: Rany Date: Thu, 8 Dec 2022 19:45:07 +0800 Subject: [PATCH] Fix runtime error in FFmpeg core when build with FFmpeg n5.1.2 and OpenGL ES (#14710) * include libavcodec/version.h in video_buffer.h Without this header video_decoder_context_t may be defined as different structure in video_buffer.c and ffmpeg_core.c * Fix the wrong data pointer for glTexImage2D when OpenGL ES enabled --- cores/libretro-ffmpeg/ffmpeg_core.c | 2 +- cores/libretro-ffmpeg/video_buffer.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/libretro-ffmpeg/ffmpeg_core.c b/cores/libretro-ffmpeg/ffmpeg_core.c index 645e63f6be..495e7fb87a 100644 --- a/cores/libretro-ffmpeg/ffmpeg_core.c +++ b/cores/libretro-ffmpeg/ffmpeg_core.c @@ -856,7 +856,7 @@ void CORE_PREFIX(retro_run)(void) glBindTexture(GL_TEXTURE_2D, frames[1].tex); #if defined(HAVE_OPENGLES) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - media.width, media.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); + media.width, media.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, video_frame_temp_buffer); #else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, media.width, media.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); diff --git a/cores/libretro-ffmpeg/video_buffer.h b/cores/libretro-ffmpeg/video_buffer.h index 25f0af8fdc..2c76570649 100644 --- a/cores/libretro-ffmpeg/video_buffer.h +++ b/cores/libretro-ffmpeg/video_buffer.h @@ -20,6 +20,7 @@ extern "C" { #endif +#include #include #include