[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-video
Subject:    PATCH : xawtv/snap and VIDEO_GRAY
From:       "Philippe De Muyter" <phdm () macqel ! be>
Date:       2004-09-29 7:17:13
Message-ID: 200409290717.i8T7HDN05485 () mail ! macqel ! be
[Download RAW message or body]

Hello,

Here is a small patch for xawtv (-3.94) that fixes the snap command handler
when only VIDEO_GRAY format is available.  Without the fix, xawtv crashes;
with the fix, xawtv produces the expected image files.

Philippe

Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077

--- common/commands.c.orig	2004-09-27 10:58:42.000000000 +0200
+++ common/commands.c	2004-09-27 10:58:47.000000000 +0200
@@ -1075,13 +1075,13 @@
     sprintf(tmpfilename,"%s.$$$",filename);
 
     if (jpeg) {
-	if (-1 == write_jpeg(tmpfilename, buf, ng_jpeg_quality, 0)) {
+	if (-1 == write_jpeg(tmpfilename, buf, ng_jpeg_quality, fmt.fmtid == VIDEO_GRAY)) {
 	    sprintf(message,"open %s: %s\n",tmpfilename,strerror(errno));
 	} else {
 	    sprintf(message,"saved jpeg: %s",filename);
 	}
     } else {
-	if (-1 == write_ppm(tmpfilename, buf)) {
+	if (-1 == (fmt.fmtid == VIDEO_GRAY ? write_pgm : write_ppm)(tmpfilename, buf)) {
 	    sprintf(message,"open %s: %s\n",tmpfilename,strerror(errno));
 	} else {
 	    sprintf(message,"saved ppm: %s",filename);

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic