mirror of https://github.com/mpv-player/mpv
Factorize MPlayer/MEncoder version string handling.
The string now resides in a central object file instead of being duplicated in every file that requires a version string. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31577 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
055f411ce3
commit
a1b8092c87
2
Makefile
2
Makefile
|
@ -797,7 +797,7 @@ locale/%/LC_MESSAGES/mplayer.mo: po/%.po
|
||||||
|
|
||||||
# Make sure all generated header files are created.
|
# Make sure all generated header files are created.
|
||||||
codec-cfg.d codec-cfg.o: codecs.conf.h
|
codec-cfg.d codec-cfg.o: codecs.conf.h
|
||||||
$(call ADDSUFFIXES,.d .o,mpcommon vobsub stream/stream_cddb stream/network libmpdemux/muxer_avi osdep/mplayer.rc): version.h
|
$(call ADDSUFFIXES,.d .o,mpcommon osdep/mplayer.rc): version.h
|
||||||
|
|
||||||
# Files that depend on libswscale internals
|
# Files that depend on libswscale internals
|
||||||
libvo/vo_mga.o libvo/vo_xmga.o libmpcodecs/vf_palette.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)
|
libvo/vo_mga.o libvo/vo_xmga.o libmpcodecs/vf_palette.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "version.h"
|
#include "mpcommon.h"
|
||||||
|
|
||||||
#include "stream/stream.h"
|
#include "stream/stream.h"
|
||||||
#include "demuxer.h"
|
#include "demuxer.h"
|
||||||
#include "stheader.h"
|
#include "stheader.h"
|
||||||
|
@ -501,7 +500,7 @@ static void avifile_write_header(muxer_t *muxer){
|
||||||
// ============= INFO ===============
|
// ============= INFO ===============
|
||||||
// always include software info
|
// always include software info
|
||||||
info[0].id=mmioFOURCC('I','S','F','T'); // Software:
|
info[0].id=mmioFOURCC('I','S','F','T'); // Software:
|
||||||
info[0].text="MEncoder " VERSION;
|
info[0].text=mencoder_version;
|
||||||
// include any optional strings
|
// include any optional strings
|
||||||
i=1;
|
i=1;
|
||||||
if(info_name!=NULL){
|
if(info_name!=NULL){
|
||||||
|
|
|
@ -44,6 +44,8 @@ ASS_Track *ass_track = 0; // current track to render
|
||||||
sub_data* subdata = NULL;
|
sub_data* subdata = NULL;
|
||||||
subtitle* vo_sub_last = NULL;
|
subtitle* vo_sub_last = NULL;
|
||||||
|
|
||||||
|
const char *mencoder_version = "MEncoder " VERSION;
|
||||||
|
const char *mplayer_version = "MPlayer " VERSION;
|
||||||
|
|
||||||
void print_version(const char* name)
|
void print_version(const char* name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,11 @@ extern double sub_last_pts;
|
||||||
extern struct ass_track *ass_track;
|
extern struct ass_track *ass_track;
|
||||||
extern subtitle *vo_sub_last;
|
extern subtitle *vo_sub_last;
|
||||||
|
|
||||||
|
extern const char *mencoder_version;
|
||||||
|
extern const char *mplayer_version;
|
||||||
|
|
||||||
struct MPContext;
|
struct MPContext;
|
||||||
|
|
||||||
void print_version(const char* name);
|
void print_version(const char* name);
|
||||||
void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
|
void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
|
||||||
sh_video_t *sh_video, double refpts, double sub_offset,
|
sh_video_t *sh_video, double refpts, double sub_offset,
|
||||||
|
|
|
@ -42,15 +42,13 @@
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "libmpdemux/demuxer.h"
|
#include "libmpdemux/demuxer.h"
|
||||||
#include "m_config.h"
|
#include "m_config.h"
|
||||||
|
#include "mpcommon.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "tcp.h"
|
#include "tcp.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "cookies.h"
|
#include "cookies.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
extern int stream_cache_size;
|
extern int stream_cache_size;
|
||||||
|
|
||||||
/* Variables for the command line option -user, -passwd, -bandwidth,
|
/* Variables for the command line option -user, -passwd, -bandwidth,
|
||||||
|
@ -219,12 +217,10 @@ http_send_request( URL_t *url, off_t pos ) {
|
||||||
snprintf(str, 256, "Host: %s", server_url->hostname );
|
snprintf(str, 256, "Host: %s", server_url->hostname );
|
||||||
http_set_field( http_hdr, str);
|
http_set_field( http_hdr, str);
|
||||||
if (network_useragent)
|
if (network_useragent)
|
||||||
{
|
|
||||||
snprintf(str, 256, "User-Agent: %s", network_useragent);
|
snprintf(str, 256, "User-Agent: %s", network_useragent);
|
||||||
http_set_field(http_hdr, str);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
http_set_field( http_hdr, "User-Agent: MPlayer/"VERSION);
|
snprintf(str, 256, "User-Agent: %s", mplayer_version);
|
||||||
|
http_set_field(http_hdr, str);
|
||||||
|
|
||||||
if (network_referrer) {
|
if (network_referrer) {
|
||||||
char *referrer = NULL;
|
char *referrer = NULL;
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
#include "osdep/osdep.h"
|
#include "osdep/osdep.h"
|
||||||
|
|
||||||
#include "cdd.h"
|
#include "cdd.h"
|
||||||
#include "version.h"
|
#include "mpcommon.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
|
@ -748,8 +748,8 @@ static void cddb_create_hello(cddb_data_t *cddb_data)
|
||||||
}
|
}
|
||||||
user_name = getenv("LOGNAME");
|
user_name = getenv("LOGNAME");
|
||||||
}
|
}
|
||||||
sprintf(cddb_data->cddb_hello, "&hello=%s+%s+%s+%s",
|
sprintf(cddb_data->cddb_hello, "&hello=%s+%s+%s",
|
||||||
user_name, host_name, "MPlayer", VERSION);
|
user_name, host_name, mplayer_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cddb_retrieve(cddb_data_t *cddb_data)
|
static int cddb_retrieve(cddb_data_t *cddb_data)
|
||||||
|
|
7
vobsub.c
7
vobsub.c
|
@ -32,8 +32,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "version.h"
|
#include "mpcommon.h"
|
||||||
|
|
||||||
#include "vobsub.h"
|
#include "vobsub.h"
|
||||||
#include "spudec.h"
|
#include "spudec.h"
|
||||||
#include "mp_msg.h"
|
#include "mp_msg.h"
|
||||||
|
@ -1254,12 +1253,12 @@ static void create_idx(vobsub_out_t *me, const unsigned int *palette,
|
||||||
fprintf(me->fidx,
|
fprintf(me->fidx,
|
||||||
"# VobSub index file, v7 (do not modify this line!)\n"
|
"# VobSub index file, v7 (do not modify this line!)\n"
|
||||||
"#\n"
|
"#\n"
|
||||||
"# Generated by MPlayer " VERSION "\n"
|
"# Generated by %s\n"
|
||||||
"# See <URL:http://www.mplayerhq.hu/> for more information about MPlayer\n"
|
"# See <URL:http://www.mplayerhq.hu/> for more information about MPlayer\n"
|
||||||
"# See <URL:http://wiki.multimedia.cx/index.php?title=VOBsub> for more information about Vobsub\n"
|
"# See <URL:http://wiki.multimedia.cx/index.php?title=VOBsub> for more information about Vobsub\n"
|
||||||
"#\n"
|
"#\n"
|
||||||
"size: %ux%u\n",
|
"size: %ux%u\n",
|
||||||
orig_width, orig_height);
|
mplayer_version, orig_width, orig_height);
|
||||||
if (palette) {
|
if (palette) {
|
||||||
fputs("palette:", me->fidx);
|
fputs("palette:", me->fidx);
|
||||||
for (i = 0; i < 16; ++i) {
|
for (i = 0; i < 16; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue