summaryrefslogtreecommitdiff
path: root/multimedia/fxtv/patches/patch-ai
blob: 95feb908c0b46ff3fe94974038eff9b7835a5656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
$NetBSD: patch-ai,v 1.2 2011/07/05 03:27:22 dholland Exp $

Support png.
Fix LP64 problems.

--- batch_mode.c.orig	1999-10-23 13:50:35.000000000 +0000
+++ batch_mode.c
@@ -154,6 +154,8 @@ static void DoStreamVideo( TV_BATCH_PARM
 
     if ( STREQ( parm->frame_fmt, "TIFF" ) )
         fmt = TV_STILL_FMT_TIFF;
+    else if ( STREQ( parm->frame_fmt, "PNG" ) )
+        fmt = TV_STILL_FMT_PNG;
     else if ( STREQ( parm->frame_fmt, "PPM" ) )
         fmt = TV_STILL_FMT_PPM;
     else if ( STREQ( parm->frame_fmt, "YUV" ) )
@@ -175,6 +177,7 @@ static void DoStreamVideo( TV_BATCH_PARM
     if ( parm->video_target && !video2stdout )
         switch ( fmt ) {
             case TV_STILL_FMT_TIFF : frame_ext = "tif";  break;
+            case TV_STILL_FMT_PNG  : frame_ext = "png";  break;
             case TV_STILL_FMT_PPM  : frame_ext = "ppm";  break;
             case TV_STILL_FMT_YUV  : frame_ext = "yuv";  break;
             default: abort();
@@ -187,7 +190,7 @@ static void DoStreamVideo( TV_BATCH_PARM
     }
 
     /*  Prepare the audio output filedesc  */
-    if ( parm->audio_target )
+    if ( parm->audio_target ) {
         if ( audio2stdout )
             aud_fd = 1;
         else
@@ -197,6 +200,7 @@ static void DoStreamVideo( TV_BATCH_PARM
                          parm->audio_target );
                 exit(1);
             }
+    }
 
     /*  Read header  */
     if ( !TVRAWVIDEOHeaderRead( rf, &img, &snd, &eof ) ) {
@@ -209,7 +213,8 @@ static void DoStreamVideo( TV_BATCH_PARM
         return;
 
     /*  Sanity check raw data with save type  */
-    if ( ((( fmt == TV_STILL_FMT_TIFF ) || ( fmt == TV_STILL_FMT_PPM )) &&
+    if ( ((( fmt == TV_STILL_FMT_TIFF ) || ( fmt == TV_STILL_FMT_PNG )
+	   || ( fmt == TV_STILL_FMT_PPM )) &&
           ( img.pix_geom.type != TV_PIXELTYPE_RGB )) ||
          (( fmt == TV_STILL_FMT_YUV ) &&
           ( img.pix_geom.type != TV_PIXELTYPE_YUV )) ) {
@@ -288,7 +293,7 @@ static void DoStreamVideo( TV_BATCH_PARM
                 else {
                     char suffix[80];
 
-                    sprintf( suffix, ".%.5ld.%s", frame_no++, frame_ext );
+                    sprintf( suffix, ".%.5d.%s", frame_no++, frame_ext );
 
                     sprintf( img_fname, parm->video_target, suffix );
                     if ( i == 0 ) {