1
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:33:46 +01:00

Merge svn changes up to r30419

This commit is contained in:
Uoti Urpala 2010-01-25 15:59:53 +02:00
commit e28e4a1b15
35 changed files with 274 additions and 135 deletions

View File

@ -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

View File

@ -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 Krämer,
.\" Tobias Diedrich gepflegt.
.\" Encoding: iso-8859-1

View File

@ -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
.
.\" --------------------------------------------------------------------------

View File

@ -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 página de manual ha sido escrita por Gabucino, Diego Biurrun,
.\" Jonas Jermann y traducida al español por Juan Martín López.
.\"

View File

@ -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 >,
.

View File

@ -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 készíti/készítette
.\" Karbantartó: Gabrov
.\" Encoding/kódolás: iso-8859-2
@ -33,7 +33,7 @@
.\" Név
.\" --------------------------------------------------------------------------
.
.TH MPlayer 1 "2010. 01. 16." "MPlayer Project" "A film lejátszó"
.TH MPlayer 1 "2010. 01. 24." "MPlayer Project" "A film lejátszó"
.
.SH NÉV
mplayer \- film lejátszó
@ -3925,6 +3925,16 @@ Az ITU-R BT.709 sz
.IPs 3
Az SMPTE-240M színteret használja.
.RE
.IPs levelconv=<n>
Kiválasztja a fényesség konvertálási szintjét a YUV-RGB konvertálás során
.RSss
.IPs 0
TV-ről PC szintre (alapértelmezett).
.IPs 1
PC-ről TV szintre.
.IPs 2
Nincs semmilyen konvertálás.
.RE
.IPs lscale=<n>
Kiválasztja a használandó méretező függvényt a fényerősséghez.
Csak a 2-es, 3-as, 4-es és 6-os yuv módoknál helyes.

View File

@ -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

View File

@ -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
.\" Tłumaczenie: Wacław "Torinthiel" Schiller (torinthiel@wp.pl)
.\" i Maciej "Paszczi" Paszta (paszczi@go2.pl)

View File

@ -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

View File

@ -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 有效。

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -18,6 +18,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer-Team</holder>
</copyright>
<legalnotice>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -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>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -17,6 +17,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>Załoga MPlayera</holder>
</copyright>
<legalnotice>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer team</holder>
</copyright>
<legalnotice>

View File

@ -16,6 +16,7 @@
<year>2007</year>
<year>2008</year>
<year>2009</year>
<year>2010</year>
<holder>MPlayer工作组</holder>
</copyright>
<!--

View File

@ -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

View File

@ -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;

View File

@ -111,31 +111,26 @@ static int init(int rate,int channels,int format,int flags){
strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm");
}
bits=8;
if (ao_pcm_waveheader)
{
// WAV files must have one of the following formats
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_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:
bits=16;
break;
default:
format=AF_FORMAT_S16_LE;
bits=16;
format = AF_FORMAT_S16_LE;
break;
}
}
bits = af_fmt2bits(format);
ao_data.outburst = 65536;
ao_data.buffersize= 2*65536;

View File

@ -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"\

View File

@ -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){
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(mpi->qstride * ((mpi->h + 15) >> 4));
fast_memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * ((mpi->h + 15) >> 4));
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;

View File

@ -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);
}

View File

