Package: alevt Version: 1:1.6.1-9 Severity: wishlist Tags: patch hi
i have adapted your 40_vbi_name so that all default devices (/dev/vbi, /dev/vbi0, /dev/video0) are tried for all programs in the package (alevt, alevt-cap, alevt-date). yours albert -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.22.6 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages alevt depends on: ii libc6 2.6.1-1+b1 GNU C Library: Shared libraries ii libpng12-0 1.2.15~beta5-2 PNG library - runtime ii libx11-6 2:1.0.3-7 X11 client-side library ii makedev 2.3.1-83 creates device files in /dev ii udev 0.114-2 /dev/ and hotplug management daemo ii zlib1g 1:1.2.3.3.dfsg-5 compression library - runtime alevt recommends no packages. -- no debconf information
diff -urNad alevt-1.6.1~/alevt.1x.in alevt-1.6.1/alevt.1x.in --- alevt-1.6.1~/alevt.1x.in 2007-09-02 13:30:39.823874308 +0200 +++ alevt-1.6.1/alevt.1x.in 2007-09-02 13:18:27.311383310 +0200 @@ -23,7 +23,7 @@ Specifies the size and position of the windows. Default: 40x25. .TP .BI \-vbi \ device -Use the given device name. Default: /dev/vbi. +Use the given device name. Default: /dev/vbi, /dev/vbi0, /dev/video0, tried in this order. .TP .BI \-finetune \ \-4..4\||auto Try some fine tuning if you have a lot of decoding errors (these diff -urNad alevt-1.6.1~/alevt-cap.1.in alevt-1.6.1/alevt-cap.1.in --- alevt-1.6.1~/alevt-cap.1.in 2007-09-02 13:30:39.823874308 +0200 +++ alevt-1.6.1/alevt-cap.1.in 2007-09-02 13:32:55.824782352 +0200 @@ -31,7 +31,7 @@ Lists all known file formats and their options. .TP .BI \-vbi \ device -Use the given device name (default: /dev/vbi). +Use the given device name. Default: /dev/vbi, /dev/vbi0, /dev/video0, tried in this order. .TP .\" .B \-oldbttv .\" Use this option for bttv driver version older than 0.5.20 diff -urNad alevt-1.6.1~/alevt-cap.c alevt-1.6.1/alevt-cap.c --- alevt-1.6.1~/alevt-cap.c 2007-09-02 13:30:39.823874308 +0200 +++ alevt-1.6.1/alevt-cap.c 2007-09-02 13:35:16.325802111 +0200 @@ -191,7 +191,7 @@ int main(int argc, char **argv) { - char *vbi_name = "/dev/vbi"; + char *vbi_name = NULL; int fine_tune = 1; // auto = 999; int newbttv = -1; int timeout = 0; diff -urNad alevt-1.6.1~/alevt-date.1.in alevt-1.6.1/alevt-date.1.in --- alevt-1.6.1~/alevt-date.1.in 2000-05-09 21:01:21.000000000 +0200 +++ alevt-1.6.1/alevt-date.1.in 2007-09-02 13:32:55.824782352 +0200 @@ -34,7 +34,7 @@ for possible control sequences. .TP .BI \-vbi \ device -Use the given device name (default: /dev/vbi). +Use the given device name. Default: /dev/vbi, /dev/vbi0, /dev/video0, tried in this order. .TP .BI \-timeout \ seconds If the time can't be detected in diff -urNad alevt-1.6.1~/alevt-date.c alevt-1.6.1/alevt-date.c --- alevt-1.6.1~/alevt-date.c 2001-07-22 03:17:05.000000000 +0200 +++ alevt-1.6.1/alevt-date.c 2007-09-02 13:35:21.325839862 +0200 @@ -165,7 +165,7 @@ int main(int argc, char **argv) { - char *vbi_name = "/dev/vbi"; + char *vbi_name = NULL; int timeout = 0; int big_buf = -1; struct vbi *vbi; diff -urNad alevt-1.6.1~/debian/patched/40_vbi_name.dpatch alevt-1.6.1/debian/patched/40_vbi_name.dpatch --- alevt-1.6.1~/debian/patched/40_vbi_name.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ alevt-1.6.1/debian/patched/40_vbi_name.dpatch 2007-09-02 13:18:27.311383310 +0200 @@ -0,0 +1,2 @@ +patching file alevt.1x.in +patching file main.c diff -urNad alevt-1.6.1~/main.c alevt-1.6.1/main.c --- alevt-1.6.1~/main.c 2007-09-02 13:30:39.823874308 +0200 +++ alevt-1.6.1/main.c 2007-09-02 13:33:46.825143207 +0200 @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include "vt.h" #include "misc.h" @@ -15,7 +16,7 @@ /* current args for next start() */ static char *geometry; static char *dpy_name; -static char *vbi_name = "/dev/vbi"; +static char *vbi_name = NULL; static struct xio *xio; static struct vbi *vbi; static int fine_tune = 1; // auto = 999; @@ -85,9 +86,9 @@ start(int argc, char **argv, struct vtwin *parent, int pgno, int subno) { if (vbi == 0) - vbi = vbi_open(vbi_name, cache_open(), fine_tune, newbttv); + vbi = vbi_open(vbi_name, cache_open(), fine_tune, newbttv); if (vbi == 0) - fatal("cannot open %s", vbi_name); + fatal("cannot open %s", vbi_name); if (vbi->cache) vbi->cache->op->mode(vbi->cache, CACHE_MODE_ERC, erc); diff -urNad alevt-1.6.1~/vbi.c alevt-1.6.1/vbi.c --- alevt-1.6.1~/vbi.c 2007-09-02 13:30:39.823874308 +0200 +++ alevt-1.6.1/vbi.c 2007-09-02 13:41:44.830338376 +0200 @@ -16,6 +16,7 @@ static u8 *rawbuf; // one common buffer for raw vbi data. static int rawbuf_size; // its current size +static char *vbi_names[] = { "/dev/vbi", "/dev/vbi0", "/dev/video0", NULL }; // default device names if none was given at the command line /***** bttv api *****/ @@ -585,6 +586,23 @@ static int inited = 0; struct vbi *vbi; + if (vbi_name == NULL) + { + int i; + for (i = 0; vbi_names[i] != NULL; i++) + { + vbi_name = vbi_names[i]; + if (access(vbi_name, R_OK) != 0) + continue; + vbi = vbi_open(vbi_name, ca, fine_tune, big_buf); + if (vbi != NULL) + return vbi; + } + + fatal("coult not open any of the standard devices"); + return NULL; + } + if (not inited) lang_init(); inited = 1;
signature.asc
Description: Digital signature