[MPlayer-dev-eng] [PATCH]Reduce version.h dependencies
Carl Eugen Hoyos
cehoyos at rainbow.studorg.tuwien.ac.at
Sat Apr 4 18:31:15 CEST 2009
Hi!
I'm still fighting rebuild duration (and I wonder which measure against
spurious rebuilds ever worked: It is broken since at least several
hundred revisions).
Attached patch is not sufficient, but moves us in the right direction,
imo.
Please comment, Carl Eugen
-------------- next part --------------
Index: vobsub.c
===================================================================
--- vobsub.c (revision 29137)
+++ vobsub.c (working copy)
@@ -15,7 +15,6 @@
#include <sys/types.h>
#include "config.h"
-#include "version.h"
#include "vobsub.h"
#include "spudec.h"
@@ -1255,6 +1254,8 @@
* Vobsub output
**********************************************************************/
+extern char *mplayer_version;
+
typedef struct {
FILE *fsub;
FILE *fidx;
@@ -1268,12 +1269,12 @@
fprintf(me->fidx,
"# VobSub index file, v7 (do not modify this line!)\n"
"#\n"
- "# Generated by MPlayer " VERSION "\n"
+ "# Generated by MPlayer %s\n"
"# See <URL:http://www.mplayerhq.hu/> for more information about MPlayer\n"
"# See <URL:http://vobsub.edensrising.com/> 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) {
Index: mpcommon.c
===================================================================
--- mpcommon.c (revision 29137)
+++ mpcommon.c (working copy)
@@ -28,6 +28,7 @@
sub_data* subdata = NULL;
subtitle* vo_sub_last = NULL;
+char *mplayer_version = VERSION;
void print_version(const char* name)
{
Index: stream/network.c
===================================================================
--- stream/network.c (revision 29137)
+++ stream/network.c (working copy)
@@ -34,9 +34,8 @@
#include "cookies.h"
#include "url.h"
-#include "version.h"
-
extern int stream_cache_size;
+extern char *mplayer_version;
/* Variables for the command line option -user, -passwd, -bandwidth,
-user-agent and -nocookies */
@@ -203,8 +202,10 @@
http_set_field(http_hdr, str);
}
else
- http_set_field( http_hdr, "User-Agent: MPlayer/"VERSION);
-
+ {
+ snprintf(str, 256, "User-Agent: MPlayer/%s", mplayer_version);
+ http_set_field( http_hdr, str);
+ }
if( strcasecmp(url->protocol, "noicyx") )
http_set_field(http_hdr, "Icy-MetaData: 1");
Index: stream/stream_cddb.c
===================================================================
--- stream/stream_cddb.c (revision 29137)
+++ stream/stream_cddb.c (working copy)
@@ -55,7 +55,6 @@
#endif
#include "cdd.h"
-#include "version.h"
#include "stream.h"
#include "network.h"
#include "libavutil/common.h"
@@ -68,6 +67,8 @@
static cd_toc_t cdtoc[100];
static int cdtoc_last_track;
+extern char *mplayer_version;
+
int
read_toc(const char *dev) {
int first = 0, last = -1;
@@ -661,7 +662,7 @@
}
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+%s", user_name, host_name, "MPlayer", mplayer_version );
}
int
More information about the MPlayer-dev-eng
mailing list