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:
diego 2010-06-28 08:26:14 +00:00 committed by Uoti Urpala
parent 055f411ce3
commit a1b8092c87
7 changed files with 18 additions and 18 deletions

View File

@ -797,7 +797,7 @@ locale/%/LC_MESSAGES/mplayer.mo: po/%.po
# Make sure all generated header files are created.
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
libvo/vo_mga.o libvo/vo_xmga.o libmpcodecs/vf_palette.o: CFLAGS := -I$(FFMPEG_SOURCE_PATH) $(CFLAGS)

View File

@ -24,8 +24,7 @@
#include <limits.h>
#include "config.h"
#include "version.h"
#include "mpcommon.h"
#include "stream/stream.h"
#include "demuxer.h"
#include "stheader.h"
@ -501,7 +500,7 @@ static void avifile_write_header(muxer_t *muxer){
// ============= INFO ===============
// always include software info
info[0].id=mmioFOURCC('I','S','F','T'); // Software:
info[0].text="MEncoder " VERSION;
info[0].text=mencoder_version;
// include any optional strings
i=1;
if(info_name!=NULL){

View File

@ -44,6 +44,8 @@ ASS_Track *ass_track = 0; // current track to render
sub_data* subdata = NULL;
subtitle* vo_sub_last = NULL;
const char *mencoder_version = "MEncoder " VERSION;
const char *mplayer_version = "MPlayer " VERSION;
void print_version(const char* name)
{

View File

@ -27,7 +27,11 @@ extern double sub_last_pts;
extern struct ass_track *ass_track;
extern subtitle *vo_sub_last;
extern const char *mencoder_version;
extern const char *mplayer_version;
struct MPContext;
void print_version(const char* name);
void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
sh_video_t *sh_video, double refpts, double sub_offset,

View File

@ -42,15 +42,13 @@
#include "stream.h"
#include "libmpdemux/demuxer.h"
#include "m_config.h"
#include "mpcommon.h"
#include "network.h"
#include "tcp.h"
#include "http.h"
#include "cookies.h"
#include "url.h"
#include "version.h"
extern int stream_cache_size;
/* 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 );
http_set_field( http_hdr, str);
if (network_useragent)
{
snprintf(str, 256, "User-Agent: %s", network_useragent);
http_set_field(http_hdr, str);
}
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) {
char *referrer = NULL;

View File

@ -70,7 +70,7 @@
#include "osdep/osdep.h"
#include "cdd.h"
#include "version.h"
#include "mpcommon.h"
#include "stream.h"
#include "network.h"
#include "libavutil/common.h"
@ -748,8 +748,8 @@ static void cddb_create_hello(cddb_data_t *cddb_data)
}
user_name = getenv("LOGNAME");
}
sprintf(cddb_data->cddb_hello, "&hello=%s+%s+%s+%s",
user_name, host_name, "MPlayer", VERSION);
sprintf(cddb_data->cddb_hello, "&hello=%s+%s+%s",
user_name, host_name, mplayer_version);
}
static int cddb_retrieve(cddb_data_t *cddb_data)

View File

@ -32,8 +32,7 @@
#include <sys/types.h>
#include "config.h"
#include "version.h"
#include "mpcommon.h"
#include "vobsub.h"
#include "spudec.h"
#include "mp_msg.h"
@ -1254,12 +1253,12 @@ static void create_idx(vobsub_out_t *me, const unsigned int *palette,
fprintf(me->fidx,
"# VobSub index file, v7 (do not modify this line!)\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://wiki.multimedia.cx/index.php?title=VOBsub> for more information about Vobsub\n"
"#\n"
"size: %ux%u\n",
orig_width, orig_height);
mplayer_version, orig_width, orig_height);
if (palette) {
fputs("palette:", me->fidx);
for (i = 0; i < 16; ++i) {