[MPlayer-cvslog] CVS: main/libmpcodecs ve_lavc.c,1.136,1.137
Michael Niedermayer CVS
syncmail at mplayerhq.hu
Wed Mar 22 00:06:11 CET 2006
CVS change done by Michael Niedermayer CVS
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv14425
Modified Files:
ve_lavc.c
Log Message:
lavc doesnt pass AVFrame.opaque around :/
so lets use AVFrame.pts and hope lavcs pedantic timestamp checks like what mencoder generates ...
Index: ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -r1.136 -r1.137
--- ve_lavc.c 21 Mar 2006 22:12:48 -0000 1.136
+++ ve_lavc.c 21 Mar 2006 23:06:09 -0000 1.137
@@ -4,6 +4,7 @@
#include <math.h>
#include <limits.h>
#include <time.h>
+#include <assert.h>
#if !defined(INFINITY) && defined(HUGE_VAL)
#define INFINITY HUGE_VAL
@@ -857,8 +858,15 @@
double dts;
if(pic){
+#if 0
pic->opaque= malloc(sizeof(pts));
memcpy(pic->opaque, &pts, sizeof(pts));
+#else
+ if(pts != MP_NOPTS_VALUE)
+ pic->pts= floor(pts / av_q2d(lavc_venc_context->time_base) + 0.5);
+ else
+ pic->pts= MP_NOPTS_VALUE;
+#endif
}
out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,
pic);
@@ -867,11 +875,18 @@
dts= pts - lavc_venc_context->delay * av_q2d(lavc_venc_context->time_base);
else
dts= MP_NOPTS_VALUE;
-
+#if 0
pts= lavc_venc_context->coded_frame->opaque ?
*(double*)lavc_venc_context->coded_frame->opaque
: MP_NOPTS_VALUE;
-
+#else
+ if(lavc_venc_context->coded_frame->pts != MP_NOPTS_VALUE)
+ pts= lavc_venc_context->coded_frame->pts * av_q2d(lavc_venc_context->time_base);
+ else
+ pts= MP_NOPTS_VALUE;
+ assert(MP_NOPTS_VALUE == AV_NOPTS_VALUE);
+#endif
+//fprintf(stderr, "ve_lavc %f/%f\n", dts, pts);
if(out_size == 0) {
++mux_v->encoder_delay;
return 0;
More information about the MPlayer-cvslog
mailing list