diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | command.c | 1 | ||||
-rw-r--r-- | get_path.c | 9 | ||||
-rw-r--r-- | get_path.h | 27 | ||||
-rw-r--r-- | gui/cfg.c | 1 | ||||
-rw-r--r-- | gui/interface.c | 1 | ||||
-rw-r--r-- | gui/interface.h | 2 | ||||
-rw-r--r-- | input/input.c | 3 | ||||
-rw-r--r-- | libaf/af_export.c | 4 | ||||
-rw-r--r-- | libass/ass_mp.c | 3 | ||||
-rw-r--r-- | libmpcodecs/dec_audio.c | 2 | ||||
-rw-r--r-- | libmpcodecs/dec_video.c | 2 | ||||
-rw-r--r-- | libvo/font_load.c | 2 | ||||
-rw-r--r-- | libvo/font_load_ft.c | 3 | ||||
-rw-r--r-- | libvo/vo_dxr2.c | 3 | ||||
-rw-r--r-- | mencoder.c | 2 | ||||
-rw-r--r-- | mp_core.h | 1 | ||||
-rw-r--r-- | mplayer.c | 2 | ||||
-rw-r--r-- | stream/stream_dvb.c | 3 |
19 files changed, 45 insertions, 27 deletions
@@ -20,6 +20,7 @@ SRCS_COMMON = asxparser.c \ cpudetect.c \ edl.c \ find_sub.c \ + get_path.c \ m_config.c \ m_option.c \ m_struct.c \ @@ -28,6 +28,7 @@ #include "libmpcodecs/dec_video.h" #include "vobsub.h" #include "spudec.h" +#include "get_path.h" #ifdef USE_TV #include "stream/tv.h" #endif diff --git a/get_path.c b/get_path.c index f40580f1f9..952979bbe7 100644 --- a/get_path.c +++ b/get_path.c @@ -8,14 +8,17 @@ * by the caller. * */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "mp_msg.h" + #ifdef MACOSX_BUNDLE #include <CoreFoundation/CoreFoundation.h> #include <sys/types.h> #include <sys/stat.h> -#include <stdio.h> -#include <stdlib.h> #include <unistd.h> -#include <string.h> #endif char *get_path(const char *filename){ diff --git a/get_path.h b/get_path.h new file mode 100644 index 0000000000..0a62d938a6 --- /dev/null +++ b/get_path.h @@ -0,0 +1,27 @@ +/* + * Get path to config dir/file. + * + * This file is part of MPlayer. + * + * MPlayer 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 GET_PATH_H +#define GET_PATH_H + +char *get_path(const char *filename); +void set_path_env(); + +#endif /* GET_PATH_H */ @@ -10,6 +10,7 @@ #include "mplayer.h" #include "m_config.h" #include "m_option.h" +#include "get_path.h" #include "libvo/sub.h" #include "libvo/video_out.h" #include "stream/stream.h" diff --git a/gui/interface.c b/gui/interface.c index aa257e777a..63d86cde4e 100644 --- a/gui/interface.c +++ b/gui/interface.c @@ -19,6 +19,7 @@ #include "app.h" #include "cfg.h" #include "help_mp.h" +#include "get_path.h" #include "libvo/x11_common.h" #include "libvo/video_out.h" #include "libvo/font_load.h" diff --git a/gui/interface.h b/gui/interface.h index 26a885a9d8..ed2f788092 100644 --- a/gui/interface.h +++ b/gui/interface.h @@ -145,8 +145,6 @@ extern guiInterface_t guiIntfStruct; extern int use_gui; -extern char *get_path(const char *filename); - extern void guiInit( void ); extern void guiDone( void ); extern int guiGetEvent( int type,char * arg ); diff --git a/input/input.c b/input/input.c index 21ef7b99a8..07ce0de8df 100644 --- a/input/input.c +++ b/input/input.c @@ -25,6 +25,7 @@ #include "help_mp.h" #include "m_config.h" #include "m_option.h" +#include "get_path.h" #include "joystick.h" @@ -1647,8 +1648,6 @@ mp_input_get_section(void) { return section; } -extern char *get_path(const char *filename); - void mp_input_init(int use_gui) { char* file; diff --git a/libaf/af_export.c b/libaf/af_export.c index 08f0f5dbe2..ff8871fdee 100644 --- a/libaf/af_export.c +++ b/libaf/af_export.c @@ -21,9 +21,7 @@ #include <fcntl.h> #include "af.h" - -extern char * get_path( const char * filename ); - +#include "get_path.h" #define DEF_SZ 512 // default buffer size (in samples) #define SHARED_FILE "mplayer-af_export" /* default file name diff --git a/libass/ass_mp.c b/libass/ass_mp.c index 174e4ae3b9..0913cd7e53 100644 --- a/libass/ass_mp.c +++ b/libass/ass_mp.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include "mp_msg.h" +#include "get_path.h" #include "ass.h" #include "ass_utils.h" @@ -216,8 +217,6 @@ ass_track_t* ass_read_subdata(ass_library_t* library, sub_data* subdata, double return track; } -char *get_path(char *); - void ass_configure(ass_renderer_t* priv, int w, int h, int unscaled) { int hinting; ass_set_frame_size(priv, w, h); diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index 4fc7fac8f4..6976009246 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -202,8 +202,6 @@ int init_audio(sh_audio_t *sh_audio,char* codecname,char* afm,int status){ return 0; } -extern char *get_path(const char *filename); - int init_best_audio_codec(sh_audio_t *sh_audio,char** audio_codec_list,char** audio_fm_list){ char* ac_l_default[2]={"",(char*)NULL}; // hack: diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index a49e3f160e..bf132c6aa6 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -277,8 +277,6 @@ int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status){ return 0; } -extern char *get_path(const char *filename); - int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list){ char* vc_l_default[2]={"",(char*)NULL}; // hack: diff --git a/libvo/font_load.c b/libvo/font_load.c index b53bbade72..1955e6a596 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -10,8 +10,6 @@ #include "font_load.h" #include "mp_msg.h" -extern char *get_path ( char * ); - raw_file* load_raw(char *name,int verbose){ int bpp; raw_file* raw=malloc(sizeof(raw_file)); diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 97d6cc6a69..773bcd3999 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -33,14 +33,13 @@ #include "font_load.h" #include "mp_msg.h" #include "mplayer.h" +#include "get_path.h" #include "osd_font.h" #if (FREETYPE_MAJOR > 2) || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 1) #define HAVE_FREETYPE21 #endif -char *get_path(const char *filename); - char *subtitle_font_encoding = NULL; float text_font_scale_factor = 5.0; float osd_font_scale_factor = 6.0; diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index 87a5d3fdb3..913400c2b6 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -18,6 +18,7 @@ #include "mp_msg.h" #include "m_option.h" #include "sub.h" +#include "get_path.h" #include "libmpdemux/mpeg_packetizer.h" #ifdef X11_FULLSCREEN @@ -27,8 +28,6 @@ #include <dxr2ioctl.h> -extern char *get_path(const char *filename); - extern float monitor_aspect; extern float movie_aspect; diff --git a/mencoder.c b/mencoder.c index 5e8d65671b..f52a45a912 100644 --- a/mencoder.c +++ b/mencoder.c @@ -48,7 +48,7 @@ #include "m_config.h" #include "parser-mecmd.h" -#include "get_path.c" +#include "get_path.h" #include "stream/stream.h" #include "libmpdemux/demuxer.h" @@ -124,7 +124,6 @@ void set_osd_msg(int id, int level, int time, const char* fmt, ...); double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio, ao_functions_t *audio_out); void exit_player_with_rc(const char* how, int rc); -char *get_path(const char *filename); void rm_osd_msg(int id); void add_subtitles(char *filename, float fps, int silent); int reinit_video_chain(void); @@ -142,7 +142,7 @@ static int cfg_include(m_option_t *conf, char *filename){ return m_config_parse_config_file(mconfig, filename); } -#include "get_path.c" +#include "get_path.h" //**************************************************************************// // XScreensaver diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 41352822d4..4816fbeda0 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "help_mp.h" #include "m_option.h" #include "m_struct.h" +#include "get_path.h" #include "libavutil/avstring.h" #include "dvbin.h" @@ -584,8 +585,6 @@ int dvb_step_channel(dvb_priv_t *priv, int dir) -extern char *get_path(const char *); - static void dvbin_close(stream_t *stream) { int i; |