summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 00:13:11 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 00:13:11 +0200
commit13221a716588dc88c1151e0a0f8eb7cce41d461c (patch)
tree3184184f1e984d248e2570ffa05c79589d2c9a1c
parentc4f7b9666f753b320157e6497f9114523878885f (diff)
parentbb54613ac1211c73a3614db6b7326d7cd9be39da (diff)
downloadmpv-13221a716588dc88c1151e0a0f8eb7cce41d461c.tar.bz2
mpv-13221a716588dc88c1151e0a0f8eb7cce41d461c.tar.xz
Merge svn changes up to r30663
Conflicts: gui/cfg.c libmpcodecs/vd_dmo.c mplayer.c
-rw-r--r--DOCS/man/zh_CN/mplayer.199
-rw-r--r--TOOLS/realcodecs/cook.c2
-rw-r--r--TOOLS/realcodecs/drv2.c2
-rw-r--r--TOOLS/realcodecs/drv3.c2
-rw-r--r--TOOLS/realcodecs/sipr.c2
-rw-r--r--cfg-common.h2
-rw-r--r--libaf/af.c97
-rw-r--r--libao2/ao_dsound.c3
-rw-r--r--libmenu/menu_filesel.c8
-rw-r--r--libmpcodecs/ad_qtaudio.c9
-rw-r--r--libmpcodecs/vd_dmo.c54
-rw-r--r--libmpcodecs/vd_dshow.c7
-rw-r--r--libmpcodecs/vd_qtvideo.c4
-rw-r--r--libmpcodecs/vf_zrmjpeg.c1
-rw-r--r--libmpdemux/demux_lavf.c2
-rw-r--r--libvo/mga_common.c2
-rw-r--r--libvo/vo_dxr3.c2
-rw-r--r--libvo/vo_xvmc.c2
-rw-r--r--loader/win32.c6
-rw-r--r--mplayer.c9
-rw-r--r--stream/asf_mmst_streaming.c4
-rw-r--r--stream/network.c6
-rw-r--r--stream/stream_cddb.c2
-rw-r--r--stream/stream_dvd.h2
-rw-r--r--stream/stream_dvdnav.c2
-rw-r--r--stream/stream_file.c2
-rw-r--r--stream/tcp.c8
-rw-r--r--subreader.c2
-rw-r--r--vidix/pm3_regs.h4
29 files changed, 231 insertions, 116 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
+启用宏块树结构的码率控制(默认值:启用)。
+采用大量的预读以跟上数据在时间上的变化并相应地设置编码质量的权重。
+在多阶段的编码模式中,该模式将信息写入一个名为 <passlogfile>.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=<file name>
+将 YUV 帧导出到指定的文件中。
+用于调试。
.PD 0
.RSs
.IPs 红/粉红
diff --git a/TOOLS/realcodecs/cook.c b/TOOLS/realcodecs/cook.c
index ede9a33aca..2e22e7fcf7 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 43e0805b2e..ee04f0b082 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;
}
diff --git a/cfg-common.h b/cfg-common.h
index e4f3af7efd..744b6bc459 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -362,6 +362,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/libaf/af.c b/libaf/af.c
index 2e55a52fe1..934d935858 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;
}
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/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 08507bec20..3b239d11d6 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -146,14 +146,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
@@ -355,7 +355,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
@@ -455,7 +455,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/libmpcodecs/ad_qtaudio.c b/libmpcodecs/ad_qtaudio.c
index 0021d42ec1..fb308c2d2c 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*OutFrameSize<minlen &&
(FramesToGet+1)*OutFrameSize<=maxlen) ++FramesToGet;
diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c
index 217fd05725..42630d7c7e 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;
@@ -46,59 +52,81 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
- unsigned int out_fmt;
- if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){
+ unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx];
+ struct context *ctx;
+ void *decoder;
+ if(!(decoder=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){
mp_tmsg(MSGT_DECVIDEO,MSGL_ERR,"ERROR: Could not open required DirectShow codec %s.\n",sh->codec->dll);
mp_tmsg(MSGT_DECVIDEO,MSGL_HINT,"You need to upgrade/install the binary codecs package.\nGo to http://www.mplayerhq.hu/dload.html\n");
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;
+ 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_tmsg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32/DMO video codec init OK.\n");
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, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/,
+ 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_tmsg(MSGT_DECVIDEO,MSGL_WARN,"[VD_DMO] Couldn't allocate image for cinepak codec.\n");
return NULL;
}
- DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 1, mpi->planes[0]);
+ DMO_VideoDecoder_DecodeInternal(ctx->decoder, data, len, 1, buffer);
return mpi;
}
diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c
index f75294eecc..a960f5dffe 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,8 +80,7 @@ static int init(sh_video_t *sh){
mp_tmsg(MSGT_DECVIDEO,MSGL_HINT,"You need to upgrade/install the binary codecs package.\nGo to http://www.mplayerhq.hu/dload.html\n");
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:
@@ -119,7 +118,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_qtvideo.c b/libmpcodecs/vd_qtvideo.c
index 5120f612b5..8e73c84753 100644
--- a/libmpcodecs/vd_qtvideo.c
+++ b/libmpcodecs/vd_qtvideo.c
@@ -316,6 +316,10 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
sh->disp_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;
diff --git a/libmpcodecs/vf_zrmjpeg.c b/libmpcodecs/vf_zrmjpeg.c
index 87c50351d9..31f51e7765 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
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 8e9208b71c..921f9decc4 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -95,7 +95,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)
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 9a173b3ded..dc00e295ce 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -143,11 +143,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 b824f8b71e..2a366bf49e 100644
--- a/libvo/vo_dxr3.c
+++ b/libvo/vo_dxr3.c
@@ -596,9 +596,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 ac832d91d3..2294e6dea1 100644
--- a/libvo/vo_xvmc.c
+++ b/libvo/vo_xvmc.c
@@ -1104,7 +1104,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;
@@ -1130,7 +1129,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/mplayer.c b/mplayer.c
index ad754e9f1c..c6689c8249 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1727,7 +1727,6 @@ void reinit_audio_chain(struct MPContext *mpctx)
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:
@@ -1738,7 +1737,6 @@ void reinit_audio_chain(struct MPContext *mpctx)
"pre-init!\n");
exit_player(mpctx, EXIT_ERROR);
}
-#endif
current_module="ao2_init";
mpctx->audio_out = init_best_audio_out(opts->audio_driver_list,
0, // plugin flag
@@ -1760,13 +1758,11 @@ void reinit_audio_chain(struct MPContext *mpctx)
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, mpctx->sh_audio, &ao_data)) {
mp_tmsg(MSGT_CPLAYER,MSGL_ERR,"Couldn't find matching filter/ao format!\n");
goto init_error;
}
-#endif
mpctx->mixer.audio_out = mpctx->audio_out;
mpctx->mixer.volstep = volstep;
return;
@@ -3386,6 +3382,8 @@ if(!noconsolecontrols && !slave_mode){
while (player_idle_mode && !mpctx->filename) {
play_tree_t * entry = NULL;
mp_cmd_t * cmd;
+ if (mpctx->video_out && mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, VOCTRL_PAUSE, NULL);
while (!(cmd = mp_input_get_cmd(mpctx->input, 0,1,0))) { // wait for command
if (mpctx->video_out)
vo_check_events(mpctx->video_out);
@@ -3438,6 +3436,9 @@ while (player_idle_mode && !mpctx->filename) {
}
//---------------------------------------------------------------------------
+ if (mpctx->video_out && mpctx->sh_video && mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, VOCTRL_RESUME, NULL);
+
if (mpctx->filename) {
mp_tmsg(MSGT_CPLAYER,MSGL_INFO,"\nPlaying %s.\n",
filename_recode(mpctx->filename));
diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c
index a32938a871..4e7b2eb2c7 100644
--- a/stream/asf_mmst_streaming.c
+++ b/stream/asf_mmst_streaming.c
@@ -43,10 +43,6 @@
#include <winsock2.h>
#endif
-#ifndef CONFIG_SETLOCALE
-#undef CONFIG_ICONV
-#endif
-
#ifdef CONFIG_ICONV
#include <iconv.h>
#endif
diff --git a/stream/network.c b/stream/network.c
index 5802b85c67..3a0a18b622 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 },
diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
index 0c1bc0ccc6..2b84fc620f 100644
--- a/stream/stream_cddb.c
+++ b/stream/stream_cddb.c
@@ -60,7 +60,7 @@
#include <sys/cdio.h>
#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include <ddk/ntddcdrm.h>
-#elif (__bsdi__)
+#elif defined(__bsdi__)
#include <dvd.h>
#elif defined(__APPLE__) || defined(__DARWIN__)
#include <IOKit/storage/IOCDTypes.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 <dvdread/ifo_read.h>
#include <dvdread/nav_read.h>
#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 */
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index d365301b77..1ce40f5275 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/stream/stream_file.c b/stream/stream_file.c
index da9f70af44..e2114d490e 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/stream/tcp.c b/stream/tcp.c
index 1bc536d41a..2222cca1db 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);
diff --git a/subreader.c b/subreader.c
index 7d5cf6e751..1afdfb9981 100644
--- a/subreader.c
+++ b/subreader.c
@@ -1861,7 +1861,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
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 */