summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 15:59:53 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 15:59:53 +0200
commite28e4a1b157bd0e9620fcff956d713a9921f506c (patch)
treed92e54e1e25feb84e692396cf234478f403e5738
parent560acfd0407c757e17bf72b490687d4947b05675 (diff)
parent213092c8dcfc925d8d54cf320b60cf298a870696 (diff)
downloadmpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.bz2
mpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.xz
Merge svn changes up to r30419
-rw-r--r--DOCS/man/cs/mplayer.12
-rw-r--r--DOCS/man/de/mplayer.12
-rw-r--r--DOCS/man/en/mplayer.12
-rw-r--r--DOCS/man/es/mplayer.12
-rw-r--r--DOCS/man/fr/mplayer.12
-rw-r--r--DOCS/man/hu/mplayer.116
-rw-r--r--DOCS/man/it/mplayer.12
-rw-r--r--DOCS/man/pl/mplayer.12
-rw-r--r--DOCS/man/ru/mplayer.12
-rw-r--r--DOCS/man/zh_CN/mplayer.116
-rw-r--r--DOCS/xml/cs/documentation.xml1
-rw-r--r--DOCS/xml/de/documentation.xml1
-rw-r--r--DOCS/xml/en/documentation.xml1
-rw-r--r--DOCS/xml/es/documentation.xml1
-rw-r--r--DOCS/xml/fr/documentation.xml1
-rw-r--r--DOCS/xml/hu/documentation.xml1
-rw-r--r--DOCS/xml/it/documentation.xml1
-rw-r--r--DOCS/xml/pl/documentation.xml1
-rw-r--r--DOCS/xml/ru/documentation.xml1
-rw-r--r--DOCS/xml/zh_CN/documentation.xml1
-rw-r--r--TOOLS/README14
-rw-r--r--command.c96
-rw-r--r--libao2/ao_pcm.c43
-rw-r--r--libmpcodecs/vd.c13
-rw-r--r--libmpcodecs/vf_fspp.c12
-rw-r--r--libmpcodecs/vf_halfpack.c24
-rw-r--r--libmpcodecs/vf_scale.c51
-rw-r--r--libmpcodecs/vf_spp.c10
-rw-r--r--mplayer.c6
-rw-r--r--stream/cache2.c39
-rw-r--r--stream/http.c11
-rw-r--r--stream/stream.c2
-rw-r--r--stream/stream_ftp.c7
-rw-r--r--subreader.c21
-rwxr-xr-xversion.sh2
35 files changed, 274 insertions, 135 deletions
diff --git a/DOCS/man/cs/mplayer.1 b/DOCS/man/cs/mplayer.1
index 412b64f984..174e4f063d 100644
--- a/DOCS/man/cs/mplayer.1
+++ b/DOCS/man/cs/mplayer.1
@@ -1,5 +1,5 @@
.\" Synced with r24573
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" Tuto man stránku napsali/píší Gabucino, Diego Biurrun, Jonas Jermann
.\" Překlad (translation): Jiří Heryán
.\" Kódování (encoding): UTF-8
diff --git a/DOCS/man/de/mplayer.1 b/DOCS/man/de/mplayer.1
index c8056c59b7..e0e0412b53 100644
--- a/DOCS/man/de/mplayer.1
+++ b/DOCS/man/de/mplayer.1
@@ -1,4 +1,4 @@
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" Diese Man-Page wurde/wird von Moritz Bunkus, Sebastian Krmer,
.\" Tobias Diedrich gepflegt.
.\" Encoding: iso-8859-1
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 1747a598f2..ca5bee4d09 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -1,5 +1,5 @@
.\" $Revision$
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" This man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
.
.\" --------------------------------------------------------------------------
diff --git a/DOCS/man/es/mplayer.1 b/DOCS/man/es/mplayer.1
index c45da693eb..b09f62f938 100644
--- a/DOCS/man/es/mplayer.1
+++ b/DOCS/man/es/mplayer.1
@@ -1,6 +1,6 @@
.\" synced with 1.685
.\" Encoding: iso-8859-1
-.\" MPlayer (C) 2000-2009 El equipo de MPlayer
+.\" MPlayer (C) 2000-2010 El equipo de MPlayer
.\" Esta pgina de manual ha sido escrita por Gabucino, Diego Biurrun,
.\" Jonas Jermann y traducida al espaol por Juan Martn Lpez.
.\"
diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1
index f1de6a4065..6209931071 100644
--- a/DOCS/man/fr/mplayer.1
+++ b/DOCS/man/fr/mplayer.1
@@ -1,6 +1,6 @@
.\" synced with r30135
.\" Encoding: iso-8859-1
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
.\" Traduction: Guillaume POIRIER < poirierg AT gmail POINT com >,
.
diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1
index 95ead131e3..86ddc2d752 100644
--- a/DOCS/man/hu/mplayer.1
+++ b/DOCS/man/hu/mplayer.1
@@ -1,5 +1,5 @@
-.\" Synced with r30311
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" Synced with r30414
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" Ezt a man oldalt Gabucino, Diego Biurrun s Jonas Jermann kszti/ksztette
.\" Karbantart: Gabrov
.\" Encoding/kdols: iso-8859-2
@@ -33,7 +33,7 @@
.\" Nv
.\" --------------------------------------------------------------------------
.
-.TH MPlayer 1 "2010. 01. 16." "MPlayer Project" "A film lejtsz"
+.TH MPlayer 1 "2010. 01. 24." "MPlayer Project" "A film lejtsz"
.
.SH NV
mplayer \- film lejtsz
@@ -3925,6 +3925,16 @@ Az ITU-R BT.709 sznteret hasznlja.
.IPs 3
Az SMPTE-240M sznteret hasznlja.
.RE
+.IPs levelconv=<n>
+Kivlasztja a fnyessg konvertlsi szintjt a YUV-RGB konvertls sorn
+.RSss
+.IPs 0
+TV-rl PC szintre (alaprtelmezett).
+.IPs 1
+PC-rl TV szintre.
+.IPs 2
+Nincs semmilyen konvertls.
+.RE
.IPs lscale=<n>
Kivlasztja a hasznland mretez fggvnyt a fnyerssghez.
Csak a 2-es, 3-as, 4-es s 6-os yuv mdoknl helyes.
diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1
index 1cf1d734fb..c9811f6a25 100644
--- a/DOCS/man/it/mplayer.1
+++ b/DOCS/man/it/mplayer.1
@@ -1,6 +1,6 @@
.\" synced with r30336
.\" Encoding: iso-8859-1
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" Questa pagina di manuale stata fatta da Gabucino, Diego Biurrun,
.\" Jonas Jermann
.\" Traduzione in italiano di Daniele Forghieri, aggiornamenti PaulTT
diff --git a/DOCS/man/pl/mplayer.1 b/DOCS/man/pl/mplayer.1
index da2915c355..9b484edbba 100644
--- a/DOCS/man/pl/mplayer.1
+++ b/DOCS/man/pl/mplayer.1
@@ -1,6 +1,6 @@
.\" synced with 1.1114
.\" Encoding: iso-8859-2
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" This man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
.\" Tumaczenie: Wacaw "Torinthiel" Schiller (torinthiel@wp.pl)
.\" i Maciej "Paszczi" Paszta (paszczi@go2.pl)
diff --git a/DOCS/man/ru/mplayer.1 b/DOCS/man/ru/mplayer.1
index 071db93168..5a958c27d4 100644
--- a/DOCS/man/ru/mplayer.1
+++ b/DOCS/man/ru/mplayer.1
@@ -1,4 +1,4 @@
-.\" MPlayer (C) 2000-2009 MPlayer Team
+.\" MPlayer (C) 2000-2010 MPlayer Team
.\" This man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
.\" Translated by Vladimir Voroshilov <voroshil@gmail.com>
.\" Encoding: koi8-r
diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1
index 0c7a2d7a31..f19c81b37b 100644
--- a/DOCS/man/zh_CN/mplayer.1
+++ b/DOCS/man/zh_CN/mplayer.1
@@ -1,4 +1,4 @@
-.\" sync with en/mplayer.1 r30197
+.\" sync with en/mplayer.1 r30336
.\" Encoding: UTF-8
.\" Reminder of hard terms which need better/final solution later:
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
@@ -6,7 +6,7 @@
.\" encoding audio rate; alphamap; upsampling; sweep;
.\" aligned buffers; instancenumber;
.\"
-.\" MPlayer (C) 2000-2009 MPlayer 团队
+.\" MPlayer (C) 2000-2010 MPlayer 团队
.\" 本(英文)手册页由 Gabucino, Diego Biurrun, Jonas Jermann 编写
.\" 视频滤镜、通用编解码器选项、特定编解码器专用选项三个章节由
.\" JRaSH <jrash06 AT 163.com>重新翻译
@@ -3627,7 +3627,7 @@ GL_ARB_fragment_shader!)。至少需要三个纹理单位。提供饱和度
选择 YUV 至 RGB 转换所用的色彩空间
.RSss
.IPs 0
-使用 MPlayer 通常使用的程式(默认值)
+使用 MPlayer 通常使用的公式(默认值)。
.IPs 1
使用 ITU-R BT.601 色彩空间。
.IPs 2
@@ -3635,6 +3635,16 @@ GL_ARB_fragment_shader!)。至少需要三个纹理单位。提供饱和度
.IPs 3
使用 SMPTE-240M 色彩空间。
.RE
+.IPs levelconv=<n>
+选择用于 YUV 至 RGB 转换的亮度等级转换方式。
+.RSss
+.IPs 0
+将 TV 等级转换为 PC 等级(默认值)。
+.IPs 1
+将 PC 等级转换为 TV 等级。
+.IPs 2
+不作任何转换。
+.RE
.IPs lscale=<n>
选择用于亮度调整的调节函数。
仅对 yuv 模式 2、3、4 和 6 有效。
diff --git a/DOCS/xml/cs/documentation.xml b/DOCS/xml/cs/documentation.xml
index dd3fce2618..ad733f9919 100644
--- a/DOCS/xml/cs/documentation.xml
+++ b/DOCS/xml/cs/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/de/documentation.xml b/DOCS/xml/de/documentation.xml
index 80d382829b..bc56ee3fe6 100644
--- a/DOCS/xml/de/documentation.xml
+++ b/DOCS/xml/de/documentation.xml
@@ -18,6 +18,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer-Team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/en/documentation.xml b/DOCS/xml/en/documentation.xml
index 2108533f96..00afd76f06 100644
--- a/DOCS/xml/en/documentation.xml
+++ b/DOCS/xml/en/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/es/documentation.xml b/DOCS/xml/es/documentation.xml
index 3ddc2e360c..00e5c708e7 100644
--- a/DOCS/xml/es/documentation.xml
+++ b/DOCS/xml/es/documentation.xml
@@ -17,6 +17,7 @@ para LINUX</title>
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/fr/documentation.xml b/DOCS/xml/fr/documentation.xml
index 0458d4a030..a0a3f7b613 100644
--- a/DOCS/xml/fr/documentation.xml
+++ b/DOCS/xml/fr/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/hu/documentation.xml b/DOCS/xml/hu/documentation.xml
index 57c00999d9..e41c1f05b9 100644
--- a/DOCS/xml/hu/documentation.xml
+++ b/DOCS/xml/hu/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/it/documentation.xml b/DOCS/xml/it/documentation.xml
index 6e0020886e..9257e48141 100644
--- a/DOCS/xml/it/documentation.xml
+++ b/DOCS/xml/it/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/pl/documentation.xml b/DOCS/xml/pl/documentation.xml
index 71677605d8..e0781d14b6 100644
--- a/DOCS/xml/pl/documentation.xml
+++ b/DOCS/xml/pl/documentation.xml
@@ -17,6 +17,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>Załoga MPlayera</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/ru/documentation.xml b/DOCS/xml/ru/documentation.xml
index 5d5db208d9..60c5ea58be 100644
--- a/DOCS/xml/ru/documentation.xml
+++ b/DOCS/xml/ru/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>
diff --git a/DOCS/xml/zh_CN/documentation.xml b/DOCS/xml/zh_CN/documentation.xml
index 320664846f..2924f91dc3 100644
--- a/DOCS/xml/zh_CN/documentation.xml
+++ b/DOCS/xml/zh_CN/documentation.xml
@@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
+ <year>2010</year>
<holder>MPlayer工作组</holder>
</copyright>
<!--
diff --git a/TOOLS/README b/TOOLS/README
index 4fc0968948..37a7a03afd 100644
--- a/TOOLS/README
+++ b/TOOLS/README
@@ -534,8 +534,6 @@ Notes: Known to work at least on Linux x86 with RealPlayer8.
netstream - access remote streams
---------------------------------
-NOTE: netstream does not link at the moment - help welcome.
-
netstream allows you to access most MPlayer stream types from a remote host.
The main purpose of this feature is to make it possible to directly use the
CD or DVD drive of another computer on the network (provided you have the
@@ -544,10 +542,10 @@ are not usable remotely because they are implemented at the demuxer level.
Be aware that currently the server is not secure at all.
-Compile the server by running 'make netstream' and then copy the netstream
-binary to the right place on your system (usually /usr/local/bin on Unix).
-Start the netstream server on the computer you intend to access remotely.
-There are no command line arguments.
+Compile the server by running 'make TOOLS/netstream' from the root of mplayer
+source and then copy the netstream binary to the right place on your system
+(usually /usr/local/bin on Unix). Start the netstream server on the computer you
+intend to access remotely. There are no command line arguments.
Play the second track of a VCD on the server with:
@@ -560,3 +558,7 @@ Access files on this server with:
Note that paths which do not start with a / will be interpreted as relative to
the directory where the server is running. The '-cache' option is not needed
but highly recommended.
+
+netstream will not take -dvd-device, so you must either symlink
+your drive to /dev/dvd/ or use the dvd:///path/to/dvd.
+for example: mpst://audioserver/dvd:////dev/optical/lg_black_dvd
diff --git a/command.c b/command.c
index f37b324eb0..2e4412e0a4 100644
--- a/command.c
+++ b/command.c
@@ -2490,6 +2490,60 @@ static const char *property_error_string(int error_value)
return "UNKNOWN";
}
+static void remove_subtitle_range(MPContext *mpctx, int start, int count)
+{
+ int idx;
+ int end = start + count;
+ int after = mpctx->set_of_sub_size - end;
+ sub_data **subs = mpctx->set_of_subtitles;
+#ifdef CONFIG_ASS
+ struct ass_track **ass_tracks = mpctx->set_of_ass_tracks;
+#endif
+ if (count < 0 || count > mpctx->set_of_sub_size ||
+ start < 0 || start > mpctx->set_of_sub_size - count) {
+ mp_msg(MSGT_CPLAYER, MSGL_ERR,
+ "Cannot remove invalid subtitle range %i +%i\n", start, count);
+ return;
+ }
+ for (idx = start; idx < end; idx++) {
+ sub_data *subd = subs[idx];
+ mp_msg(MSGT_CPLAYER, MSGL_STATUS,
+ "SUB: Removed subtitle file (%d): %s\n", idx + 1,
+ filename_recode(subd->filename));
+ sub_free(subd);
+ subs[idx] = NULL;
+#ifdef CONFIG_ASS
+ if (ass_tracks[idx])
+ ass_free_track(ass_tracks[idx]);
+ ass_tracks[idx] = NULL;
+#endif
+ }
+
+ mpctx->global_sub_size -= count;
+ mpctx->set_of_sub_size -= count;
+ if (mpctx->set_of_sub_size <= 0)
+ mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1;
+
+ memmove(subs + start, subs + end, after * sizeof(*subs));
+ memset(subs + start + after, 0, count * sizeof(*subs));
+#ifdef CONFIG_ASS
+ memmove(ass_tracks + start, ass_tracks + end, after * sizeof(*ass_tracks));
+ memset(ass_tracks + start + after, 0, count * sizeof(*ass_tracks));
+#endif
+
+ if (mpctx->set_of_sub_pos >= start && mpctx->set_of_sub_pos < end) {
+ mpctx->global_sub_pos = -2;
+ subdata = NULL;
+#ifdef CONFIG_ASS
+ ass_track = NULL;
+#endif
+ mp_input_queue_cmd(mpctx->input, mp_input_parse_cmd("sub_select"));
+ } else if (mpctx->set_of_sub_pos >= end) {
+ mpctx->set_of_sub_pos -= count;
+ mpctx->global_sub_pos -= count;
+ }
+}
+
void run_command(MPContext *mpctx, mp_cmd_t *cmd)
{
struct MPOpts *opts = &mpctx->opts;
@@ -3056,48 +3110,10 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
case MP_CMD_SUB_REMOVE:
if (sh_video) {
int v = cmd->args[0].v.i;
- sub_data *subd;
if (v < 0) {
- for (v = 0; v < mpctx->set_of_sub_size; ++v) {
- subd = mpctx->set_of_subtitles[v];
- mp_tmsg(MSGT_CPLAYER, MSGL_STATUS,
- "SUB: Removed subtitle file (%d): %s\n", v + 1,
- filename_recode(subd->filename));
- sub_free(subd);
- mpctx->set_of_subtitles[v] = NULL;
- }
- mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1;
- mpctx->global_sub_size -= mpctx->set_of_sub_size;
- mpctx->set_of_sub_size = 0;
- if (mpctx->set_of_sub_pos >= 0) {
- mpctx->global_sub_pos = -2;
- subdata = NULL;
- mp_input_queue_cmd(mpctx->input,
- mp_input_parse_cmd("sub_select"));
- }
+ remove_subtitle_range(mpctx, 0, mpctx->set_of_sub_size);
} else if (v < mpctx->set_of_sub_size) {
- subd = mpctx->set_of_subtitles[v];
- mp_msg(MSGT_CPLAYER, MSGL_STATUS,
- "SUB: Removed subtitle file (%d): %s\n", v + 1,
- filename_recode(subd->filename));
- sub_free(subd);
- if (mpctx->set_of_sub_pos == v) {
- mpctx->global_sub_pos = -2;
- subdata = NULL;
- mp_input_queue_cmd(mpctx->input,
- mp_input_parse_cmd("sub_select"));
- } else if (mpctx->set_of_sub_pos > v) {
- --mpctx->set_of_sub_pos;
- --mpctx->global_sub_pos;
- }
- while (++v < mpctx->set_of_sub_size)
- mpctx->set_of_subtitles[v - 1] =
- mpctx->set_of_subtitles[v];
- --mpctx->set_of_sub_size;
- --mpctx->global_sub_size;
- if (mpctx->set_of_sub_size <= 0)
- mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1;
- mpctx->set_of_subtitles[mpctx->set_of_sub_size] = NULL;
+ remove_subtitle_range(mpctx, v, 1);
}
}
break;
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c
index 5c418d0f5a..a9fab6581e 100644
--- a/libao2/ao_pcm.c
+++ b/libao2/ao_pcm.c
@@ -111,32 +111,27 @@ static int init(int rate,int channels,int format,int flags){
strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm");
}
- bits=8;
- switch(format){
- case AF_FORMAT_S32_BE:
- format=AF_FORMAT_S32_LE;
- case AF_FORMAT_S32_LE:
- bits=32;
- break;
- case AF_FORMAT_FLOAT_BE:
- format=AF_FORMAT_FLOAT_LE;
- case AF_FORMAT_FLOAT_LE:
- bits=32;
- break;
- case AF_FORMAT_S8:
- format=AF_FORMAT_U8;
- case AF_FORMAT_U8:
- break;
- case AF_FORMAT_AC3_BE:
- case AF_FORMAT_AC3_LE:
- bits=16;
- break;
- default:
- format=AF_FORMAT_S16_LE;
- bits=16;
- break;
+ if (ao_pcm_waveheader)
+ {
+ // WAV files must have one of the following formats
+
+ switch(format){
+ case AF_FORMAT_U8:
+ case AF_FORMAT_S16_LE:
+ case AF_FORMAT_S24_LE:
+ case AF_FORMAT_S32_LE:
+ case AF_FORMAT_FLOAT_LE:
+ case AF_FORMAT_AC3_BE:
+ case AF_FORMAT_AC3_LE:
+ break;
+ default:
+ format = AF_FORMAT_S16_LE;
+ break;
+ }
}
+ bits = af_fmt2bits(format);
+
ao_data.outburst = 65536;
ao_data.buffersize= 2*65536;
ao_data.channels=channels;
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 1910af62ee..1821498865 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -189,7 +189,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
} else {
// sws failed, if the last filter (vf_vo) support MPEGPES try
// to append vf_lavc
- vf_instance_t *vo, *vp = NULL, *ve;
+ vf_instance_t *vo, *vp = NULL, *ve, *vpp = NULL;
// Remove the scale filter if we added it ourselves
if (vf == sc) {
ve = vf;
@@ -197,8 +197,10 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
vf_uninit_filter(ve);
}
// Find the last filter (vf_vo)
- for (vo = vf; vo->next; vo = vo->next)
+ for (vo = vf; vo->next; vo = vo->next) {
+ vpp = vp;
vp = vo;
+ }
if (vo->query_format(vo, IMGFMT_MPEGPES)
&& (!vp || (vp && strcmp(vp->info->name, "lavc")))) {
ve = vf_open_filter(opts, vo, "lavc", NULL);
@@ -208,6 +210,13 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
vf = ve;
goto csp_again;
}
+ if (vp && !strcmp(vp->info->name,"lavc")) {
+ if (vpp)
+ vpp->next = vo;
+ else
+ vf = vo;
+ vf_uninit_filter(vp);
+ }
}
mp_tmsg(MSGT_CPLAYER, MSGL_WARN,
"The selected video_out device is incompatible with this codec.\n"\
diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c
index 7264199c21..8ef33381b1 100644
--- a/libmpcodecs/vf_fspp.c
+++ b/libmpcodecs/vf_fspp.c
@@ -533,9 +533,15 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
vf->priv->mpeg2= mpi->qscale_type;
if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){
- if(!vf->priv->non_b_qp)
- vf->priv->non_b_qp= malloc(mpi->qstride * ((mpi->h + 15) >> 4));
- fast_memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * ((mpi->h + 15) >> 4));
+ int w = mpi->qstride;
+ int h = (mpi->h + 15) >> 4;
+ if (!w) {
+ w = (mpi->w + 15) >> 4;
+ h = 1;
+ }
+ if(!vf->priv->non_b_qp)
+ vf->priv->non_b_qp= malloc(w*h);
+ fast_memcpy(vf->priv->non_b_qp, mpi->qscale, w*h);
}
if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
char *qp_tab= vf->priv->non_b_qp;
diff --git a/libmpcodecs/vf_halfpack.c b/libmpcodecs/vf_halfpack.c
index 682b80a91e..4a3bdb578f 100644
--- a/libmpcodecs/vf_halfpack.c
+++ b/libmpcodecs/vf_halfpack.c
@@ -10,11 +10,14 @@
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
+#include "vf_scale.h"
-#include "libswscale/rgb2rgb.h"
+#include "libswscale/swscale.h"
+#include "fmt-conversion.h"
struct vf_priv_s {
int field;
+ struct SwsContext *ctx;
};
#if HAVE_MMX
@@ -144,6 +147,10 @@ static void (*halfpack)(unsigned char *dst, unsigned char *src[3],
static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
{
+ const uint8_t *src[MP_MAX_PLANES] = {
+ mpi->planes[0] + mpi->stride[0]*vf->priv->field,
+ mpi->planes[1], mpi->planes[2], NULL};
+ int src_stride[MP_MAX_PLANES] = {mpi->stride[0]*2, mpi->stride[1], mpi->stride[2], 0};
mp_image_t *dmpi;
// hope we'll get DR buffer:
@@ -154,9 +161,8 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
switch(vf->priv->field) {
case 0:
case 1:
- yuv422ptoyuy2(mpi->planes[0] + mpi->stride[0]*vf->priv->field,
- mpi->planes[1], mpi->planes[2], dmpi->planes[0],
- mpi->w, mpi->h/2, mpi->stride[0]*2, mpi->stride[1], dmpi->stride[0]);
+ sws_scale(vf->priv->ctx, src, src_stride,
+ 0, mpi->h/2, dmpi->planes, dmpi->stride);
break;
default:
halfpack(dmpi->planes[0], mpi->planes, dmpi->stride[0],
@@ -170,6 +176,15 @@ static int config(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
+ if (vf->priv->field < 2) {
+ sws_freeContext(vf->priv->ctx);
+ // get unscaled 422p -> yuy2 conversion
+ vf->priv->ctx =
+ sws_getContext(width, height / 2, PIX_FMT_YUV422P,
+ width, height / 2, PIX_FMT_YUYV422,
+ SWS_POINT | SWS_PRINT_INFO | get_sws_cpuflags(),
+ NULL, NULL, NULL);
+ }
/* FIXME - also support UYVY output? */
return vf_next_config(vf, width, height/2, d_width, d_height, flags, IMGFMT_YUY2);
}
@@ -189,6 +204,7 @@ static int query_format(struct vf_instance* vf, unsigned int fmt)
static void uninit(struct vf_instance* vf)
{
+ sws_freeContext(vf->priv->ctx);
free(vf->priv);
}
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index a38cf895d9..82a56535bb 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -31,7 +31,6 @@ static struct vf_priv_s {
int interlaced;
int noup;
int accurate_rnd;
- int query_format_cache[64];
} const vf_priv_dflt = {
-1,-1,
0,
@@ -92,18 +91,48 @@ static const unsigned int outfmt_list[]={
0
};
-static unsigned int find_best_out(vf_instance_t *vf){
+/**
+ * A list of preferred conversions, in order of preference.
+ * This should be used for conversions that e.g. involve no scaling
+ * or to stop vf_scale from choosing a conversion that has no
+ * fast assembler implementation.
+ */
+static int preferred_conversions[][2] = {
+ {IMGFMT_YUY2, IMGFMT_UYVY},
+ {IMGFMT_YUY2, IMGFMT_422P},
+ {IMGFMT_UYVY, IMGFMT_YUY2},
+ {IMGFMT_UYVY, IMGFMT_422P},
+ {IMGFMT_422P, IMGFMT_YUY2},
+ {IMGFMT_422P, IMGFMT_UYVY},
+ {0, 0}
+};
+
+static unsigned int find_best_out(vf_instance_t *vf, int in_format){
unsigned int best=0;
- int i;
+ int i = -1;
+ int j = -1;
+ int format = 0;
// find the best outfmt:
- for(i=0; i<sizeof(outfmt_list)/sizeof(int)-1; i++){
- const int format= outfmt_list[i];
- int ret= vf->priv->query_format_cache[i]-1;
- if(ret == -1){
- ret= vf_next_query_format(vf, outfmt_list[i]);
- vf->priv->query_format_cache[i]= ret+1;
+ while (1) {
+ int ret;
+ if (j < 0) {
+ format = in_format;
+ j = 0;
+ } else if (i < 0) {
+ while (preferred_conversions[j][0] &&
+ preferred_conversions[j][0] != in_format)
+ j++;
+ format = preferred_conversions[j++][1];
+ // switch to standard list
+ if (!format)
+ i = 0;
}
+ if (i