[MPlayer-dev-eng] [PATCH] XviD profile support

Oded Shimon ods15 at ods15.dyndns.org
Sun Sep 18 18:54:38 CEST 2005


On Sun, Sep 18, 2005 at 05:51:33PM +0200, Guillaume POIRIER wrote:
> Hi,
> 
> On 9/18/05, Oded Shimon <ods15 at ods15.dyndns.org> wrote:
> > On Sat, Sep 17, 2005 at 11:25:41PM +0200, eviv bulgroz wrote:
> > > Guillaume POIRIER wrote:
> > >
> > > >Applied.
> > > >
> > > >
> > > >
> > > Unfortunately this patch requires a pretty recent xvid release and this
> > > isn't detected by configure and/or proper #ifdefing.
> > > This what you get when you try to compile it with latest stable
> > > xvidcore-1.0.3:
> > >
> > > cc -c -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -O4
> > > -march=athlon-4 -mtune=athlon-4 -pipe -ffast-math -fomit-frame-pointer
> > > -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I. -Inative
> > > -I.. -I../libmpdemux -I../loader    -D_GNU_SOURCE -o ve_xvid4.o ve_xvid4.c
> > > ve_xvid4.c: In function 'profileFromName':
> > > ve_xvid4.c:223: warning: initialization discards qualifiers from pointer
> > > target type
> > > ve_xvid4.c: In function 'dispatch_settings':
> > > ve_xvid4.c:806: error: 'XVID_GLOBAL_DIVX5_USERDATA' undeclared (first
> > > use in this function)
> > > ve_xvid4.c:806: error: (Each undeclared identifier is reported only once
> > 
> > To anyone who cares, I second this protest. please fix, MPlayer doesn't
> > compile...
> > 
> > ve_xvid4.c:806: error: `XVID_GLOBAL_DIVX5_USERDATA' undeclared (first use
> > in this function)
> > ve_xvid4.c:806: error: (Each undeclared identifier is reported only once
> > ve_xvid4.c:806: error: for each function it appears in.)
> > ve_xvid4.c:844: error: structure has no member named `vbv_size'
> > ve_xvid4.c:845: error: structure has no member named `vbv_initial'
> 
> Would the attached patch fix the problem? Does it seems acceptable
> (though it would required the man page entry about profiles to be
> modified to tell that profiles are only fully supported with xvid
> 1.1.x) ?
> 
> If it doesn't work, please post the errors that you get with it...

Wow, watch your step! this patch is wrong!

>  	/* dxn: always write divx5 userdata */
>  	if(selected_profile->flags & PROFILE_DXN)
> +#if XVID_API >= XVID_MAKE_API(4,1)
>  		create->global |= XVID_GLOBAL_DIVX5_USERDATA;
> +#endif

The "if" is not in the ifdef! Making it apply to the NEXT, totally 
unrelated command!
Fix this and please commit the patch. ok, whatever, here's a patch.
(this isn't my code, i'm not committing)

- ods15
-------------- next part --------------
Index: libmpcodecs/ve_xvid4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid4.c,v
retrieving revision 1.18
diff -u -r1.18 ve_xvid4.c
--- libmpcodecs/ve_xvid4.c	13 Sep 2005 21:04:44 -0000	1.18
+++ libmpcodecs/ve_xvid4.c	18 Sep 2005 16:54:05 -0000
@@ -801,9 +801,11 @@
 	else
 		create->max_bframes = 0;
 
+#if XVID_API >= XVID_MAKE_API(4,1)
 	/* dxn: always write divx5 userdata */
 	if(selected_profile->flags & PROFILE_DXN)
 		create->global |= XVID_GLOBAL_DIVX5_USERDATA;
+#endif
 	
 	create->max_key_interval = xvidenc_max_key_interval;
 	create->frame_drop_ratio = xvidenc_frame_drop_ratio;
@@ -841,10 +843,12 @@
 
 	/* VBV */
 
+#if XVID_API >= XVID_MAKE_API(4,1)
 	pass2->vbv_size = selected_profile->max_vbv_size;
 	pass2->vbv_initial = (selected_profile->max_vbv_size*3)>>2; /* 75% */
 	pass2->vbv_maxrate = selected_profile->max_bitrate;
 	pass2->vbv_peakrate = selected_profile->vbv_peakrate*3;
+#endif
 // XXX: xvidcore currently provides a "peak bits over 3 seconds" constraint.
 // according to the latest dxn literature, a 1 second constraint is now used
 


More information about the MPlayer-dev-eng mailing list