mirror of
https://github.com/mpv-player/mpv
synced 2025-04-17 20:58:20 +00:00
Move SetCodecPath() from loader to get_path.c and make it unconditional.
This fixes compilation with the Win32 loader disabled but other binary codec loaders enabled. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30942 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
64c4d367af
commit
a06a3d476d
1
Makefile
1
Makefile
@ -315,7 +315,6 @@ SRCS_COMMON-$(WIN32DLL) += libmpcodecs/ad_acm.c \
|
||||
libmpcodecs/vd_vfwex.c \
|
||||
libmpdemux/demux_avs.c \
|
||||
loader/afl.c \
|
||||
loader/codecpath.c \
|
||||
loader/drv.c \
|
||||
loader/vfl.c \
|
||||
loader/dshow/DS_AudioDecoder.c \
|
||||
|
@ -40,9 +40,7 @@
|
||||
#ifdef CONFIG_PRIORITY
|
||||
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
#endif
|
||||
#ifdef CONFIG_WIN32DLL
|
||||
{"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
#endif
|
||||
{"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
|
||||
|
||||
// ------------------------- stream options --------------------
|
||||
|
18
get_path.c
18
get_path.c
@ -175,3 +175,21 @@ void set_path_env(void)
|
||||
mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!");
|
||||
}
|
||||
#endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */
|
||||
|
||||
char *def_path = BINARY_CODECS_PATH;
|
||||
|
||||
static int needs_free = 0;
|
||||
|
||||
void SetCodecPath(const char *path)
|
||||
{
|
||||
if (needs_free)
|
||||
free(def_path);
|
||||
if (path == 0) {
|
||||
def_path = BINARY_CODECS_PATH;
|
||||
needs_free = 0;
|
||||
return;
|
||||
}
|
||||
def_path = malloc(strlen(path) + 1);
|
||||
strcpy(def_path, path);
|
||||
needs_free = 1;
|
||||
}
|
||||
|
@ -21,7 +21,10 @@
|
||||
#ifndef MPLAYER_GET_PATH_H
|
||||
#define MPLAYER_GET_PATH_H
|
||||
|
||||
extern char *def_path;
|
||||
|
||||
char *get_path(const char *filename);
|
||||
void set_path_env(void);
|
||||
void SetCodecPath(const char *path);
|
||||
|
||||
#endif /* MPLAYER_GET_PATH_H */
|
||||
|
@ -29,11 +29,10 @@
|
||||
#include <string.h> /* strerror */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "get_path.h"
|
||||
#include "mp_msg.h"
|
||||
|
||||
#include "vd_internal.h"
|
||||
#include "loader/codecpath.h"
|
||||
|
||||
static const vd_info_t info = {
|
||||
"XAnim codecs",
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Modified for use with MPlayer, detailed changelog at
|
||||
* http://svn.mplayerhq.hu/mplayer/trunk/
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "codecpath.h"
|
||||
|
||||
char* def_path = BINARY_CODECS_PATH;
|
||||
|
||||
static int needs_free=0;
|
||||
void SetCodecPath(const char* path)
|
||||
{
|
||||
if(needs_free)free(def_path);
|
||||
if(path==0)
|
||||
{
|
||||
def_path = BINARY_CODECS_PATH;
|
||||
needs_free=0;
|
||||
return;
|
||||
}
|
||||
def_path = malloc(strlen(path)+1);
|
||||
strcpy(def_path, path);
|
||||
needs_free=1;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
* Modified for use with MPlayer, detailed changelog at
|
||||
* http://svn.mplayerhq.hu/mplayer/trunk/
|
||||
*/
|
||||
|
||||
#ifndef MPLAYER_CODECPATH_H
|
||||
#define MPLAYER_CODECPATH_H
|
||||
|
||||
extern char *def_path;
|
||||
void SetCodecPath(const char* path);
|
||||
|
||||
#endif /* MPLAYER_CODECPATH_H */
|
@ -25,7 +25,7 @@
|
||||
#ifndef __MINGW32__
|
||||
#include "ext.h"
|
||||
#endif
|
||||
#include "codecpath.h"
|
||||
#include "get_path.h"
|
||||
|
||||
#if 1
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "wine/debugtools.h"
|
||||
#include "wine/winerror.h"
|
||||
#include "debug.h"
|
||||
#include "codecpath.h"
|
||||
#include "get_path.h"
|
||||
|
||||
//DEFAULT_DEBUG_CHANNEL(elfdll)
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#endif
|
||||
#include "win32.h"
|
||||
#include "drv.h"
|
||||
#include "codecpath.h"
|
||||
#include "get_path.h"
|
||||
|
||||
#ifdef EMU_QTX_API
|
||||
#include "wrapper.h"
|
||||
|
@ -49,7 +49,7 @@ for DLL to know too much about its environment.
|
||||
#include "loader.h"
|
||||
#include "com.h"
|
||||
#include "ext.h"
|
||||
#include "codecpath.h"
|
||||
#include "get_path.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "mp_fifo.h"
|
||||
#include "get_path.h"
|
||||
|
||||
#include "loader/codecpath.h"
|
||||
#include "stream/stream.h"
|
||||
#include "libmpdemux/aviprint.h"
|
||||
#include "libmpdemux/demuxer.h"
|
||||
@ -667,10 +666,8 @@ if (frameno_filename) {
|
||||
set_priority();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WIN32DLL
|
||||
if (codec_path)
|
||||
SetCodecPath(codec_path);
|
||||
#endif
|
||||
|
||||
// check font
|
||||
#ifdef CONFIG_FREETYPE
|
||||
|
@ -94,7 +94,6 @@
|
||||
#include "gui/interface.h"
|
||||
|
||||
#include "input/input.h"
|
||||
#include "loader/codecpath.h"
|
||||
|
||||
int slave_mode=0;
|
||||
int player_idle_mode=0;
|
||||
@ -2702,10 +2701,8 @@ int gui_no_filename=0;
|
||||
set_priority();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WIN32DLL
|
||||
if (codec_path)
|
||||
SetCodecPath(codec_path);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_GUI
|
||||
if(use_gui){
|
||||
|
Loading…
Reference in New Issue
Block a user