1
mirror of https://github.com/mpv-player/mpv synced 2024-11-07 01:47:00 +01:00

soem fixes

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5552 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-04-11 02:50:47 +00:00
parent 4d865e3f47
commit 24a5801132
4 changed files with 20 additions and 4 deletions

View File

@ -72,6 +72,13 @@ static int config(struct vf_instance_s* vf,
else if(divx4_param.bitrate<=16000) divx4_param.bitrate*=1000;
if(!divx4_param.quality) divx4_param.quality=5; // the quality of compression ( 1 - fastest, 5 - best )
// set some usefull defaults:
if(!divx4_param.min_quantizer) divx4_param.min_quantizer=2;
if(!divx4_param.max_quantizer) divx4_param.max_quantizer=31;
if(!divx4_param.rc_period) divx4_param.rc_period=2000;
if(!divx4_param.rc_reaction_period) divx4_param.rc_reaction_period=10;
if(!divx4_param.rc_reaction_ratio) divx4_param.rc_reaction_ratio=20;
divx4_param.handle=NULL;
encore(NULL,ENC_OPT_INIT,&divx4_param,NULL);
vf->priv->enc_handle=divx4_param.handle;
@ -157,7 +164,7 @@ static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){
enc_result.quantizer);
}
}
mencoder_write_frame(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
mencoder_write_chunk(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
}
//===========================================================================//

View File

@ -225,9 +225,14 @@ static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){
mencoder_write_chunk(mux_v,out_size,lavc_venc_context.key_frame?0x10:0);
}
static void uninit(struct vf_instance_s* vf){
avcodec_close(&lavc_venc_context);
}
//===========================================================================//
static int vf_open(vf_instance_t *vf, char* args){
vf->uninit=uninit;
vf->config=config;
vf->control=control;
vf->query_format=query_format;

View File

@ -66,6 +66,7 @@ static int vf_open(vf_instance_t *vf, char* args){
mux_v->bih->biHeight=0;
mux_v->bih->biCompression=0;
mux_v->bih->biPlanes=1;
mux_v->bih->biBitCount=24;
return 1;
}

View File

@ -37,9 +37,12 @@ static int config(struct vf_instance_s* vf,
vfw_bih->biWidth=width;
vfw_bih->biHeight=height;
vfw_bih->biSizeImage=width*height*((vfw_bih->biBitCount+7)/8);
mux_v->bih->biWidth=width;
mux_v->bih->biHeight=height;
mux_v->bih->biSizeImage=width*height*((mux_v->bih->biBitCount+7)/8);
if(!vfw_start_encoder(vfw_bih, mux_v->bih)) return 0;
// mux_v->bih->biWidth=width;
// mux_v->bih->biHeight=height;
// mux_v->bih->biSizeImage=width*height*((mux_v->bih->biBitCount+7)/8);
return 1;
}