1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 22:30:22 +00:00

make compile with recent libav

This commit is contained in:
Stefano Pigozzi 2012-11-03 11:37:04 +01:00
parent 11173115bb
commit f79b08bf57
4 changed files with 46 additions and 14 deletions

View File

@ -21,6 +21,7 @@
#include <stdlib.h>
#include <libavutil/cpu.h>
#include "libav_compat.h"
#include "config.h"
#include "cpudetect.h"

View File

@ -769,44 +769,44 @@ static void encode_lavc_printoptions(void *obj, const char *indent,
* Don't print anything but CONST's on level two.
* Only print items from the requested unit.
*/
if (!unit && opt->type == FF_OPT_TYPE_CONST)
if (!unit && opt->type == AV_OPT_TYPE_CONST)
continue;
else if (unit && opt->type != FF_OPT_TYPE_CONST)
else if (unit && opt->type != AV_OPT_TYPE_CONST)
continue;
else if (unit && opt->type == FF_OPT_TYPE_CONST
else if (unit && opt->type == AV_OPT_TYPE_CONST
&& strcmp(unit, opt->unit))
continue;
else if (unit && opt->type == FF_OPT_TYPE_CONST)
else if (unit && opt->type == AV_OPT_TYPE_CONST)
mp_msg(MSGT_ENCODE, MSGL_INFO, "%s", subindent);
else
mp_msg(MSGT_ENCODE, MSGL_INFO, "%s", indent);
switch (opt->type) {
case FF_OPT_TYPE_FLAGS:
case AV_OPT_TYPE_FLAGS:
snprintf(optbuf, sizeof(optbuf), "%s=<flags>", opt->name);
break;
case FF_OPT_TYPE_INT:
case AV_OPT_TYPE_INT:
snprintf(optbuf, sizeof(optbuf), "%s=<int>", opt->name);
break;
case FF_OPT_TYPE_INT64:
case AV_OPT_TYPE_INT64:
snprintf(optbuf, sizeof(optbuf), "%s=<int64>", opt->name);
break;
case FF_OPT_TYPE_DOUBLE:
case AV_OPT_TYPE_DOUBLE:
snprintf(optbuf, sizeof(optbuf), "%s=<double>", opt->name);
break;
case FF_OPT_TYPE_FLOAT:
case AV_OPT_TYPE_FLOAT:
snprintf(optbuf, sizeof(optbuf), "%s=<float>", opt->name);
break;
case FF_OPT_TYPE_STRING:
case AV_OPT_TYPE_STRING:
snprintf(optbuf, sizeof(optbuf), "%s=<string>", opt->name);
break;
case FF_OPT_TYPE_RATIONAL:
case AV_OPT_TYPE_RATIONAL:
snprintf(optbuf, sizeof(optbuf), "%s=<rational>", opt->name);
break;
case FF_OPT_TYPE_BINARY:
case AV_OPT_TYPE_BINARY:
snprintf(optbuf, sizeof(optbuf), "%s=<binary>", opt->name);
break;
case FF_OPT_TYPE_CONST:
case AV_OPT_TYPE_CONST:
snprintf(optbuf, sizeof(optbuf), " [+-]%s", opt->name);
break;
default:
@ -818,7 +818,7 @@ static void encode_lavc_printoptions(void *obj, const char *indent,
if (opt->help)
mp_msg(MSGT_ENCODE, MSGL_INFO, " %s", opt->help);
mp_msg(MSGT_ENCODE, MSGL_INFO, "\n");
if (opt->unit && opt->type != FF_OPT_TYPE_CONST)
if (opt->unit && opt->type != AV_OPT_TYPE_CONST)
encode_lavc_printoptions(obj, indent, subindent, opt->unit,
filter_and, filter_eq);
}

30
libav_compat.h Normal file
View File

@ -0,0 +1,30 @@
/*
* This file is part of mpv.
*
* mpv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPV_LIBAV_COMPAT_H
#define MPV_LIBAV_COMPAT_H
#ifdef AV_CPU_FLAG_MMXEXT
#define AV_CPU_FLAG_MMX2 AV_CPU_FLAG_MMXEXT
#endif
#if LIBAVUTIL_VERSION_MICRO < 100
#define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT
#endif
#endif /* MPV_LIBAV_COMPAT_H */

View File

@ -32,6 +32,7 @@
#include <libavutil/avstring.h>
#include <libavutil/mathematics.h>
#include <libavutil/opt.h>
#include "libav_compat.h"
#include "config.h"
#include "options.h"