Remove cast, now tables are signed.
[ffmpeg.git] / vhook / ppm.c
index 4b3a17f..0e37ac4 100644 (file)
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <ctype.h>
-#include "framehook.h"
-#include "avformat.h"
-#include "swscale.h"
+#include "libavutil/avstring.h"
+#include "libavformat/framehook.h"
+#include "libavformat/avformat.h"
+#include "libswscale/swscale.h"
+#undef fprintf
 
 static int sws_flags = SWS_BICUBIC;
 
@@ -68,8 +70,8 @@ static rwpipe *rwpipe_open( int argc, char *argv[] )
             strcpy( command, "" );
             for ( i = 0; i < argc; i ++ )
             {
-                pstrcat( command, COMMAND_SIZE, argv[ i ] );
-                pstrcat( command, COMMAND_SIZE, " " );
+                av_strlcat( command, argv[ i ], COMMAND_SIZE );
+                av_strlcat( command, " ", COMMAND_SIZE );
             }
 
             dup2( output[ 0 ], STDIN_FILENO );
@@ -210,7 +212,7 @@ int Configure(void **ctxp, int argc, char *argv[])
     if ( argc > 1 )
     {
         *ctxp = av_mallocz(sizeof(ContextInfo));
-        if ( ctxp != NULL && argc > 1 )
+        if ( *ctxp != NULL && argc > 1 )
         {
             ContextInfo *info = (ContextInfo *)*ctxp;
             info->rw = rwpipe_open( argc - 1, &argv[ 1 ] );
@@ -266,7 +268,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
             if (ci->toRGB_convert_ctx == NULL) {
                 av_log(NULL, AV_LOG_ERROR,
                        "Cannot initialize the toRGB conversion context\n");
-                exit(1);
+                return;
             }
 
 // img_convert parameters are          2 first destination, then 4 source
@@ -335,7 +337,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
         if (ci->fromRGB_convert_ctx == NULL) {
             av_log(NULL, AV_LOG_ERROR,
                    "Cannot initialize the fromRGB conversion context\n");
-            exit(1);
+            return;
         }
 
 // img_convert parameters are          2 first destination, then 4 source