ffmpeg core prints out the ffmpeg library version

For better debugging and supporting of the users, we will print
out the library versions that the ffmpeg core is currently using.
This commit is contained in:
Nils Hasenbanck 2019-12-02 18:50:44 +01:00
parent 07f3abfda1
commit 1dbc7cdc9a

View File

@ -23,7 +23,6 @@ extern "C" {
#include <libavutil/imgutils.h>
#include <libavutil/time.h>
#include <libavutil/opt.h>
#include <libavdevice/avdevice.h>
#ifdef HAVE_SWRESAMPLE
#include <libswresample/swresample.h>
#endif
@ -60,6 +59,11 @@ extern "C" {
#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
#endif
#define PRINT_VERSION(s) log_cb(RETRO_LOG_INFO, "[FFMPEG] lib%s version:\t%d.%d.%d\n", #s, \
s ##_version() >> 16 & 0xFF, \
s ##_version() >> 8 & 0xFF, \
s ##_version() & 0xFF);
static bool reset_triggered;
static void fallback_log(enum retro_log_level level, const char *fmt, ...)
{
@ -329,6 +333,15 @@ void CORE_PREFIX(retro_reset)(void)
reset_triggered = true;
}
static void print_ffmpeg_version()
{
PRINT_VERSION(avformat)
PRINT_VERSION(avcodec)
PRINT_VERSION(avutil)
PRINT_VERSION(swresample)
PRINT_VERSION(swscale)
}
static void check_variables(bool firststart)
{
struct retro_variable hw_var = {0};
@ -1804,6 +1817,8 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
goto error;
}
print_ffmpeg_version();
if ((ret = avformat_find_stream_info(fctx, NULL)) < 0)
{
log_cb(RETRO_LOG_ERROR, "[FFMPEG] Failed to find stream info: %s\n", av_err2str(ret));