From e22ebfddb1e8c652e1750f36044b53684161301c Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 06:28:58 +0000 Subject: [PATCH 01/11] Add support for -geometry x syntax since the documentation claims it is supported. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31318 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/geometry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libvo/geometry.c b/libvo/geometry.c index 9d60ada29f..4bc08f811d 100644 --- a/libvo/geometry.c +++ b/libvo/geometry.c @@ -40,7 +40,7 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh) int width, height, xoff, yoff, xper, yper; int i; int ok = 0; - for (i = 0; !ok && i < 8; i++) { + for (i = 0; !ok && i < 9; i++) { width = height = xoff = yoff = xper = yper = INT_MIN; strcpy(xsign, "+"); strcpy(ysign, "+"); @@ -72,6 +72,9 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh) case 7: ok = sscanf(vo_geometry, "%i%1[%]%c", &xper, dummy, dummy) == 2; break; + case 8: + ok = sscanf(vo_geometry, "%i%c", &xoff, dummy) == 1; + break; } } if (!ok) { From 06d20bd7748d2d3138d69ea8d9a2aa6e192a8b1b Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 06:41:43 +0000 Subject: [PATCH 02/11] Sync libdvdcss with their latest SVN. In particular fixes a wring return value check which caused descrambling to be aborted for no good reason. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31319 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libdvdcss/css.c | 2 +- libdvdcss/libdvdcss.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libdvdcss/css.c b/libdvdcss/css.c index 2bb4f18833..264f43a1a9 100644 --- a/libdvdcss/css.c +++ b/libdvdcss/css.c @@ -158,7 +158,7 @@ int _dvdcss_test( dvdcss_t dvdcss ) default: psz_type = "unknown status"; break; } - print_debug( dvdcss, "drive region mask %x, %s, %s", + print_debug( dvdcss, "drive region mask 0x%x, %s, %s", i_mask, psz_rpc, psz_type ); if( i_copyright && i_rpc == 1 && i_type == 0 ) diff --git a/libdvdcss/libdvdcss.c b/libdvdcss/libdvdcss.c index f39d7025d4..d13d0c9a4d 100644 --- a/libdvdcss/libdvdcss.c +++ b/libdvdcss/libdvdcss.c @@ -367,12 +367,12 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) if( dvdcss->b_ioctls ) { i_ret = _dvdcss_test( dvdcss ); - if( i_ret == -2 ) + + if( i_ret == -3 ) { - /* Scrambled disk, RPC-II drive, no region set: bail out */ - free( dvdcss->psz_device ); - free( dvdcss ); - return NULL; + print_debug( dvdcss, "scrambled disc on a region-free RPC-II " + "drive: possible failure, but continuing " + "anyway" ); } else if( i_ret < 0 ) { From 5377f6a0c3e66727df8eede0b5061e22fad556d2 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 06:45:01 +0000 Subject: [PATCH 03/11] Remove colorspace conversion code from -vo yuv4mpeg, -vf scale should be able to handle this just as well (or better) including interlaced. If not, this needs to be fixed there instead of duplicating code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31320 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 4 +- help/help_mp-en.h | 2 - libvo/vo_yuv4mpeg.c | 270 +----------------------------------------- 3 files changed, 5 insertions(+), 271 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index d50a988753..6238b1f3b2 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -4349,7 +4349,9 @@ Transforms the video stream into a sequence of uncompressed YUV 4:2:0 images and stores it in a file (default: ./stream.yuv). The format is the same as the one employed by mjpegtools, so this is useful if you want to process the video with the mjpegtools suite. -It supports the YV12, RGB (24 bpp) and BGR (24 bpp) format. +It supports the YV12 format. +If your source file has a different format and is interlaced, make sure +to use -vf scale=::1 to ensure the conversion uses interlaced mode. You can combine it with the \-fixed\-vo option to concatenate files with the same dimensions and fps value. .PD 0 diff --git a/help/help_mp-en.h b/help/help_mp-en.h index b570c371ed..ab4a4daf49 100644 --- a/help/help_mp-en.h +++ b/help/help_mp-en.h @@ -1110,9 +1110,7 @@ static const char help_text[]= // vo_yuv4mpeg.c #define MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4 "Interlaced mode requires image height to be divisible by 4." #define MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail "Unable to allocate line buffer for interlaced mode." -#define MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB "Input not RGB, can't separate chrominance by fields!" #define MSGTR_VO_YUV4MPEG_WidthDivisibleBy2 "Image width must be divisible by 2." -#define MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf "Not enough memory to allocate RGB framebuffer." #define MSGTR_VO_YUV4MPEG_OutFileOpenError "Can't get memory or file handle to write \"%s\"!" #define MSGTR_VO_YUV4MPEG_OutFileWriteError "Error writing image to output!" #define MSGTR_VO_YUV4MPEG_UnknownSubDev "Unknown subdevice: %s" diff --git a/libvo/vo_yuv4mpeg.c b/libvo/vo_yuv4mpeg.c index 01bfa8164b..3bddcafaaa 100644 --- a/libvo/vo_yuv4mpeg.c +++ b/libvo/vo_yuv4mpeg.c @@ -55,11 +55,6 @@ #include "sub.h" #include "fastmemcpy.h" -#include "libswscale/swscale.h" -#ifdef CONFIG_LIBSWSCALE_A -#include "libswscale/rgb2rgb.h" -#endif -#include "libmpcodecs/vf_scale.h" #include "libavutil/rational.h" static const vo_info_t info = @@ -81,9 +76,6 @@ static uint8_t *image_y = NULL; static uint8_t *image_u = NULL; static uint8_t *image_v = NULL; -static uint8_t *rgb_buffer = NULL; -static uint8_t *rgb_line_buffer = NULL; - static char *yuv_filename = NULL; static int using_format = 0; @@ -128,18 +120,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4); return -1; } - - rgb_line_buffer = malloc(image_width * 3); - if (!rgb_line_buffer) - { - mp_msg(MSGT_VO,MSGL_FATAL, - MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail); - return -1; - } - - if (using_format == IMGFMT_YV12) - mp_msg(MSGT_VO,MSGL_WARN, - MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB); } if (width % 2) @@ -149,20 +129,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, return -1; } -#ifdef CONFIG_LIBSWSCALE_A - if(using_format != IMGFMT_YV12) - { - sws_rgb2rgb_init(get_sws_cpuflags()); - rgb_buffer = malloc(image_width * image_height * 3); - if (!rgb_buffer) - { - mp_msg(MSGT_VO,MSGL_FATAL, - MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf); - return -1; - } - } -#endif - write_bytes = image_width * image_height * 3 / 2; image = malloc(write_bytes); @@ -187,44 +153,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, return 0; } -/* Only use when h divisable by 2! */ -static void swap_fields(uint8_t *ptr, const int h, const int stride) -{ - int i; - - for (i=0; i Date: Sat, 5 Jun 2010 11:38:19 +0000 Subject: [PATCH 04/11] sync with en/mplayer.1 rev. 31292 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31321 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh_CN/mplayer.1 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index 30cc8a3c5a..cfbf87341d 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -1,18 +1,10 @@ -.\" sync with en/mplayer.1 rev. 31173 +.\" sync with en/mplayer.1 rev. 31292 .\" Encoding: UTF-8 -.\" Reminder of hard terms which need better/final solution later: -.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; -.\" wrapper script ... shellescapes; keyframe; deblock; dering; -.\" encoding audio rate; alphamap; upsampling; sweep; -.\" aligned buffers; instancenumber; .\" .\" MPlayer (C) 2000-2010 MPlayer 团队 .\" 本(英文)手册页由 Gabucino, Diego Biurrun, Jonas Jermann 编写 .\" 视频滤镜、通用编解码器选项、特定编解码器专用选项三个章节由 .\" JRaSH 重新翻译 -.\" 参于翻译本中文手册页的有: -.\" JRaSH , -.\" Lu Ran , Sheldon Jin , . .\" -------------------------------------------------------------------------- .\" 宏定义 @@ -1116,6 +1108,7 @@ MPlayer 从标准输入读取以新行 (\\n) 分隔开的命令行, 选择 AC-3 音频流的动态范围压缩(DRC)级别。 <级别> 是 0 到 1 的浮点数, 其中 0 表示无压缩, (默认值) 1 表示全压缩 (使得响亮的通路更安静或相反)。 +可使用大于 2 的值,但仅供试验。 此选项仅当 AC-3 流包含所需范围的压缩信息时显示效果。 . .TP @@ -1687,6 +1680,10 @@ radio://1, radio://104.4, radio_set_channel 1 .PD 1 . .TP +.B \-referrer <字符串>(仅用于网络环境) +为 HTTP 请求指定引用页面的路径或 URL。 +. +.TP .B \-rtsp\-port 与 "rtsp://" 的 URL 地址一起用来锁定客户端的端口号。 如果你在路由器后面, 想把 RTSP 流从服务器转到指定客户端, 此选项可能有用。 From ef14d50ad6298ed1df07f1034326878bf71149d8 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sat, 5 Jun 2010 13:44:20 +0000 Subject: [PATCH 05/11] Fix compilation after FFmpeg r23485. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31322 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_geq.c | 6 +++--- libmpcodecs/vf_qp.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libmpcodecs/vf_geq.c b/libmpcodecs/vf_geq.c index 10e9e833b7..b701fcc2ec 100644 --- a/libmpcodecs/vf_geq.c +++ b/libmpcodecs/vf_geq.c @@ -34,7 +34,7 @@ #include "vf.h" #include "libavcodec/avcodec.h" -#include "libavcodec/eval.h" +#include "libavutil/eval.h" struct vf_priv_s { AVExpr * e[3]; @@ -116,7 +116,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ const_values[3]=y; for(x=0; xpriv->e[plane], + dst[x + y * dst_stride] = av_eval_expr(vf->priv->e[plane], const_values, vf); } } @@ -178,7 +178,7 @@ static int vf_open(vf_instance_t *vf, char *args){ plane==0 ? lum : (plane==1 ? cb : cr), NULL }; - res = ff_parse_expr(&vf->priv->e[plane], eq[plane], const_names, NULL, NULL, func2_names, func2, 0, NULL); + res = av_parse_expr(&vf->priv->e[plane], eq[plane], const_names, NULL, NULL, func2_names, func2, 0, NULL); if (res < 0) { mp_msg(MSGT_VFILTER, MSGL_ERR, "geq: error loading equation `%s'\n", eq[plane]); diff --git a/libmpcodecs/vf_qp.c b/libmpcodecs/vf_qp.c index 8e58e2abb0..82c561288b 100644 --- a/libmpcodecs/vf_qp.c +++ b/libmpcodecs/vf_qp.c @@ -32,7 +32,7 @@ #include "libvo/fastmemcpy.h" #include "libavcodec/avcodec.h" -#include "libavcodec/eval.h" +#include "libavutil/eval.h" struct vf_priv_s { @@ -69,7 +69,7 @@ static int config(struct vf_instance *vf, double temp_val; int res; - res= ff_parse_and_eval_expr(&temp_val, vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL); + res= av_parse_and_eval_expr(&temp_val, vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL); if (res < 0){ mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\" \n", vf->priv->eq); From 244b88472840fc5a404c35baa2655af8a972b158 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 15:57:57 +0000 Subject: [PATCH 06/11] Do not make seek fail explicitly simply because eof was hit somewhen, instead reuse the eof checking code further down. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31323 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/stream/stream.h b/stream/stream.h index 1ff94a331c..9772065a4e 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -284,8 +284,6 @@ inline static int stream_seek(stream_t *s,off_t pos){ mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%qX\n",(long long)pos); - if(s->eof) - return 0; if(pospos){ off_t x=pos-(s->pos-s->buf_len); if(x>=0){ From 159f5f451dbc8e8766150122db62de498577270b Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 16:00:49 +0000 Subject: [PATCH 07/11] Di not do a stream_reset on seeking backwards, the seek itself should do whatever is best/necessary, this method will just drop cached data. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31324 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 72363ef520..9fbe63427c 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -113,8 +113,6 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence) { if(pos<0) return -1; - if(posend_pos && stream->eof) - stream_reset(stream); current_pos = stream_tell(stream); if(stream_seek(stream, pos)==0) { stream_reset(stream); From 1581d9deb24cf5d2930cb05f69fe672ebb869d15 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 16:12:36 +0000 Subject: [PATCH 08/11] Remove explicit eof check for mp_read code, stream code handles this case better, e.g. properly supporting growing files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31325 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 9fbe63427c..a7ba7c535e 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -87,8 +87,6 @@ static int mp_read(void *opaque, uint8_t *buf, int size) { stream_t *stream = demuxer->stream; int ret; - if(stream_eof(stream)) //needed? - return -1; ret=stream_read(stream, buf, size); mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), eof:%d\n", ret, stream, buf, size, stream->eof); From 29b2cae62108432021cf0f5ad203585ab695a23f Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 16:14:56 +0000 Subject: [PATCH 09/11] Also print current stream position in mp_read debug output. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31326 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index a7ba7c535e..183030281b 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -89,7 +89,8 @@ static int mp_read(void *opaque, uint8_t *buf, int size) { ret=stream_read(stream, buf, size); - mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), eof:%d\n", ret, stream, buf, size, stream->eof); + mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), pos: %"PRId64", eof:%d\n", + ret, stream, buf, size, stream_tell(stream), stream->eof); return ret; } From eced1edd7ef225a71dd0e71354e4adc9a8b99f47 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 16:37:10 +0000 Subject: [PATCH 10/11] Add partial support for dirac to TS demuxer. E.g. no header parsing is implemented so -fps must be specified manually. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31327 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_ts.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index eb80ab1701..5d258065ed 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -70,6 +70,7 @@ typedef enum VIDEO_MPEG4 = 0x10000004, VIDEO_H264 = 0x10000005, VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'), + VIDEO_DIRAC = mmioFOURCC('d', 'r', 'a', 'c'), VIDEO_VC1 = mmioFOURCC('W', 'V', 'C', '1'), AUDIO_MP2 = 0x50, AUDIO_A52 = 0x2000, @@ -246,7 +247,7 @@ typedef struct { #define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS) || ((x) == AUDIO_TRUEHD)) -#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_VC1)) +#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_DIRAC) || ((x) == VIDEO_VC1)) #define IS_SUB(x) (((x) == SPU_DVD) || ((x) == SPU_DVB) || ((x) == SPU_TELETEXT)) static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe); @@ -2327,6 +2328,10 @@ static int parse_descriptors(struct pmt_es_t *es, uint8_t *ptr) { es->type = VIDEO_VC1; } + else if(d[0] == 'd' && d[1] == 'r' && d[2] == 'a' && d[3] == 'c') + { + es->type = VIDEO_DIRAC; + } else es->type = UNKNOWN; mp_msg(MSGT_DEMUX, MSGL_DBG2, "FORMAT %s\n", es->format_descriptor); @@ -2524,6 +2529,9 @@ static int parse_pmt(ts_priv_t * priv, uint16_t progid, uint16_t pid, int is_sta case 0x86: pmt->es[idx].type = AUDIO_DTS; break; + case 0xD1: + pmt->es[idx].type = VIDEO_DIRAC; + break; case 0xEA: pmt->es[idx].type = VIDEO_VC1; break; From 09bca6575f66394e1f4ba3845330d21d30895f3d Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 16:46:25 +0000 Subject: [PATCH 11/11] If we have no FPS value, try enabling -correct-pts mode, it does not require any FPS value. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31328 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mplayer.c b/mplayer.c index c7b13fcb25..0bb5797dc9 100644 --- a/mplayer.c +++ b/mplayer.c @@ -3498,9 +3498,9 @@ if(mpctx->sh_video){ } vo_fps = mpctx->sh_video->fps; - if(!mpctx->sh_video->fps && !force_fps){ + if(!mpctx->sh_video->fps && !force_fps && !correct_pts){ mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_FPSnotspecified); - mpctx->sh_video=mpctx->d_video->sh=NULL; + correct_pts = 1; } }