summaryrefslogtreecommitdiff
path: root/vhook
diff options
context:
space:
mode:
authorPatrik Kullman <patrik@yes.nu>2009-02-21 20:35:58 +0000
committerDiego Biurrun <diego@biurrun.de>2009-02-21 20:35:58 +0000
commit1bbeb06a36ec36ce03e1c882c8e97efdc13c9a9b (patch)
tree909a2ca89a4636a09535f385086b989b2d0b2472 /vhook
parent0a036d073e846e5a4881464ea3dff1c8d2793f90 (diff)
Use av_strdup to allocate string, prevents the warning:
vhook/fish.c:130: warning: assignment discards qualifiers from pointer target type patch by Patrik Kullman, patrik yes nu Originally committed as revision 17494 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'vhook')
-rw-r--r--vhook/fish.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vhook/fish.c b/vhook/fish.c
index bd05b987b4..3806df32eb 100644
--- a/vhook/fish.c
+++ b/vhook/fish.c
@@ -127,7 +127,7 @@ int Configure(void **ctxp, int argc, char *argv[])
optind = 1;
- ci->dir = "/tmp";
+ ci->dir = av_strdup("/tmp");
ci->threshold = 100;
ci->file_limit = 100;
ci->min_interval = 1000000;
@@ -368,7 +368,8 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
f = fopen(fname, "w");
if (f) {
fprintf(f, "P6 %d %d 255\n", width, height);
- fwrite(buf, width * height * 3, 1, f);
+ if (!fwrite(buf, width * height * 3, 1, f))
+ av_log(ctx, AV_LOG_ERROR, "Couldn't write to PPM file %s\n", fname);
fclose(f);
}