From 326ec0073300ea43433586abed5cf2d4f7788e99 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 30 May 2010 16:50:02 +0000 Subject: [PATCH 1/4] Add a referrer option to set the HTTP Referer field. Patch by chocolateboy [chocolate cpan org] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31288 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 4 ++++ cfg-common-opts.h | 1 + cfg-common.h | 1 + stream/network.c | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 9c5d7af513..11f5c9685d 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1789,6 +1789,10 @@ Play a raw YUV sample. .PD 1 . .TP +.B \-referrer (network only) +Specify a referrer path or URL for HTTP requests. +. +.TP .B \-rtsp\-port Used with 'rtsp://' URLs to force the client's port number. This option may be useful if you are behind a router and want to forward diff --git a/cfg-common-opts.h b/cfg-common-opts.h index dbaee846c9..b701ba26e5 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -78,6 +78,7 @@ {"passwd", &network_password, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"bandwidth", &network_bandwidth, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"referrer", &network_referrer, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"cookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nocookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, diff --git a/cfg-common.h b/cfg-common.h index 002d3ca528..9ad236abaf 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -47,6 +47,7 @@ extern char *network_username; extern char *network_password; extern int network_bandwidth; extern char *network_useragent; +extern char *network_referrer; extern int network_cookies_enabled; extern char *cookies_file; diff --git a/stream/network.c b/stream/network.c index bb866318e0..8738cad113 100644 --- a/stream/network.c +++ b/stream/network.c @@ -62,6 +62,7 @@ char *network_password=NULL; int network_bandwidth=0; int network_cookies_enabled = 0; char *network_useragent=NULL; +char *network_referrer=NULL; /* IPv6 options */ int network_ipv4_only_proxy = 0; @@ -226,6 +227,23 @@ http_send_request( URL_t *url, off_t pos ) { else http_set_field( http_hdr, "User-Agent: MPlayer/"VERSION); + if (network_referrer) { + char *referrer = NULL; + size_t len = strlen(network_referrer) + 10; + + // Check len to ensure we don't do something really bad in case of an overflow + if (len > 10) + referrer = malloc(len); + + if (referrer == NULL) { + mp_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MemAllocFailed); + } else { + snprintf(referrer, len, "Referer: %s", network_referrer); + http_set_field(http_hdr, referrer); + free(referrer); + } + } + if( strcasecmp(url->protocol, "noicyx") ) http_set_field(http_hdr, "Icy-MetaData: 1"); From 233c74254ec619edffcd9a7119e124fddd4cbda3 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 30 May 2010 19:14:18 +0000 Subject: [PATCH 2/4] Change code to let Window Manager chose window location by default. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31289 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 2 ++ libvo/x11_common.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 50b38e5da6..75ae666c93 100644 --- a/Changelog +++ b/Changelog @@ -29,6 +29,8 @@ MPlayer (1.0) * remove vf_yuy2, functionality is replaced by -vf format=yuv2 Drivers: + * X11: Window manager choses Window position by default. + Add geometry=50%:50% to your configuration to get the old behaviour. * -vo md5sum md5 calculation changed so output matches FFmpeg's -f framemd5 * Support for more formats in OpenGL video output drivers (different YUV subsampling, 16 bit per component) diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 5725beb90b..6d1cbfbce6 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1120,7 +1120,9 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y, XSelectInput(mDisplay, vo_window, StructureNotifyMask); hint.x = x; hint.y = y; hint.width = width; hint.height = height; - hint.flags = PPosition | PSize; + hint.flags = PSize; + if (geometry_xy_changed) + hint.flags |= PPosition; XSetStandardProperties(mDisplay, vo_window, title, title, None, NULL, 0, &hint); if (!vo_border) vo_x11_decoration(mDisplay, vo_window, 0); // map window @@ -1137,6 +1139,8 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y, ButtonPressMask | ButtonReleaseMask | ExposureMask); } if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + if (!geometry_xy_changed) + vo_x11_update_geometry(); vo_x11_nofs_sizepos(vo_dx, vo_dy, width, height); if (!!vo_fs != !!(flags & VOFLAG_FULLSCREEN)) vo_x11_fullscreen(); From a849e05e2c00fbf0919f47259b49ec26c66b8d44 Mon Sep 17 00:00:00 2001 From: Gabrov Date: Sun, 30 May 2010 22:11:32 +0000 Subject: [PATCH 3/4] synced with r31289 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31290 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/hu/mplayer.1 | 16 +++++++--------- DOCS/xml/hu/mencoder.xml | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1 index 14458ea600..276e0612ae 100644 --- a/DOCS/man/hu/mplayer.1 +++ b/DOCS/man/hu/mplayer.1 @@ -1,4 +1,4 @@ -.\" Synced with r31096 +.\" Synced with r31288 .\" MPlayer (C) 2000-2010 MPlayer Team .\" Ezt a man oldalt Gabucino, Diego Biurrun és Jonas Jermann készíti/készítette .\" Karbantartó: Gabrov @@ -33,7 +33,7 @@ .\" Név .\" -------------------------------------------------------------------------- . -.TH MPlayer 1 "2010. 04. 25." "MPlayer Project" "A film lejátszó" +.TH MPlayer 1 "2010. 05. 31." "MPlayer Project" "A film lejátszó" . .SH NÉV mplayer \- film lejátszó @@ -1802,6 +1802,10 @@ Nyers YUV minta lej .PD 1 . .TP +.B \-referrer (csak hálózaton) +Megadja a hivatkozó elérési útját vagy URL-jét a HTTP kérésekhez. +. +.TP .B \-rtsp\-port Az 'rtsp://' URL-ekkel használatos a kliens port számának kényszerítésére. Ez az opció hasznos, ha egy router mögött vagy és továbbítani akarod az @@ -4213,7 +4217,7 @@ Explicit megadja a haszn .PD 1 . .TP -.B s3fb (csak Linux) (lásd még \-vf yuv2 és \-dr) +.B s3fb (csak Linux) (lásd még \-dr) S3 Virge specifikus videó kimeneti vezérlő. Ez a vezérlő támogatja a kártya YUV konverzióját és méretezését, a dupla bufferelést és a direkt renderelést. @@ -6105,12 +6109,6 @@ legyen -rel (alap .RE . .TP -.B "yuy2\ \ \ " -Szoftveres YV12/\:I420/\:422P-ből YUY2-be konvertálást kényszerít ki. -Hasznos lassú YV12, de gyors YUY2 támogatással rendelkező videó kártyák/\:vezérlők -esetén. -. -.TP .B "yvu9\ \ \ " Szoftveres YVU9-YV12 színtér konvertálást kényszerít ki. Idejétmúlt a szoftveres méretező miatt. diff --git a/DOCS/xml/hu/mencoder.xml b/DOCS/xml/hu/mencoder.xml index 5a04c429aa..a3ff28b499 100644 --- a/DOCS/xml/hu/mencoder.xml +++ b/DOCS/xml/hu/mencoder.xml @@ -1,5 +1,5 @@ - + A <application>MEncoder</application> használatának alapjai From def243261a0b8e3ab0d043cd89b97f8c9826e573 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 30 May 2010 22:14:13 +0000 Subject: [PATCH 4/4] Move TS_MAX_PROBE_SIZE #define to demux_ts.h instead of duplicating it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31291 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common-opts.h | 1 - cfg-mencoder.h | 1 + cfg-mplayer.h | 1 + libmpdemux/demux_ts.c | 1 - libmpdemux/demux_ts.h | 2 ++ 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cfg-common-opts.h b/cfg-common-opts.h index b701ba26e5..bd78ab38b4 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -264,7 +264,6 @@ {"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL }, {"tsprog", &ts_prog, CONF_TYPE_INT, CONF_RANGE, 0, 65534, NULL}, -#define TS_MAX_PROBE_SIZE 2000000 /* don't forget to change this in libmpdemux/demux_ts.c too */ {"tsprobe", &ts_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, {"psprobe", &ps_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, {"tskeepbroken", &ts_keep_broken, CONF_TYPE_FLAG, 0, 0, 1, NULL}, diff --git a/cfg-mencoder.h b/cfg-mencoder.h index 993e1696bd..b9845b30ae 100644 --- a/cfg-mencoder.h +++ b/cfg-mencoder.h @@ -24,6 +24,7 @@ */ #include "libmpcodecs/ve_x264.h" +#include "libmpdemux/demux_ts.h" #include "cfg-common.h" extern int sws_flags; diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 1cb5b5ff59..85b65bc135 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -25,6 +25,7 @@ #include "cfg-common.h" #include "libmpcodecs/vd.h" +#include "libmpdemux/demux_ts.h" #include "libvo/vo_zr.h" extern int key_fifo_size; diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index 0a79dcded5..eb80ab1701 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -45,7 +45,6 @@ #define MAX_HEADER_SIZE 6 /* enough for PES header + length */ #define MAX_CHECK_SIZE 65535 -#define TS_MAX_PROBE_SIZE 2000000 /* do not forget to change this in cfg-common-opts.h, too */ #define NUM_CONSECUTIVE_TS_PACKETS 32 #define NUM_CONSECUTIVE_AUDIO_PACKETS 348 #define MAX_A52_FRAME_SIZE 3840 diff --git a/libmpdemux/demux_ts.h b/libmpdemux/demux_ts.h index e8db01716f..7a06d80f2e 100644 --- a/libmpdemux/demux_ts.h +++ b/libmpdemux/demux_ts.h @@ -21,6 +21,8 @@ #include +#define TS_MAX_PROBE_SIZE 2000000 + int mp_a52_framesize(uint8_t *buf, int *srate); #endif /* MPLAYER_DEMUX_TS_H */