1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

LIBAVCODEC_BUILD >= 4754

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15308 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2005-04-30 22:41:41 +00:00
parent c43a428c45
commit 4cd5847495
2 changed files with 21 additions and 0 deletions

View File

@ -349,11 +349,15 @@ static int config(struct vf_instance_s* vf,
else
lavc_venc_context->bit_rate = 800000; /* default */
lavc_venc_context->bit_rate_tolerance= lavc_param_vrate_tolerance*1000;
#if LIBAVCODEC_BUILD >= 4754
lavc_venc_context->time_base= (AVRational){mux_v->h.dwScale, mux_v->h.dwRate};
#else
#if LIBAVCODEC_BUILD >= 4662
lavc_venc_context->frame_rate = mux_v->h.dwRate;
lavc_venc_context->frame_rate_base = mux_v->h.dwScale;
#else
lavc_venc_context->frame_rate = mux_v->h.dwRate*FRAME_RATE_BASE/mux_v->h.dwScale;
#endif
#endif
lavc_venc_context->qmin= lavc_param_vqmin;
lavc_venc_context->qmax= lavc_param_vqmax;

View File

@ -61,26 +61,38 @@ static int config(struct vf_instance_s* vf,
lavc_venc_context.width = width;
lavc_venc_context.height = height;
#if LIBAVCODEC_BUILD >= 4754
if(!lavc_venc_context.time_base.num){
#else
if(!lavc_venc_context.frame_rate){
#endif
// guess FPS:
switch(height){
case 240:
case 480:
#if LIBAVCODEC_BUILD >= 4754
lavc_venc_context.time_base= (AVRational){1001,30000};
#else
#if LIBAVCODEC_BUILD >= 4662
lavc_venc_context.frame_rate = 30000;
lavc_venc_context.frame_rate_base= 1001;
#else
lavc_venc_context.frame_rate=29.97*FRAME_RATE_BASE; // NTSC
#endif
#endif
break;
case 576:
case 288:
default:
#if LIBAVCODEC_BUILD >= 4754
lavc_venc_context.time_base= (AVRational){1,25};
#else
#if LIBAVCODEC_BUILD >= 4662
lavc_venc_context.frame_rate = 25;
lavc_venc_context.frame_rate_base= 1;
#else
lavc_venc_context.frame_rate=25*FRAME_RATE_BASE; // PAL
#endif
#endif
break;
// lavc_venc_context.frame_rate=vo_fps*FRAME_RATE_BASE; // same as src
@ -191,11 +203,16 @@ static int open(vf_instance_t *vf, char* args){
// fixed bitrate (in kbits)
lavc_venc_context.bit_rate = 1000*p_quality;
}
#if LIBAVCODEC_BUILD >= 4754
lavc_venc_context.time_base.num = 1000*1001;
lavc_venc_context.time_base.den = (p_fps<1.0) ? 0 : (p_fps * lavc_venc_context.time_base.num);
#else
#if LIBAVCODEC_BUILD >= 4662
lavc_venc_context.frame_rate_base = 1000*1001;
lavc_venc_context.frame_rate = (p_fps<1.0) ? 0 : (p_fps * lavc_venc_context.frame_rate_base);
#else
lavc_venc_context.frame_rate = (p_fps<1.0) ? 0 : (p_fps * FRAME_RATE_BASE);
#endif
#endif
lavc_venc_context.gop_size = 0; // I-only