[MPlayer-dev-eng] vo_aa correction for Linux

Jan Engelhardt jengelh at medozas.de
Wed Jun 17 01:12:12 CEST 2009


On Tuesday 2009-06-16 23:12, Diego Biurrun wrote:
>On Tue, Jun 16, 2009 at 02:23:39AM +0200, Jan Engelhardt wrote:
>> 
>> -vo aa always fails to open the vcsa device because vo_aa tries to open 
>> the device by a name not present.
>> 
>> Ref: vanilla kernel, /drivers/char/vc_screen.c.
>> See attached patch for fix.
>> Ref: {src_linux}/drivers/char/vc_screen.c.
>> The devices nodes are not padded with zeroes.
>> 
>> --- libvo/vo_aa.c	(revision 29365)
>> +++ libvo/vo_aa.c	(working copy)
>> @@ -687,7 +687,7 @@
>>  	major = sbuf.st_rdev >> 8;
>>  	vt = minor = sbuf.st_rdev & 0xff;
>>  	close (fd);
>> -	sprintf (fname, "/dev/vcsa%2.2i", vt);
>> +	sprintf (fname, "/dev/vcsa%u", vt);
>
>vt is int, not unsigned, so I guess this should be %i.

Yes, you are right. However, negative vt values do not make much sense.
st_rdev is also (usually, behind its implementation) unsigned yet the
code converts/reinterprets it into an int when stored into 'vt'.
I guess 'vt' should be made unsigned unless -1 is used as a special
value somewhere.
ISTR %i is deprecated in favor of %d.




More information about the MPlayer-dev-eng mailing list