summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-03-14 12:12:39 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-03-14 12:12:39 -0300
commit1c56b8f4079af9413ea15f420259e97187a3bf7a (patch)
tree42a3f1eb4a419e49badcc1ce966120f6a88a1fe1 /v4l/scripts
parente07574e1290ffc63432bc2b06a7677abc365de2d (diff)
parent0b831dcdb633365e47049c9aa5f243cce99569e5 (diff)
downloadmediapointer-dvb-s2-1c56b8f4079af9413ea15f420259e97187a3bf7a.tar.gz
mediapointer-dvb-s2-1c56b8f4079af9413ea15f420259e97187a3bf7a.tar.bz2
Snd_cx88_create: don't dereference NULL core
From: Duncan Sands <duncan.sands@math.u-psud.fr> If the call to cx88_core_get returns a NULL value, it is dereferenced by cx88_reset, and perhaps by cx88_core_put. Spotted by the Coverity checker. Signed-off-by: Duncan Sands <baldrick@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-xv4l/scripts/hghead.pl152
-rwxr-xr-xv4l/scripts/usbaudio_setup.sh106
2 files changed, 152 insertions, 106 deletions
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl
new file mode 100755
index 000000000..ddaef0767
--- /dev/null
+++ b/v4l/scripts/hghead.pl
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+use strict;
+use Date::Parse;
+
+#################################################################
+# analyse diffs
+
+my $in = shift;
+my $line;
+my $subject;
+my $from=0;
+my $sub_ok=0;
+my $init=0;
+my $num=0;
+my $maint_ok=0;
+my $noblank=1;
+my $maintainer_name=$ENV{CHANGE_LOG_NAME};
+my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS};
+my $from="";
+my $body="";
+my $signed="";
+my $fromname="";
+
+open IN, "<$in";
+
+while ($line = <IN>) {
+ if ($line =~ m/Index.*/) {
+ last;
+ }
+ if ($line =~ m/^diff .*/) {
+ last;
+ }
+ if ($line =~ m/^\-\-\- .*/) {
+ last;
+ }
+ if ($line =~ m/^\-\-\-.*/) {
+ last;
+ }
+ if ($line =~ m/^\+\+\+ .*/) {
+ last;
+ }
+
+ if ($line =~ m/^Date:\s*(.*)/) {
+ my $time = str2time($1);
+# my $timestr = gmtime($time);
+
+ if ($time) {
+ print "# Date: $time\n";
+ }
+ next;
+ }
+ if ($line =~ m/^From:/) {
+ if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) {
+ if ($1 eq "") {
+ next;
+ }
+ my $name=$1;
+ my $email=$2;
+ $name =~ s/\s+$//;
+ $email =~ s/\s+$//;
+ $fromname="$name <$email>";
+ $from= "From: $fromname\n";
+ next;
+ }
+ print "Bad: author line have a wrong syntax\n";
+ die;
+ }
+
+ if ($line =~ m/^Subject:\s*(.*\n)/) {
+ $subject=$1;
+ next;
+ }
+
+ if ($line =~ m;^ .*\/.*\| *[0-9]*;) {
+ next;
+ }
+ if ($line =~m/\d+\s*file.* changed, /) {
+ next;
+ }
+
+ if ($line =~ m/^Signed-off-by:.*/) {
+ $noblank=1;
+ if ($line =~ m/$maintainer_name/) {
+ $maint_ok=1;
+ }
+
+ $signed="$signed$line";
+ next;
+ }
+ if ($line =~ m/^Acked-by:.*/) {
+ $signed="$signed$line";
+ next;
+ }
+
+ if ($line =~ m/^[a-zA-Z\-]*:/) {
+ if ($line =~ m/Changeset:\s*(.*)\n/) {
+ $num=$1;
+ }
+ print "# $line";
+ next;
+ }
+
+ if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) {
+ $subject=$1;
+ $line="\n";
+ }
+
+ if ($sub_ok == 0) {
+ $sub_ok=1;
+ substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1));
+ if ($subject =~ m|V4L\/DVB\s*(.+)|) {
+ $subject=$1;
+ }
+ if ($line =~ m/^\n/) {
+ next;
+ }
+ }
+
+ if ($noblank) {
+ if ($line =~ m/^\n/) {
+ next;
+ }
+ }
+ if (!$init) {
+ $init=1;
+ $noblank=0;
+ }
+ $body="$body$line";
+}
+close IN;
+
+if ($from eq "") {
+ print "Bad: author doesn't exist!\n";
+ die;
+}
+
+if (!$maint_ok) {
+ $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n";
+}
+
+if (!$signed =~ m/$from/) {
+ print "Bad: Author didn't signed his patch!\n";
+ die;
+}
+
+$body=~s/\n+$//;
+$body=~s/^\n+$//;
+
+# First from is used by hg to recognize commiter name
+print "#Committer: $maintainer_name <$maintainer_email>\n";
+print "$subject\n$from\n$body\n\n$signed";
+
diff --git a/v4l/scripts/usbaudio_setup.sh b/v4l/scripts/usbaudio_setup.sh
deleted file mode 100755
index 66fdd23df..000000000
--- a/v4l/scripts/usbaudio_setup.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2006 Markus Rechberger <mrechberger@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-which /usr/bin/dialog >/dev/null
-if [ "0" != "$?" ]; then
-echo "this tool requires \"dialog\" (http://hightek.org/dialog/)"
-exit 1
-fi
-uid=`id -u`
-if [ "0" != "$uid" ]; then
-echo "this tool must be run as root, you can disable this message by editing the script but only do that unless you know what you're doing!"
-exit 1
-fi
-which gcc > /dev/null
-if [ "0" != "$?" ]; then
-echo "this tool won't work unless you install gcc"
-exit 1
-fi
-test -f ossid
-if [ "0" != "$?" ]; then
-cat > ossid.c <<_EOF
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <linux/soundcard.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-int main(int argc, char **argv){
- int fd;
- struct mixer_info *info;
- fd=open(argv[1],O_RDONLY);
- if(fd>=0){
- info=malloc(sizeof(struct mixer_info));
- ioctl(fd,SOUND_MIXER_INFO,info);
- printf("%c \"%s %s\"\n",(argv[1][strlen(argv[1])-1]=='p')?'0':(argv[1][strlen(argv[1])-1]+1),info->name,info->id);
- free(info);
- close(fd);
- } else {
- return 1;
- }
- return 0;
-}
-_EOF
-gcc ossid.c -o ossid
-rm ossid.c
-fi
-
-test -f /proc/asound/cards
-if [ "0" != "$?" ]; then
-dialog --title "Welcome" --backtitle "Empia Sound Configuration" \
---msgbox "Your system doesn't support ALSA, please have a look at \
-www.alsa-project.org and set it up properly \
-
-
-Press any key to continue... " 11 50
-exit 1;
-fi
-
-dialog --title "Welcome" --backtitle "Empia Sound Configuration" \
---msgbox "This tool was written to ease up sound configuration for
-* Terratec Hybrid XS
-* Terratec Cinergy 250 USB 2.0
-* Hauppauge HVR 900
-* and possible others :)
-
-first select an usb audio source, as target choose your soundcard
-Press any key to continue... " 13 60
-
-ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your TV Audio source:" 12 60 5 2>/tmp/em2880_source.$$
-ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your output soundcard device:" 12 60 5 2>/tmp/em2880_dst.$$
-
-source=`egrep '^[0-9p]' /tmp/em2880_source.$$`
-dst=`egrep '^[0-9p]' /tmp/em2880_dst.$$`
-
-echo "playing $source to $dst";
-if [ "$source" = "0" ]; then
- device="/dev/dsp"
-else
- device="/dev/dsp`expr $source - 1`"
-fi
-
-if [ "$dst" = "0" ]; then
- device2="/dev/dsp"
-else
- device2="/dev/dsp`expr $source - 1`"
-fi
-clear
-echo "Using command: sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2"
-sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2