changeset 15307:58bd9c33864c

LIBAVCODEC_BUILD >= 4754
author michael
date Sat, 30 Apr 2005 22:41:41 +0000
parents b8b54923acac
children e9865b828a89
files libmpcodecs/ve_lavc.c libmpcodecs/vf_lavc.c
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_lavc.c	Sat Apr 30 21:28:14 2005 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Apr 30 22:41:41 2005 +0000
@@ -349,12 +349,16 @@
     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;
 #if LIBAVCODEC_BUILD >= 4646
--- a/libmpcodecs/vf_lavc.c	Sat Apr 30 21:28:14 2005 +0000
+++ b/libmpcodecs/vf_lavc.c	Sat Apr 30 22:41:41 2005 +0000
@@ -61,27 +61,39 @@
     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,12 +203,17 @@
 	// 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
 
     return 1;