[Ffmpeg-cvslog] r6222 - trunk/vhook/drawtext.c
diego
subversion
Sun Sep 10 19:54:14 CEST 2006
Author: diego
Date: Sun Sep 10 19:54:14 2006
New Revision: 6222
Modified:
trunk/vhook/drawtext.c
Log:
fprintf/perror --> av_log
patch by Gustavo Sverzut Barbieri, barbieri gmail com
Modified: trunk/vhook/drawtext.c
==============================================================================
--- trunk/vhook/drawtext.c (original)
+++ trunk/vhook/drawtext.c Sun Sep 10 19:54:14 2006
@@ -190,14 +190,14 @@
case 'c':
if (ParseColor(optarg, ci->fgcolor) == -1)
{
- fprintf(stderr, "ERROR: Invalid foreground color: '%s'. You must specify the color in the internet way(packaged hex): #RRGGBB, ie: -c #ffffff (for white foreground)\n",optarg);
+ av_log(NULL, AV_LOG_ERROR, "Invalid foreground color: '%s'. You must specify the color in the internet way(packaged hex): #RRGGBB, ie: -c #ffffff (for white foreground)\n", optarg);
return -1;
}
break;
case 'C':
if (ParseColor(optarg, ci->bgcolor) == -1)
{
- fprintf(stderr, "ERROR: Invalid foreground color: '%s'. You must specify the color in the internet way(packaged hex): #RRGGBB, ie: -c #ffffff (for white foreground)\n",optarg);
+ av_log(NULL, AV_LOG_ERROR, "Invalid foreground color: '%s'. You must specify the color in the internet way(packaged hex): #RRGGBB, ie: -c #ffffff (for white foreground)\n", optarg);
return -1;
}
break;
@@ -208,14 +208,14 @@
ci->outline=1;
break;
case '?':
- fprintf(stderr, "ERROR: Unrecognized argument '%s'\n", argv[optind]);
+ av_log(NULL, AV_LOG_ERROR, "Unrecognized argument '%s'\n", argv[optind]);
return -1;
}
}
if (!ci->text)
{
- fprintf(stderr,"ERROR: No text provided (-t text)\n");
+ av_log(NULL, AV_LOG_ERROR, "No text provided (-t text)\n");
return -1;
}
@@ -224,7 +224,7 @@
FILE *fp;
if ((fp=fopen(ci->file, "r")) == NULL)
{
- perror("WARNING: the file could not be opened. Using text provided with -t switch. ");
+ av_log(NULL, AV_LOG_INFO, "WARNING: The file could not be opened. Using text provided with -t switch: %s", strerror(errno));
}
else
{
@@ -234,25 +234,25 @@
if (!font)
{
- fprintf(stderr,"ERROR: No font file provided! (-f filename)\n");
+ av_log(NULL, AV_LOG_ERROR, "No font file provided! (-f filename)\n");
return -1;
}
if ((error = FT_Init_FreeType(&(ci->library))) != 0)
{
- fprintf(stderr,"ERROR: Could not load FreeType (error# %d)\n",error);
+ av_log(NULL, AV_LOG_ERROR, "Could not load FreeType (error# %d).\n", error);
return -1;
}
if ((error = FT_New_Face( ci->library, font, 0, &(ci->face) )) != 0)
{
- fprintf(stderr,"ERROR: Could not load face: %s (error# %d)\n",font, error);
+ av_log(NULL, AV_LOG_ERROR, "Could not load face: %s (error# %d).\n", font, error);
return -1;
}
if ((error = FT_Set_Pixel_Sizes( ci->face, 0, size)) != 0)
{
- fprintf(stderr,"ERROR: Could not set font size to %d pixels (error# %d)\n",size, error);
+ av_log(NULL, AV_LOG_ERROR, "Could not set font size to %d pixels (error# %d).\n", size, error);
return -1;
}
@@ -400,7 +400,7 @@
if (fd < 0)
{
text = ci->text;
- perror("WARNING: the file could not be opened. Using text provided with -t switch. ");
+ av_log(NULL, AV_LOG_INFO, "WARNING: The file could not be opened. Using text provided with -t switch: %s", strerror(errno));
}
else
{
@@ -414,7 +414,7 @@
else
{
text = ci->text;
- perror("WARNING: the file could not be opened. Using text provided with -t switch. ");
+ av_log(NULL, AV_LOG_INFO, "WARNING: The file could not be read. Using text provided with -t switch: %s", strerror(errno));
}
close(fd);
}
More information about the ffmpeg-cvslog
mailing list