From 0f86bc16babe6dae4d2fef37a144d9d57b89170b Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 22:28:55 +0000 Subject: [PATCH 01/19] Call mpcodecs_config_vo with the proper image format for dmo and dshow codecs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30645 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_dmo.c | 2 +- libmpcodecs/vd_dshow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c index a68875ed9a..f4bed70c8e 100644 --- a/libmpcodecs/vd_dmo.c +++ b/libmpcodecs/vd_dmo.c @@ -52,8 +52,8 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); return 0; } - if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; out_fmt=sh->codec->outfmt[sh->outfmtidx]; + if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c index c55068c051..3b780a411a 100644 --- a/libmpcodecs/vd_dshow.c +++ b/libmpcodecs/vd_dshow.c @@ -80,8 +80,8 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); return 0; } - if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; out_fmt=sh->codec->outfmt[sh->outfmtidx]; + if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: From 6d2c5ad18dd9e4f893f9c5ae48e216119714cd1f Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 22:34:27 +0000 Subject: [PATCH 02/19] DShow and DMO decoders need MP_IMGFLAG_COMMON_PLANE git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30646 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_dmo.c | 2 +- libmpcodecs/vd_dshow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c index f4bed70c8e..c56794d2d9 100644 --- a/libmpcodecs/vd_dmo.c +++ b/libmpcodecs/vd_dmo.c @@ -90,7 +90,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ return NULL; } - mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/, + mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_COMMON_PLANE, sh->disp_w, sh->disp_h); if(!mpi){ // temporary! diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c index 3b780a411a..71b2e20f2d 100644 --- a/libmpcodecs/vd_dshow.c +++ b/libmpcodecs/vd_dshow.c @@ -119,7 +119,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ return NULL; } - mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/, + mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_COMMON_PLANE, sh->disp_w, sh->disp_h); if(!mpi){ // temporary! From 7e808d390cc59245fa3b99d5ed164cd431029f64 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 22:37:08 +0000 Subject: [PATCH 03/19] Merge declaration and initialization. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30647 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_dmo.c | 3 +-- libmpcodecs/vd_dshow.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c index c56794d2d9..df4a836b68 100644 --- a/libmpcodecs/vd_dmo.c +++ b/libmpcodecs/vd_dmo.c @@ -46,13 +46,12 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ // init driver static int init(sh_video_t *sh){ - unsigned int out_fmt; + unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx]; if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){ mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll); mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); return 0; } - out_fmt=sh->codec->outfmt[sh->outfmtidx]; if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; switch(out_fmt){ case IMGFMT_YUY2: diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c index 71b2e20f2d..8a1d29c321 100644 --- a/libmpcodecs/vd_dshow.c +++ b/libmpcodecs/vd_dshow.c @@ -66,7 +66,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ // init driver static int init(sh_video_t *sh){ - unsigned int out_fmt; + unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx]; /* Hack for VSSH codec: new dll can't decode old files * In my samples old files have no extradata, so use that info @@ -80,7 +80,6 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); return 0; } - out_fmt=sh->codec->outfmt[sh->outfmtidx]; if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; switch(out_fmt){ case IMGFMT_YUY2: From fb610d5d97d3baff774c3b68acb85a988edeaf7b Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 23:11:27 +0000 Subject: [PATCH 04/19] DirectShow requires stride to be a multiple of 4 for RGB24/BGR24, add a special case to the DMO decoder to handle this. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30648 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_dmo.c | 49 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c index df4a836b68..00ee09bc05 100644 --- a/libmpcodecs/vd_dmo.c +++ b/libmpcodecs/vd_dmo.c @@ -39,6 +39,12 @@ static const vd_info_t info = { LIBVD_EXTERN(dmo) +struct context { + void *decoder; + uint8_t *buffer; + int stride; +}; + // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; @@ -47,57 +53,80 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ // init driver static int init(sh_video_t *sh){ unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx]; - if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){ + struct context *ctx; + void *decoder; + if(!(decoder=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){ mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll); mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_DownloadCodecPackage); return 0; } if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; + sh->context = ctx = calloc(1, sizeof(*ctx)); + ctx->decoder = decoder; switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: - DMO_VideoDecoder_SetDestFmt(sh->context,16,out_fmt);break; // packed YUV + DMO_VideoDecoder_SetDestFmt(ctx->decoder,16,out_fmt);break; // packed YUV case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: - DMO_VideoDecoder_SetDestFmt(sh->context,12,out_fmt);break; // planar YUV + DMO_VideoDecoder_SetDestFmt(ctx->decoder,12,out_fmt);break; // planar YUV case IMGFMT_YVU9: - DMO_VideoDecoder_SetDestFmt(sh->context,9,out_fmt);break; + DMO_VideoDecoder_SetDestFmt(ctx->decoder,9,out_fmt);break; + case IMGFMT_RGB24: + case IMGFMT_BGR24: + if (sh->disp_w & 3) + { + ctx->stride = ((sh->disp_w * 3) + 3) & ~3; + ctx->buffer = memalign(64, ctx->stride * sh->disp_h); + } default: - DMO_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR + DMO_VideoDecoder_SetDestFmt(ctx->decoder,out_fmt&255,0); // RGB/BGR } - DMO_VideoDecoder_StartInternal(sh->context); + DMO_VideoDecoder_StartInternal(ctx->decoder); mp_msg(MSGT_DECVIDEO,MSGL_V,MSGTR_DMOInitOK); return 1; } // uninit driver static void uninit(sh_video_t *sh){ - DMO_VideoDecoder_Destroy(sh->context); + struct context *ctx = sh->context; + DMO_VideoDecoder_Destroy(ctx->decoder); + free(ctx); + sh->context = NULL; } //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); // decode a frame static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ + struct context *ctx = sh->context; + uint8_t *buffer = ctx->buffer; + int type = ctx->buffer ? MP_IMGTYPE_EXPORT : MP_IMGTYPE_TEMP; mp_image_t* mpi; if(len<=0) return NULL; // skipped frame if(flags&3){ // framedrop: - DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 0, 0); + DMO_VideoDecoder_DecodeInternal(ctx->decoder, data, len, 0, 0); return NULL; } - mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_COMMON_PLANE, + mpi=mpcodecs_get_image(sh, type, MP_IMGFLAG_COMMON_PLANE, sh->disp_w, sh->disp_h); + if (buffer) { + mpi->planes[0] = buffer; + mpi->stride[0] = ctx->stride; + } else { + buffer = mpi->planes[0]; + } if(!mpi){ // temporary! mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec); return NULL; } - DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 1, mpi->planes[0]); + DMO_VideoDecoder_DecodeInternal(ctx->decoder, data, len, 1, buffer); return mpi; } From 9216c6376a1e34224344a76dc7da3914e362590b Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 19 Feb 2010 09:12:23 +0000 Subject: [PATCH 05/19] Remove useless CONFIG_SETLOCALE git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30649 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/asf_mmst_streaming.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c index 6d764617a4..73eed7c43e 100644 --- a/stream/asf_mmst_streaming.c +++ b/stream/asf_mmst_streaming.c @@ -43,10 +43,6 @@ #include #endif -#ifndef CONFIG_SETLOCALE -#undef CONFIG_ICONV -#endif - #ifdef CONFIG_ICONV #include #endif From 316e05b877ac8b58afebaae87ada374b73d20f47 Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 19 Feb 2010 09:14:01 +0000 Subject: [PATCH 06/19] Replace platform preprocessor check by HAVE_DOS_PATHS. This is both more elegant and more portable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30650 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu_filesel.c | 8 ++++---- stream/stream_file.c | 2 +- subreader.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c index 1321702945..e6978d7fc2 100644 --- a/libmenu/menu_filesel.c +++ b/libmenu/menu_filesel.c @@ -147,14 +147,14 @@ static int mylstat(char *dir, char *file,struct stat* st) { char *slash; l -= 3; strcpy(s, dir); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (s[l] == '/' || s[l] == '\\') #else if (s[l] == '/') #endif s[l] = '\0'; slash = strrchr(s, '/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (!slash) slash = strrchr(s,'\\'); #endif @@ -356,7 +356,7 @@ static void read_cmd(menu_t* menu,int cmd) { if(l <= 1) break; mpriv->dir[l-1] = '\0'; slash = strrchr(mpriv->dir,'/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (!slash) slash = strrchr(mpriv->dir,'\\'); #endif @@ -456,7 +456,7 @@ static int open_fs(menu_t* menu, char* args) { char *slash = NULL; if (filename && !strstr(filename, "://") && (path=realpath(filename, b))) { slash = strrchr(path, '/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS // FIXME: Do we need and can convert all '\\' in path to '/' on win32? if (!slash) slash = strrchr(path, '\\'); diff --git a/stream/stream_file.c b/stream/stream_file.c index 149660857b..dceea84db0 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -130,7 +130,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { return STREAM_ERROR; } -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__) +#if HAVE_DOS_PATHS // extract '/' from '/x:/path' if( filename[ 0 ] == '/' && filename[ 1 ] && filename[ 2 ] == ':' ) filename++; diff --git a/subreader.c b/subreader.c index c471e75e53..ddbd2839df 100644 --- a/subreader.c +++ b/subreader.c @@ -1856,7 +1856,7 @@ char** sub_filenames(const char* path, char *fname) subcnt = 0; tmp = strrchr(fname,'/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__) +#if HAVE_DOS_PATHS if(!tmp)tmp = strrchr(fname,'\\'); if(!tmp)tmp = strrchr(fname,':'); #endif From 960908ffb21c749a73d9372c216fe8f0bab66ea9 Mon Sep 17 00:00:00 2001 From: jrash Date: Fri, 19 Feb 2010 09:41:55 +0000 Subject: [PATCH 07/19] sync with en/mplayer.1 rev. 30611 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30651 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh_CN/mplayer.1 | 99 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 9 deletions(-) diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index 7fae694b8d..ed9178a45a 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -1,4 +1,4 @@ -.\" sync with en/mplayer.1 r30436 +.\" sync with en/mplayer.1 rev. 30611 .\" Encoding: UTF-8 .\" Reminder of hard terms which need better/final solution later: .\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; @@ -9458,8 +9458,14 @@ scenectu值设置得好可能为I帧找到一个更好的位置。 大,但其并不重置‘keyint计数器’。 . .TP +.B (no)intra_refresh +使用周期性的内部区域更新而不使用关键帧(默认值:禁用)。 +该选项禁用 IDR 帧,而是使用由一组内部编码的区域组成的移动垂直带。该模式降低了 +压缩效率但减小了流传输的延并增强了对丢包的容错能力。 +. +.TP .B frameref=<1\-16> -B帧和P帧中的预测器里所使用的之前出现的帧的数量(默认值:1)。 +B帧和P帧中的预测器里所使用的之前出现的帧的数量(默认值:3)。 该选项在动画是有效果的,但在实况视频素材中,大约6个参照帧之后参照帧的优化效果急 剧下降。 该选项对于解码速度没有影响,但确实增加了解码所需的内存量。 @@ -9467,7 +9473,7 @@ B帧和P帧中的预测器里所使用的之前出现的帧的数量(默认值 . .TP .B bframes=<0\-16> -I帧和P帧之间连续出现的B帧的最大数量(默认值:0) +I帧和P帧之间连续出现的B帧的最大数量(默认值:3) . .TP .B (no)b_adapt @@ -9534,6 +9540,18 @@ B2与前面所述的一样,但B1是从IO和B2预测出来的,而B3是从B2 量化参数在帧之间增加/降低的最大数值(默认值:4) . .TP +.B (no)mbtree +启用宏块树结构的码率控制(默认值:启用)。 +采用大量的预读以跟上数据在时间上的变化并相应地设置编码质量的权重。 +在多阶段的编码模式中,该模式将信息写入一个名为 .mbtree 的独立的状态文 +件中。 +. +.TP +.B rc_lookahead=<0\-250> +调整 mbtree 的预读范围(默认值:40)。 +较大的值将运行得较慢并使 x264 消耗较多的内存,但同时能产生较高的质量。 +. +.TP .B ratetol=<0.1\-100.0>(用于ABR或二阶段编码模式) 相对于平均比特率的所允许的变化程度(不针对特定编码单元)(默认值:1.0) . @@ -9619,6 +9637,21 @@ direct_pred=none不仅运行速度较慢而且质量也较差。 .RE . .TP +.B weightp +基于权重的 P 帧预测模式(默认值:2)。 +Weighted P-frame prediction mode (default: 2). +.PD 0 +.RSs +.IPs 0 +禁用(运行最快) +.IPs 1 +盲目模式(质量稍好) +.IPs 2 +智能模式(质量最好) +.RE +.PD 1 +. +.TP .B (no)weight_b 使用B帧中带权重的预测模式。 不用这个选项的话,双向预测出的宏块给每个所参照的帧相等的权重值。 @@ -9711,9 +9744,9 @@ subq=5能比subq=1多压缩掉10%。 同时也使用 SATD 指标优化双向宏块中使用的两个运动矢量,而不是重用向前和向后搜索中 找到的矢量。 .IPs 6 -启用I帧和P帧中宏块类型的码率失真优化模式。(默认值) +启用I帧和P帧中宏块类型的码率失真优化模式。 .IPs 7 -在所有帧中启用宏块类型的码率失真优化模式。 +在所有帧中启用宏块类型的码率失真优化模式。(默认值) .IPs 8 启用运动矢量的码率失真优化模式,以及I帧和P帧中的内部预测模式。 .IPs 9 @@ -9742,9 +9775,9 @@ subq=5能比subq=1多压缩掉10%。 .PD 0 .RSs .IPs 0 -禁用(默认值) +禁用 .IPs 1 -仅对最终编码启用 +仅对最终编码启用(默认值) .IPs 2 启用所有模式下的决策(运行慢,要求subq>=6) .RE @@ -9756,13 +9789,18 @@ subq=5能比subq=1多压缩掉10%。 .PD 0 .RSs .IPs rd=<0.0\-10.0> -心理优化模式的强度(要求 subq>=6)(默认值:1.0) +心理视觉优化模式的强度(要求 subq>=6)(默认值:1.0) .IPs trell=<0.0\-10.0> trellis(要求 trellis,实验性)(默认值:0.0) .RE .PD 1 . .TP +.B (no)psy +启用心理视觉优化模式,该模式降低 PSNR 和 SSIM 但应该视觉效果更好(默认值:启 +用)。 +. +.TP .B deadzone_inter=<0\-32> 设置非格子因子量化模式中帧间亮度量化无效区的大小(默认值:21)。 较小的值有助于保留最好的细节和影片的粒度感(特别是对于高比特率/质量编码有用), @@ -9874,11 +9912,40 @@ Windows CMD.EXE的用户如果尝试使用全部CQM列表时,可能在解析 . .TP .B threads=<0\-16> -生成线程以在多个CPU上平行编码(默认值:1)。 +生成线程以在多个CPU上平行编码(默认值:0)。 该选项对于压缩质量稍有一些影响。 0或‘auto’告诉x264让其侦测你有多个CPU,并选取一个适当的线程数。 . .TP +.B (no)sliced_threads +使用基于片段的多线程模式(默认值:禁用)。 +与通常的多线程模式不同,该选项不增加编程延迟,但运行稍慢且压缩上较低效。 +. +.TP +.B slice_max_size=<0 或正整数> +最大的片段尺寸,单位为字节(默认值:0)。 +值为零则没有最大值。 +. +.TP +.B slice_max_mbs=<0 或正整数> +最大的片段尺寸,单位为宏块数(默认值:0)。 +值为零则没有最大值。 +. +.TP +.B slices=<0 或正整数> +每帧最大的片段数(默认值:0)。 +值为零则没有最大值。 +. +.TP +.B sync_lookahead=<0\-250> +调整基于多线程的预读缓冲的大小(默认值:0)。 +0 或‘auto’告诉 x264 自动确定缓冲大小。 +. +.TP +.B (no)deterministic +仅使用多线程编程的确定性优化模式(默认值:启用)。 +. +.TP .B (no)global_header 使SPS和PPS只出现一次,即在比特流的开始部分(默认值:禁用)。 某些播放器,诸如Sony PSP,需要使用这个选项。 @@ -9889,6 +9956,15 @@ Windows CMD.EXE的用户如果尝试使用全部CQM列表时,可能在解析 将视频内容作为隔行扫描内容对待。 . .TP +.B (no)constrained_intra +启用受限制的帧内预测模式(默认值:禁用)。 +该选项稍稍降低压缩率,但对于 SVC 编码中的基础编码层次是必须的。 +. +.TP +.B (no)aud +将存取单元的分隔标志写入数据流(默认值:禁用)。 +. +.TP .B log=<\-1\-3> 调整打印在屏幕上的日志信息的量。 .PD 0 @@ -9927,6 +10003,11 @@ PSNR的‘Y’、‘U’、‘V’和‘Avg’域在数学上并不完美(这 如果你系统上的x264支持这个选项,那么在编码过程中将打开一个新窗口,在这个窗口中, x264会尝试总体性地显示出每一帧是如何编码。 在可视化模式下影片的每种块类型将以如下方式着色: +. +.TP +.B dump_yuv= +将 YUV 帧导出到指定的文件中。 +用于调试。 .PD 0 .RSs .IPs 红/粉红 From 8990266157effe941ea788fd944297b0abb5db73 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Feb 2010 09:46:31 +0000 Subject: [PATCH 08/19] TOOLS/realcodecs: Remove pointless '#if 1' preprocessor directives. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30652 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/realcodecs/cook.c | 2 -- TOOLS/realcodecs/drv2.c | 2 -- TOOLS/realcodecs/drv3.c | 2 -- TOOLS/realcodecs/sipr.c | 2 -- 4 files changed, 8 deletions(-) diff --git a/TOOLS/realcodecs/cook.c b/TOOLS/realcodecs/cook.c index 0cbd43af54..7e3571efe2 100644 --- a/TOOLS/realcodecs/cook.c +++ b/TOOLS/realcodecs/cook.c @@ -395,7 +395,6 @@ ulong RASetFlavor(ulong p1,ulong p2) { result=(*raSetFlavor)(p1,p2); fprintf(stderr, "--> 0x%0lx(%ld)\n\n\n", result, result); -#if 1 fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); numflavors=raGetNumberOfFlavors2(); flavor=0; @@ -413,7 +412,6 @@ ulong RASetFlavor(ulong p1,ulong p2) { } fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); -#endif return result; } diff --git a/TOOLS/realcodecs/drv2.c b/TOOLS/realcodecs/drv2.c index 278188afea..e93b4f2e8f 100644 --- a/TOOLS/realcodecs/drv2.c +++ b/TOOLS/realcodecs/drv2.c @@ -205,12 +205,10 @@ ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) { */ if(p1[0]==0x24){ -#if 1 hexdump(p1[2],64); memset(temp,0x77,16*4); memcpy(temp,p1[2],16); p1[2]=temp; -#endif } else { switch(p1[0]){ case 17: diff --git a/TOOLS/realcodecs/drv3.c b/TOOLS/realcodecs/drv3.c index 25556d4f42..38639c277b 100644 --- a/TOOLS/realcodecs/drv3.c +++ b/TOOLS/realcodecs/drv3.c @@ -192,7 +192,6 @@ ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) { // ulong *pp1=p1; ulong temp[16]; fprintf(stderr, "#R# => RV20toYUV420CustomMessage(%p,%p) [%ld,%ld,%ld] \n", p1, p2, p1[0],p1[1],p1[2]); -#if 1 if(p1[0]==0x24){ hexdump(p1[2],16); memset(temp,0x77,16*4); @@ -201,7 +200,6 @@ ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) { } else { return 0; } -#endif // fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2); // hexdump((void*)p1, 12); diff --git a/TOOLS/realcodecs/sipr.c b/TOOLS/realcodecs/sipr.c index 9a3399ea6c..31d0f0a60e 100644 --- a/TOOLS/realcodecs/sipr.c +++ b/TOOLS/realcodecs/sipr.c @@ -426,7 +426,6 @@ ulong RASetFlavor(ulong p1,ulong p2,ulong p3) { result=(*raSetFlavor)(p1,p2,p3); fprintf(stderr, "--> 0x%0lx(%ld)\n\n\n", result, result); -#if 1 fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); numflavors=3;//raGetNumberOfFlavors(); flavor=0; @@ -444,7 +443,6 @@ ulong RASetFlavor(ulong p1,ulong p2,ulong p3) { } fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); -#endif return result; } From ec3ab25f896910fc46fc077266a05e09602f6663 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Feb 2010 10:18:55 +0000 Subject: [PATCH 09/19] cosmetics: Remove commented-out #include. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30653 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_zrmjpeg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libmpcodecs/vf_zrmjpeg.c b/libmpcodecs/vf_zrmjpeg.c index 6b4c9a7c64..e7b0cbe4f6 100644 --- a/libmpcodecs/vf_zrmjpeg.c +++ b/libmpcodecs/vf_zrmjpeg.c @@ -50,7 +50,6 @@ #define HAVE_AV_CONFIG_H #include "libavcodec/avcodec.h" #include "libavcodec/mjpegenc.h" -//#include "jpeg_enc.h" /* this file is not present yet */ #undef malloc #undef free From d306b727b18ce11ff63819a66e8743c5b374bdaf Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Feb 2010 10:22:29 +0000 Subject: [PATCH 10/19] Remove pointless '#if 1' preprocessor directives. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30654 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/cfg.c | 2 -- libao2/ao_dsound.c | 3 --- libvo/mga_common.c | 2 -- libvo/vo_dxr3.c | 2 -- libvo/vo_xvmc.c | 2 -- loader/win32.c | 6 ------ stream/stream_dvdnav.c | 2 -- vidix/pm3_regs.h | 4 +--- 8 files changed, 1 insertion(+), 22 deletions(-) diff --git a/gui/cfg.c b/gui/cfg.c index 11557d1214..5d3087cb4a 100644 --- a/gui/cfg.c +++ b/gui/cfg.c @@ -205,7 +205,6 @@ static const m_option_t gui_opts[] = { "equ_channel_5",>kEquChannel5,CONF_TYPE_STRING,0,0,0,NULL }, { "equ_channel_6",>kEquChannel6,CONF_TYPE_STRING,0,0,0,NULL }, -#if 1 #define audio_equ_row( i,j ) { "equ_band_"#i#j,>kEquChannels[i][j],CONF_TYPE_FLOAT,CONF_RANGE,-15.0,15.0,NULL }, audio_equ_row( 0,0 ) audio_equ_row( 0,1 ) audio_equ_row( 0,2 ) audio_equ_row( 0,3 ) audio_equ_row( 0,4 ) audio_equ_row( 0,5 ) audio_equ_row( 0,6 ) audio_equ_row( 0,7 ) audio_equ_row( 0,8 ) audio_equ_row( 0,9 ) audio_equ_row( 1,0 ) audio_equ_row( 1,1 ) audio_equ_row( 1,2 ) audio_equ_row( 1,3 ) audio_equ_row( 1,4 ) audio_equ_row( 1,5 ) audio_equ_row( 1,6 ) audio_equ_row( 1,7 ) audio_equ_row( 1,8 ) audio_equ_row( 1,9 ) @@ -214,7 +213,6 @@ static const m_option_t gui_opts[] = audio_equ_row( 4,0 ) audio_equ_row( 4,1 ) audio_equ_row( 4,2 ) audio_equ_row( 4,3 ) audio_equ_row( 4,4 ) audio_equ_row( 4,5 ) audio_equ_row( 4,6 ) audio_equ_row( 4,7 ) audio_equ_row( 4,8 ) audio_equ_row( 4,9 ) audio_equ_row( 5,0 ) audio_equ_row( 5,1 ) audio_equ_row( 5,2 ) audio_equ_row( 5,3 ) audio_equ_row( 5,4 ) audio_equ_row( 5,5 ) audio_equ_row( 5,6 ) audio_equ_row( 5,7 ) audio_equ_row( 5,8 ) audio_equ_row( 5,9 ) #undef audio_equ_row -#endif { NULL, NULL, 0, 0, 0, 0, NULL } }; diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index c53820638d..605b0f16e0 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -55,7 +55,6 @@ LIBAO_EXTERN(dsound) /** \todo use the definitions from the win32 api headers when they define these */ -#if 1 #define WAVE_FORMAT_IEEE_FLOAT 0x0003 #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 #define WAVE_FORMAT_EXTENSIBLE 0xFFFE @@ -103,8 +102,6 @@ typedef struct { } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; #endif -#endif - static const int channel_mask[] = { SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY, SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT, diff --git a/libvo/mga_common.c b/libvo/mga_common.c index 13b73d1b45..c7ba8ddffd 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -142,11 +142,9 @@ vo_mga_flip_page(void) // printf("-- flip to %d --\n",mga_next_frame); -#if 1 ioctl(f,MGA_VID_FSEL,&mga_next_frame); mga_next_frame=(mga_next_frame+1)%mga_vid_config.num_frames; vid_data=frames[mga_next_frame]; -#endif } diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index 95ecae695e..0c031013da 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -630,9 +630,7 @@ static void draw_osd(void) */ /* Subpics are not stable yet =( expect lockups if you enable */ -#if 1 write(fd_spu, spued->data, spued->count); -#endif } disposd++; #endif diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index 76954b2649..fb0266e081 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -1110,7 +1110,6 @@ static int draw_slice(uint8_t *image[], int stride[], rndr->flags, rndr->filled_mv_blocks_num,rndr->start_mv_blocks_num, &mv_blocks,&data_blocks); -#if 1 if(rez != Success) { int i; @@ -1136,7 +1135,6 @@ static int draw_slice(uint8_t *image[], int stride[], testblock->PMV[0][0][0],testblock->PMV[0][0][1]); } } -#endif assert(rez==Success); mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: flush surface\n"); rez = XvMCFlushSurface(mDisplay, rndr->p_surface); diff --git a/loader/win32.c b/loader/win32.c index 39c9d65b05..b2e88a5a6d 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -4131,11 +4131,9 @@ static int expfprintf(void* stream, const char* format, ...) va_list args; int r = 0; dbgprintf("fprintf(%p, %s, ...)\n", stream, format); -#if 1 va_start(args, format); r = vfprintf((FILE*) stream, format, args); va_end(args); -#endif return r; } @@ -4424,7 +4422,6 @@ static int exp_setjmp3(void* jmpbuf, int x) : "d"(jmpbuf) // input : "eax" ); -#if 1 __asm__ volatile ( "mov %%fs:0, %%eax \n\t" // unsure @@ -4437,7 +4434,6 @@ static int exp_setjmp3(void* jmpbuf, int x) : : "eax" ); -#endif return 0; } @@ -4494,7 +4490,6 @@ static void WINAPI expGlobalMemoryStatus( return; } -#if 1 f = fopen( "/proc/meminfo", "r" ); if (f) { @@ -4542,7 +4537,6 @@ static void WINAPI expGlobalMemoryStatus( / (TotalPhysical / 100); } } else -#endif { /* FIXME: should do something for other systems */ lpmem->dwMemoryLoad = 0; diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index c2915fbd35..87d18f6d23 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -132,12 +132,10 @@ static dvdnav_priv_t * new_dvdnav_stream(char * filename) { dvdnav_set_readahead_flag(priv->dvdnav, 0); if(dvdnav_set_PGC_positioning_flag(priv->dvdnav, 1) != DVDNAV_STATUS_OK) mp_msg(MSGT_OPEN,MSGL_ERR,"stream_dvdnav, failed to set PGC positioning\n"); -#if 1 /* report the title?! */ if (dvdnav_get_title_string(priv->dvdnav,&title_str)==DVDNAV_STATUS_OK) { mp_msg(MSGT_IDENTIFY, MSGL_INFO,"Title: '%s'\n",title_str); } -#endif //dvdnav_event_clear(priv); diff --git a/vidix/pm3_regs.h b/vidix/pm3_regs.h index 2ec5555a79..727e873e3d 100644 --- a/vidix/pm3_regs.h +++ b/vidix/pm3_regs.h @@ -1051,8 +1051,6 @@ #define PM3FillRectanglePosition_XOffset(x) ((x)&0xffff) #define PM3FillRectanglePosition_YOffset(y) (((y)&0xffff)<<16) -#if 1 - /********************************************** * GLINT Permedia3 Macros * ***********************************************/ @@ -1109,5 +1107,5 @@ do{ \ RAMDAC_SET_INDEX(index); \ temp = READ_REG(PM3RD_IndexedData); \ } -#endif + #endif /* MPLAYER_PM3_REGS_H */ From c9cf9649cfa058af6684b66ebae331fc17f592db Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 19 Feb 2010 13:40:04 +0000 Subject: [PATCH 11/19] Add missing 'defined' for __bsdi__. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30655 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_cddb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index ad1b335de3..2fd1fa9518 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -60,7 +60,7 @@ #include #elif defined(__MINGW32__) || defined(__CYGWIN__) #include -#elif (__bsdi__) +#elif defined(__bsdi__) #include #elif defined(__APPLE__) || defined(__DARWIN__) #include From 0599ce10ab56e239b1e79cbcc35e65b391712700 Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 19 Feb 2010 13:50:16 +0000 Subject: [PATCH 12/19] Fix the stack crash(SYS3171) on OS/2 when playing qtaudio/qtvideo. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30656 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_qtaudio.c | 9 +++++++++ libmpcodecs/vd_qtvideo.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/libmpcodecs/ad_qtaudio.c b/libmpcodecs/ad_qtaudio.c index 188238233c..2ee0c7e8e7 100644 --- a/libmpcodecs/ad_qtaudio.c +++ b/libmpcodecs/ad_qtaudio.c @@ -277,6 +277,11 @@ static void uninit(sh_audio_t *sh){ int error; unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; + +#ifdef WIN32_LOADER + Setup_FS_Segment(); +#endif + error=SoundConverterEndConversion(myConverter,NULL,&ConvertedFrames,&ConvertedBytes); mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"SoundConverterEndConversion:%i\n",error); error = SoundConverterClose(myConverter); @@ -300,6 +305,10 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; +#ifdef WIN32_LOADER + Setup_FS_Segment(); +#endif + FramesToGet=minlen/OutFrameSize; if(FramesToGet*OutFrameSizedisp_w, sh->disp_h); if(!mpi) return NULL; +#ifdef WIN32_LOADER + Setup_FS_Segment(); +#endif + decpar.data = (char*)data; decpar.bufferSize = len; (**framedescHandle).dataSize=len; From ca81202840dcc690142913183b982ab474bd12ee Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Feb 2010 19:38:53 +0000 Subject: [PATCH 13/19] Add dvd_parse_chapter_range() to stream_dvd.h instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30657 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 2 -- stream/stream_dvd.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index 04058e9480..410e7e386e 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -370,6 +370,4 @@ extern const m_option_t noconfig_opts[]; extern const m_option_t lavc_decode_opts_conf[]; extern const m_option_t xvid_dec_opts[]; -int dvd_parse_chapter_range(const m_option_t*, const char*); - #endif /* MPLAYER_CFG_COMMON_H */ diff --git a/stream/stream_dvd.h b/stream/stream_dvd.h index 567d122ba7..1e6c80163a 100644 --- a/stream/stream_dvd.h +++ b/stream/stream_dvd.h @@ -26,6 +26,7 @@ #include #include #include "stream.h" +#include "m_option.h" typedef struct { dvd_reader_t *dvd; @@ -61,5 +62,6 @@ int dvd_lang_from_sid(stream_t *stream, int id); int dvd_aid_from_lang(stream_t *stream, unsigned char* lang); int dvd_sid_from_lang(stream_t *stream, unsigned char* lang); int dvd_chapter_from_cell(dvd_priv_t *dvd,int title,int cell); +int dvd_parse_chapter_range(const m_option_t *conf, const char *range); #endif /* MPLAYER_STREAM_DVD_H */ From 278d783cc7f9c720e85b9e8786be79122d32554a Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Feb 2010 19:41:17 +0000 Subject: [PATCH 14/19] Remove some pointless '#if 1' preprocessor directives. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30658 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mplayer.c b/mplayer.c index 566f955220..29f4e42d48 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1650,7 +1650,6 @@ void reinit_audio_chain(void) { ao_data.samplerate=force_srate; ao_data.channels=0; ao_data.format=audio_output_format; -#if 1 // first init to detect best values if(!init_audio_filters(mpctx->sh_audio, // preliminary init // input: @@ -1660,7 +1659,6 @@ void reinit_audio_chain(void) { mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_AudioFilterChainPreinitError); exit_player(EXIT_ERROR); } -#endif current_module="ao2_init"; mpctx->audio_out = init_best_audio_out(audio_driver_list, 0, // plugin flag @@ -1682,13 +1680,11 @@ void reinit_audio_chain(void) { if(strlen(mpctx->audio_out->info->comment) > 0) mp_msg(MSGT_CPLAYER,MSGL_V,"AO: Comment: %s\n", mpctx->audio_out->info->comment); // init audio filters: -#if 1 current_module="af_init"; if(!build_afilter_chain(mpctx->sh_audio, &ao_data)) { mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_NoMatchingFilter); goto init_error; } -#endif mpctx->mixer.audio_out = mpctx->audio_out; mpctx->mixer.volstep = volstep; return; From dd79cbf17bb6cff7de9f54d2b0082633015f772c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 19 Feb 2010 21:52:29 +0000 Subject: [PATCH 15/19] Move code that makes the filter chain match the desired output format into a separate function. Call this function also from af_add, fixes audio corruption with e.g. -softvol -af format=s16be (bug #1561). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30659 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af.c | 97 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/libaf/af.c b/libaf/af.c index 1de8ee3154..0601bd03a4 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -360,6 +360,58 @@ void af_uninit(af_stream_t* s) af_remove(s,s->first); } +/** + * Extend the filter chain so we get the required output format at the end. + * \return AF_ERROR on error, AF_OK if successful. + */ +static int fixup_output_format(af_stream_t* s) +{ + af_instance_t* af = NULL; + // Check number of output channels fix if not OK + // If needed always inserted last -> easy to screw up other filters + if(s->output.nch && s->last->data->nch!=s->output.nch){ + if(!strcmp(s->last->info->name,"format")) + af = af_prepend(s,s->last,"channels"); + else + af = af_append(s,s->last,"channels"); + // Init the new filter + if(!af || (AF_OK != af->control(af,AF_CONTROL_CHANNELS,&(s->output.nch)))) + return AF_ERROR; + if(AF_OK != af_reinit(s,af)) + return AF_ERROR; + } + + // Check output format fix if not OK + if(s->output.format != AF_FORMAT_UNKNOWN && + s->last->data->format != s->output.format){ + if(strcmp(s->last->info->name,"format")) + af = af_append(s,s->last,"format"); + else + af = s->last; + // Init the new filter + s->output.format |= af_bits2fmt(s->output.bps*8); + if(!af || (AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT,&(s->output.format)))) + return AF_ERROR; + if(AF_OK != af_reinit(s,af)) + return AF_ERROR; + } + + // Re init again just in case + if(AF_OK != af_reinit(s,s->first)) + return AF_ERROR; + + if (s->output.format == AF_FORMAT_UNKNOWN) + s->output.format = s->last->data->format; + if (!s->output.nch) s->output.nch = s->last->data->nch; + if (!s->output.rate) s->output.rate = s->last->data->rate; + if((s->last->data->format != s->output.format) || + (s->last->data->nch != s->output.nch) || + (s->last->data->rate != s->output.rate)) { + return AF_ERROR; + } + return AF_OK; +} + /* Initialize the stream "s". This function creates a new filter list if necessary according to the values set in input and output. Input and output should contain the format of the current movie and the @@ -454,47 +506,7 @@ int af_init(af_stream_t* s) if(AF_OK != af_reinit(s,af)) return -1; } - - // Check number of output channels fix if not OK - // If needed always inserted last -> easy to screw up other filters - if(s->output.nch && s->last->data->nch!=s->output.nch){ - if(!strcmp(s->last->info->name,"format")) - af = af_prepend(s,s->last,"channels"); - else - af = af_append(s,s->last,"channels"); - // Init the new filter - if(!af || (AF_OK != af->control(af,AF_CONTROL_CHANNELS,&(s->output.nch)))) - return -1; - if(AF_OK != af_reinit(s,af)) - return -1; - } - - // Check output format fix if not OK - if(s->output.format != AF_FORMAT_UNKNOWN && - s->last->data->format != s->output.format){ - if(strcmp(s->last->info->name,"format")) - af = af_append(s,s->last,"format"); - else - af = s->last; - // Init the new filter - s->output.format |= af_bits2fmt(s->output.bps*8); - if(!af || (AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT,&(s->output.format)))) - return -1; - if(AF_OK != af_reinit(s,af)) - return -1; - } - - // Re init again just in case - if(AF_OK != af_reinit(s,s->first)) - return -1; - - if (s->output.format == AF_FORMAT_UNKNOWN) - s->output.format = s->last->data->format; - if (!s->output.nch) s->output.nch = s->last->data->nch; - if (!s->output.rate) s->output.rate = s->last->data->rate; - if((s->last->data->format != s->output.format) || - (s->last->data->nch != s->output.nch) || - (s->last->data->rate != s->output.rate)) { + if (AF_OK != fixup_output_format(s)) { // Something is stuffed audio out will not work mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Unable to setup filter system can not" " meet sound-card demands, please send bugreport. \n"); @@ -523,7 +535,8 @@ af_instance_t* af_add(af_stream_t* s, char* name){ return NULL; // Reinitalize the filter list - if(AF_OK != af_reinit(s, s->first)){ + if(AF_OK != af_reinit(s, s->first) || + AF_OK != fixup_output_format(s)){ free(new); return NULL; } From 7afaac3a1ff7d8e49fc995e1d40db514017b93c7 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 19 Feb 2010 23:35:21 +0000 Subject: [PATCH 16/19] Send VOCTRL_PAUSE/VOCTRL_RESUME events also when pausing for idle mode. This makes the vos try to redraw the video if they can. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30660 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mplayer.c b/mplayer.c index 29f4e42d48..ca51a1a3c6 100644 --- a/mplayer.c +++ b/mplayer.c @@ -3058,6 +3058,8 @@ if(!noconsolecontrols && !slave_mode){ while (player_idle_mode && !filename) { play_tree_t * entry = NULL; mp_cmd_t * cmd; + if (mpctx->video_out && vo_config_count) + mpctx->video_out->control(VOCTRL_PAUSE, NULL); while (!(cmd = mp_input_get_cmd(0,1,0))) { // wait for command if (mpctx->video_out && vo_config_count) mpctx->video_out->check_events(); usec_sleep(20000); @@ -3109,6 +3111,9 @@ while (player_idle_mode && !filename) { } //--------------------------------------------------------------------------- + if (mpctx->video_out && vo_config_count) + mpctx->video_out->control(VOCTRL_RESUME, NULL); + if(filename) { mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename_recode(filename)); From 74b5e8b68a586eae6fb41d97ef5aa9132633c2a2 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Feb 2010 11:13:01 +0000 Subject: [PATCH 17/19] Make sure we do not try to use IPv6 with winsock2, we end up connecting to random addresses, causing huge delays. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30661 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tcp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stream/tcp.c b/stream/tcp.c index cf067c2ee7..5dfaa8304f 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -99,6 +99,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) { struct timeval to; #endif +#if HAVE_WINSOCK2_H && defined(HAVE_AF_INET6) + // our winsock name resolution code can not handle IPv6 + if (af == AF_INET6) { + mp_msg(MSGT_NETWORK, MSGL_WARN, "IPv6 not supported for winsock2\n"); + return TCP_ERROR_FATAL; + } +#endif + socket_server_fd = socket(af, SOCK_STREAM, 0); From 1bb489848346043ad474224a58acc2c24dfa0cfe Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Feb 2010 11:21:51 +0000 Subject: [PATCH 18/19] Print all 64 bits of seek position. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30662 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index f70a88146a..a718fe6a54 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -96,7 +96,7 @@ static int mp_read(void *opaque, uint8_t *buf, int size) { static int64_t mp_seek(void *opaque, int64_t pos, int whence) { stream_t *stream = opaque; int64_t current_pos; - mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %d, %d)\n", stream, (int)pos, whence); + mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %"PRId64", %d)\n", stream, pos, whence); if(whence == SEEK_CUR) pos +=stream_tell(stream); else if(whence == SEEK_END && stream->end_pos > 0) From bb54613ac1211c73a3614db6b7326d7cd9be39da Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Feb 2010 11:48:41 +0000 Subject: [PATCH 19/19] Fix mov reference files: for video/quicktime mime do not force a demuxer but do autodetection. This tries lavf first but will also try native demuxer for reference files where open fails for the lavf demuxer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30663 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/network.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stream/network.c b/stream/network.c index f9caf16720..38de105961 100644 --- a/stream/network.c +++ b/stream/network.c @@ -71,7 +71,11 @@ const mime_struct_t mime_type_table[] = { #ifdef CONFIG_LIBAVFORMAT // Flash Video { "video/x-flv", DEMUXER_TYPE_LAVF_PREFERRED}, - { "video/quicktime", DEMUXER_TYPE_LAVF_PREFERRED }, + // do not force any demuxer in this case! + // we want the lavf demuxer to be tried first (happens automatically anyway), + // but for mov reference files to work we must also try + // the native demuxer if lavf fails. + { "video/quicktime", 0 }, #endif // MP3 streaming, some MP3 streaming server answer with audio/mpeg { "audio/mpeg", DEMUXER_TYPE_AUDIO },