mirror of https://github.com/mpv-player/mpv
codec-cfg: set CODEC_CFG_MIN to the release value in codecs.conf
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf. Allowing them to differ causes more issues than it is worth. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31472 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
27408d4f14
commit
2465ec9027
|
@ -57,7 +57,9 @@
|
||||||
#include "libmpcodecs/img_format.h"
|
#include "libmpcodecs/img_format.h"
|
||||||
#include "codec-cfg.h"
|
#include "codec-cfg.h"
|
||||||
|
|
||||||
#ifndef CODECS2HTML
|
#ifdef CODECS2HTML
|
||||||
|
#define CODEC_CFG_MIN 20100000
|
||||||
|
#else
|
||||||
#include "codecs.conf.h"
|
#include "codecs.conf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,6 +79,7 @@
|
||||||
#define TYPE_VIDEO 0
|
#define TYPE_VIDEO 0
|
||||||
#define TYPE_AUDIO 1
|
#define TYPE_AUDIO 1
|
||||||
|
|
||||||
|
static int codecs_conf_release;
|
||||||
char * codecs_file = NULL;
|
char * codecs_file = NULL;
|
||||||
|
|
||||||
static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
|
static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
|
||||||
|
@ -580,6 +583,7 @@ int parse_codec_cfg(const char *cfgfile)
|
||||||
tmp = atoi(token[0]);
|
tmp = atoi(token[0]);
|
||||||
if (tmp < CODEC_CFG_MIN)
|
if (tmp < CODEC_CFG_MIN)
|
||||||
goto err_out_release_num;
|
goto err_out_release_num;
|
||||||
|
codecs_conf_release = tmp;
|
||||||
while ((tmp = get_token(1, 1)) == RET_EOL)
|
while ((tmp = get_token(1, 1)) == RET_EOL)
|
||||||
/* NOTHING */;
|
/* NOTHING */;
|
||||||
if (tmp == RET_EOF)
|
if (tmp == RET_EOF)
|
||||||
|
@ -1034,6 +1038,8 @@ int main(int argc, char* argv[])
|
||||||
*/
|
*/
|
||||||
if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf")))
|
if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf")))
|
||||||
exit(1);
|
exit(1);
|
||||||
|
if (codecs_conf_release < CODEC_CFG_MIN)
|
||||||
|
exit(1);
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -1052,6 +1058,7 @@ int main(int argc, char* argv[])
|
||||||
printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]);
|
printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]);
|
||||||
printf("#include <stddef.h>\n");
|
printf("#include <stddef.h>\n");
|
||||||
printf("#include \"codec-cfg.h\"\n\n");
|
printf("#include \"codec-cfg.h\"\n\n");
|
||||||
|
printf("#define CODEC_CFG_MIN %i\n\n", codecs_conf_release);
|
||||||
|
|
||||||
for (i=0; i<2; i++) {
|
for (i=0; i<2; i++) {
|
||||||
printf("const codecs_t %s[] = {\n", nm[i]);
|
printf("const codecs_t %s[] = {\n", nm[i]);
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
#ifndef MPLAYER_CODEC_CFG_H
|
#ifndef MPLAYER_CODEC_CFG_H
|
||||||
#define MPLAYER_CODEC_CFG_H
|
#define MPLAYER_CODEC_CFG_H
|
||||||
|
|
||||||
#define CODEC_CFG_MIN 20070407
|
|
||||||
|
|
||||||
#define CODECS_MAX_FOURCC 92
|
#define CODECS_MAX_FOURCC 92
|
||||||
#define CODECS_MAX_OUTFMT 16
|
#define CODECS_MAX_OUTFMT 16
|
||||||
#define CODECS_MAX_INFMT 16
|
#define CODECS_MAX_INFMT 16
|
||||||
|
|
Loading…
Reference in New Issue