From a1b8092c872977e3289e6cf5232d5b534fbd90b8 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 28 Jun 2010 08:26:14 +0000 Subject: 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 --- stream/network.c | 10 +++------- stream/stream_cddb.c | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'stream') diff --git a/stream/network.c b/stream/network.c index cf01bf7144..48d50d5de5 100644 --- a/stream/network.c +++ b/stream/network.c @@ -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; diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index 24467f13d4..abc6a86966 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -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) -- cgit v1.2.3