[Ffmpeg-cvslog] CVS: ffmpeg/vhook watermark.c,1.4,1.5

Diego Biurrun CVS diego
Wed Oct 26 22:17:00 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/vhook
In directory mail:/var2/tmp/cvs-serv28523

Modified Files:
	watermark.c 
Log Message:
FreeBSD support as well as some assorted fixes
patch by the author, Marcus Engene < ffmpeg __ at __ engene __ dot __ se >


Index: watermark.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/vhook/watermark.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- watermark.c	18 Jul 2005 16:43:14 -0000	1.4
+++ watermark.c	26 Oct 2005 20:16:57 -0000	1.5
@@ -99,7 +99,7 @@
     if (0 == (*ctxp = av_mallocz(sizeof(ContextInfo)))) return -1;
     ci = (ContextInfo *) *ctxp;
 
-    optind = 0;
+    optind = 1;
     
     // Struct is mallocz:ed so no need to reset.
         
@@ -110,18 +110,19 @@
                 ci->filename[1999] = 0;
                 break;
             default:
-                av_log(NULL, AV_LOG_DEBUG, "Unrecognized argument '%s'\n", argv[optind]);
+                av_log(NULL, AV_LOG_ERROR, "Watermark: Unrecognized argument '%s'\n", argv[optind]);
                 return -1;
         }
     }
     
     //
-    if (0 == ci->filename[0]) return -1;
+    if (0 == ci->filename[0]) {
+        av_log(NULL, AV_LOG_ERROR, "Watermark: There is no filename specified.\n");
+        return -1;
+    }
         
     av_register_all();
     return get_watermark_picture(ci, 0);
-
-    return 0;
 }
 
 
@@ -268,7 +269,7 @@
             // NULL instead of file_iformat to av_open_input_file()
             ci->i = strlen(ci->filename);
             if (0 == ci->i) {
-                av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() No filename to watermark vhook\n");
+                av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() No filename to watermark vhook\n");
                 return -1;
             }
             while (ci->i > 0) {
@@ -281,13 +282,13 @@
                ci->p_ext = &(ci->filename[ci->i]);
             ci->file_iformat = av_find_input_format (ci->p_ext);
             if (0 == ci->file_iformat) {
-                av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Really failed to find iformat [%s]\n", ci->p_ext);
+                av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Really failed to find iformat [%s]\n", ci->p_ext);
                 return -1;
             }
             // now continues the Martin template.    
             
             if (av_open_input_file(&ci->pFormatCtx, ci->filename, ci->file_iformat, 0, NULL)!=0) {
-                av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to open input file [%s]\n", ci->filename);
+                av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to open input file [%s]\n", ci->filename);
                 return -1;
             }            
         }
@@ -296,7 +297,7 @@
          * This fills the streams field of the AVFormatContext with valid information.
          */
         if(av_find_stream_info(ci->pFormatCtx)<0) {
-            av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to find stream info\n");
+            av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find stream info\n");
             return -1;
         }
     
@@ -313,7 +314,7 @@
                 break;
             }
         if(ci->videoStream == -1) {
-            av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to find any video stream\n");
+            av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find any video stream\n");
             return -1;
         }
         
@@ -332,7 +333,7 @@
         // Find the decoder for the video stream
         ci->pCodec = avcodec_find_decoder(ci->pCodecCtx->codec_id);
         if(ci->pCodec == NULL) {
-            av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to find any codec\n");
+            av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find any codec\n");
             return -1;
         }
         
@@ -343,7 +344,7 @@
         
         // Open codec
         if(avcodec_open(ci->pCodecCtx, ci->pCodec)<0) {
-            av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to open codec\n");
+            av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to open codec\n");
             return -1;
         }
         
@@ -364,7 +365,7 @@
         // Allocate an AVFrame structure
         ci->pFrameRGB=avcodec_alloc_frame();
         if(ci->pFrameRGB==NULL) {
-            av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Failed to alloc pFrameRGB\n");
+            av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to alloc pFrameRGB\n");
             return -1;
         }
         





More information about the ffmpeg-cvslog mailing list