@ -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 >= 0)
format = outfmt_list[i++];
if (!format)
break;
ret = vf_next_query_format(vf, format);
mp_msg(MSGT_VFILTER,MSGL_DBG2,"scale: query(%s) -> %d\n",vo_format_name(format),ret&3);
if(ret&VFCAP_CSP_SUPPORTED_BY_HW){
@ -120,7 +149,7 @@ static int config(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
struct MPOpts *opts = vf->opts;
unsigned int best=find_best_out(vf);
unsigned int best=find_best_out(vf, outfmt);
int vo_flags;
int int_sws_flags=0;
int round_w=0, round_h=0;
@ -494,7 +523,7 @@ static int query_format(struct vf_instance* vf, unsigned int fmt){
case IMGFMT_RGB48LE:
case IMGFMT_RGB48BE:
{
unsigned int best=find_best_out(vf);
unsigned int best=find_best_out(vf, fmt);
int flags;
if(!best) return 0; // no matching out-fmt
flags=vf_next_query_format(vf,best);

View File

@ -475,9 +475,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){
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(mpi->qstride * ((mpi->h + 15) >> 4));
fast_memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * ((mpi->h + 15) >> 4));
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;

View File

@ -3554,10 +3554,12 @@ if(mpctx->stream->type==STREAMTYPE_DVDNAV){
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
goto_enable_cache:
if(stream_cache_size>0){
int res;
current_module="enable_cache";
if(!stream_enable_cache(mpctx->stream,stream_cache_size*1024,
res = stream_enable_cache(mpctx->stream,stream_cache_size*1024,
stream_cache_size*1024*(stream_cache_min_percent / 100.0),
stream_cache_size*1024*(stream_cache_seek_min_percent / 100.0)))
stream_cache_size*1024*(stream_cache_seek_min_percent / 100.0));
if(res == 0)
if((mpctx->stop_play = libmpdemux_was_interrupted(mpctx, PT_NEXT_ENTRY))) goto goto_next_file;
}

View File

@ -15,6 +15,7 @@
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include "osdep/shmem.h"
#include "osdep/timer.h"
@ -280,22 +281,27 @@ static cache_vars_t* cache_init(int size,int sector){
void cache_uninit(stream_t *s) {
cache_vars_t* c = s->cache_data;
if(!s->cache_pid) return;
if(s->cache_pid) {
#if defined(__MINGW32__) || defined(PTHREAD_CACHE) || defined(__OS2__)
cache_do_control(s, -2, NULL);
#else
kill(s->cache_pid,SIGKILL);
waitpid(s->cache_pid,NULL,0);
#endif
s->cache_pid = 0;
}
if(!c) return;
#if defined(__MINGW32__) || defined(PTHREAD_CACHE) || defined(__OS2__)
free(c->stream);
free(c->buffer);
c->buffer = NULL;
free(s->cache_data);
#else
shmem_free(c->buffer,c->buffer_size);
c->buffer = NULL;
shmem_free(s->cache_data,sizeof(cache_vars_t));
#endif
s->cache_data = NULL;
}
static void exit_sighandler(int x){
@ -303,8 +309,12 @@ static void exit_sighandler(int x){
exit(0);
}
/**
* \return 1 on success, 0 if the function was interrupted and -1 on error
*/
int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
int ss = stream->sector_size ? stream->sector_size : STREAM_BUFFER_SIZE;
int res = -1;
cache_vars_t* s;
if (stream->flags & STREAM_NON_CACHEABLE) {
@ -313,7 +323,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
}
s=cache_init(size,ss);
if(s == NULL) return 0;
if(s == NULL) return -1;
stream->cache_data=s;
s->stream=stream; // callback
s->seek_limit=seek_limit;
@ -330,6 +340,8 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
#if !defined(__MINGW32__) && !defined(PTHREAD_CACHE) && !defined(__OS2__)
if((stream->cache_pid=fork())){
if ((pid_t)stream->cache_pid == -1)
stream->cache_pid = 0;
#else
{
stream_t* stream2=malloc(sizeof(stream_t));
@ -347,6 +359,11 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
}
#endif
#endif
if (!stream->cache_pid) {
mp_msg(MSGT_CACHE, MSGL_ERR,
"Starting cache process/thread failed: %s.\n", strerror(errno));
goto err_out;
}
// wait until cache is filled at least prefill_init %
mp_msg(MSGT_CACHE,MSGL_V,"CACHE_PRE_INIT: %"PRId64" [%"PRId64"] %"PRId64" pre:%d eof:%d \n",
(int64_t)s->min_filepos,(int64_t)s->read_filepos,(int64_t)s->max_filepos,min,s->eof);
@ -356,11 +373,17 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
(int64_t)s->max_filepos-s->read_filepos
);
if(s->eof) break; // file is smaller than prefill size
if(stream_check_interrupt(PREFILL_SLEEP_TIME))
return 0;
if(stream_check_interrupt(PREFILL_SLEEP_TIME)) {
res = 0;
goto err_out;
}
}
mp_msg(MSGT_CACHE,MSGL_STATUS,"\n");
return 1; // parent exits
err_out:
cache_uninit(stream);
return res;
}
#if defined(__MINGW32__) || defined(PTHREAD_CACHE) || defined(__OS2__)
@ -386,6 +409,8 @@ static void ThreadProc( void *s ){
#ifdef PTHREAD_CACHE
return NULL;
#endif
// make sure forked code never leaves this function
exit(0);
}
int cache_stream_fill_buffer(stream_t *s){

View File

@ -743,6 +743,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
int auth_retry=0;
int seekable=0;
char *content_type;
const char *content_length;
char *next_url;
URL_t *url = stream->streaming_ctrl->url;
@ -816,15 +817,15 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
// Assume standard http if not ICY
switch( http_hdr->status_code ) {
case 200: // OK
content_length = http_get_field(http_hdr, "Content-Length");
if (content_length) {
mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: [%s]\n", content_length);
stream->end_pos = atoll(content_length);
}
// Look if we can use the Content-Type
content_type = http_get_field( http_hdr, "Content-Type" );
if( content_type!=NULL ) {
char *content_length = NULL;
mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", content_type );
if( (content_length = http_get_field(http_hdr, "Content-Length")) != NULL) {
mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: [%s]\n", http_get_field(http_hdr, "Content-Length"));
stream->end_pos = atoi(content_length);
}
// Check in the mime type table for a demuxer type
i = 0;
while(mime_type_table[i].mime_type != NULL) {

View File

@ -435,9 +435,7 @@ stream_t* new_stream(int fd,int type){
void free_stream(stream_t *s){
// printf("\n*** free_stream() called ***\n");
#ifdef CONFIG_STREAM_CACHE
if(s->cache_pid) {
cache_uninit(s);
}
#endif
if(s->close) s->close(s);
if(s->fd>0){

View File

@ -244,7 +244,7 @@ static int FtpOpenPort(struct stream_priv_s* p) {
return fd;
}
static int FtpOpenData(stream_t* s,size_t newpos) {
static int FtpOpenData(stream_t* s,off_t newpos) {
struct stream_priv_s* p = s->priv;
int resp;
char str[256],rsp_txt[256];
@ -369,7 +369,8 @@ static void close_f(stream_t *s) {
static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
int len = 0,resp;
int resp;
int64_t len = 0;
struct stream_priv_s* p = (struct stream_priv_s*)opts;
char str[256],rsp_txt[256];
@ -438,7 +439,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
mp_msg(MSGT_OPEN,MSGL_WARN, "[ftp] command '%s' failed: %s\n",str,rsp_txt);
} else {
int dummy;
sscanf(rsp_txt,"%d %d",&dummy,&len);
sscanf(rsp_txt,"%d %"SCNd64,&dummy,&len);
}
if(len > 0) {

View File

@ -20,6 +20,7 @@
#include "subreader.h"
#include "stream/stream.h"
#include "libavutil/common.h"
#include "libavutil/avstring.h"
#ifdef CONFIG_ENCA
#include <enca.h>
@ -990,8 +991,7 @@ static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current)
if (!stream_read_line(st, directive, LINE_LEN))
return NULL;
trail_space(directive);
strncat(line2, directive,
(LINE_LEN > 511) ? LINE_LEN : 511);
av_strlcat(line2, directive, LINE_LEN);
break;
}
default:
@ -1338,7 +1338,7 @@ const char* guess_cp(stream_t *st, const char *preferred_language, const char *f
sub_data* sub_read_file (char *filename, float fps) {
stream_t* fd;
int n_max, n_first, i, j, sub_first, sub_orig;
subtitle *first, *second, *sub, *return_sub;
subtitle *first, *second, *sub, *return_sub, *alloced_sub = NULL;
sub_data *subt_data;
int uses_time = 0, sub_num = 0, sub_errs = 0;
struct subreader sr[]=
@ -1401,6 +1401,7 @@ sub_data* sub_read_file (char *filename, float fps) {
}
#ifdef CONFIG_SORTSUB
alloced_sub =
sub = malloc(sizeof(subtitle));
//This is to deal with those formats (AQT & Subrip) which define the end of a subtitle
//as the beginning of the following
@ -1429,6 +1430,7 @@ sub_data* sub_read_file (char *filename, float fps) {
subcp_close();
#endif
if ( first ) free(first);
free(alloced_sub);
return NULL;
}
// Apply any post processing that needs recoding first
@ -1481,6 +1483,7 @@ sub_data* sub_read_file (char *filename, float fps) {
#ifdef CONFIG_ICONV
subcp_close();
#endif
free(alloced_sub);
// printf ("SUB: Subtitle format %s time.\n", uses_time?"uses":"doesn't use");
mp_msg(MSGT_SUBREADER, MSGL_V,"SUB: Read %i subtitles, %i bad line(s).\n",
@ -2251,15 +2254,15 @@ void dump_sami(sub_data* subd, float fps) {
void sub_free( sub_data * subd )
{
int i;
int i, j;
if ( !subd ) return;
if (subd->subtitles) {
for (i=0; i < subd->subtitles->lines; i++) free( subd->subtitles->text[i] );
for (i = 0; i < subd->sub_num; i++)
for (j = 0; j < subd->subtitles[i].lines; j++)
free( subd->subtitles[i].text[j] );
free( subd->subtitles );
}
if (subd->filename) free( subd->filename );
free( subd->filename );
free( subd );
}

View File

@ -15,7 +15,7 @@ test $version || version=$git_revision
NEW_REVISION="#define VERSION \"${version}${extra}\""
OLD_REVISION=$(head -n 1 version.h 2> /dev/null)
TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2009 MPlayer Team\n"'
TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2010 MPlayer Team\n"'
# Update version.h only on revision changes to avoid spurious rebuilds
if test "$NEW_REVISION" != "$OLD_REVISION"; then