[MPlayer-dev-eng] [PATCH] Make aa video output a bit more workable
Clément Bœsch
ubitux at gmail.com
Mon Mar 7 10:32:23 CET 2011
On Mon, Mar 07, 2011 at 10:48:30AM +0200, Alessio Ababilov wrote:
> The old test method for "linux" aa driver checks file named like
> /dev/vcsa01. Now udev names such files like /dev/vsca1. The problem is
> fixed by checking both /dev/vsca1 and /dev/vcsa01. The old method of
> checking if the file is writable uses fopen(fname, "w+"). It causes
> /dev/vcsaXX to be created if it doesn't presents and the user can write
> to /dev. The new method is to use open(fname, O_WRONLY).
I don't really see the point of replacing fopen with open, but I don't
really care.
> [...]
> diff -Naur mplayer-a/libvo/vo_aa.c mplayer-b/libvo/vo_aa.c
> --- mplayer-a/libvo/vo_aa.c 2010-11-14 15:46:13.000000000 +0200
> +++ mplayer-b/libvo/vo_aa.c 2011-03-07 10:40:02.000000000 +0200
> [...]
> @@ -686,15 +687,21 @@
> major = sbuf.st_rdev >> 8;
> vt = minor = sbuf.st_rdev & 0xff;
> close (fd);
> - sprintf (fname, "/dev/vcsa%2.2i", vt);
> - fp = fopen (fname, "w+");
> - if (fp==NULL){
> + sprintf(fname, "/dev/vcsa%d", vt);
> + fd = open(fname, O_WRONLY);
> + if (fd == -1) {
> + sprintf(fname, "/dev/vcsa%2.2i", vt);
> + fd = open(fname, O_WRONLY);
> + }
> + if (fd == -1) {
> fprintf(stderr,"VO: [aa] cannot open %s for writing,"
> "so we'll not use linux driver\n", fname);
It would be much more sexy to have a list of format to test, and try to
open them in a loop so we could display this message for each tested
device and easily add more potential "new" devices to test. But well, I
don't want to block the patch, that can be done later.
> diff -Naur mplayer-b/libvo/vo_aa.c mplayer-c/libvo/vo_aa.c
> --- mplayer-b/libvo/vo_aa.c 2011-03-07 10:40:02.000000000 +0200
> +++ mplayer-c/libvo/vo_aa.c 2011-03-07 10:37:25.000000000 +0200
> @@ -678,6 +678,9 @@
>
> /* initializing of aalib */
>
> + if (monitor_pixel_aspect == 1.0) {
> + monitor_pixel_aspect = 0.5;
> + }
nit: extra braces. But I don't care either :)
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110307/e40bf9e6/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list