avcodec/dvbsubdec: Replace fprintf(stderr) by av_log()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-04-03 22:18:14 +02:00
parent c901ae9440
commit b02027c79d
1 changed files with 4 additions and 4 deletions

View File

@ -1332,7 +1332,7 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx,
#ifdef DEBUG #ifdef DEBUG
static void png_save(const char *filename, uint32_t *bitmap, int w, int h) static void png_save(DVBSubContext *ctx, const char *filename, uint32_t *bitmap, int w, int h)
{ {
int x, y, v; int x, y, v;
FILE *f; FILE *f;
@ -1382,13 +1382,13 @@ static void png_save(const char *filename, uint32_t *bitmap, int w, int h)
snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename); snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
if (system(command) != 0) { if (system(command) != 0) {
fprintf(stderr, "Error running pnmtopng\n"); av_log(ctx, AV_LOG_ERROR, "Error running pnmtopng\n");
return; return;
} }
snprintf(command, sizeof(command), "rm %s %s", fname, fname2); snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
if (system(command) != 0) { if (system(command) != 0) {
fprintf(stderr, "Error removing %s and %s\n", fname, fname2); av_log(ctx, AV_LOG_ERROR, "Error removing %s and %s\n", fname, fname2);
return; return;
} }
} }
@ -1486,7 +1486,7 @@ static int save_display_set(DVBSubContext *ctx)
snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index); snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
png_save(filename, pbuf, width, height); png_save(ctx, filename, pbuf, width, height);
av_freep(&pbuf); av_freep(&pbuf);
} }