Fix all -Wformat warnings raised by DJGPP

This commit is contained in:
Clément Bœsch 2017-03-27 21:31:46 +02:00
parent 1473afac5d
commit 549045254c
56 changed files with 118 additions and 101 deletions

View File

@ -98,7 +98,6 @@ Stuff that didn't reach the codebase:
- Removal of the custom atomic API (5cc0057f49, see http://ffmpeg.org/pipermail/ffmpeg-devel/2017-March/209003.html)
- Use the new bitstream filter for extracting extradata (see 8e2ea69135 and 096a8effa3)
- ADD_RES_MMX_4_8 in libavcodec/x86/hevc_add_res.asm probably needs updating (see 589880710)
- ISO printf warnings raised by DJGPP (c454dfcff9, currently under review: http://ffmpeg.org/pipermail/ffmpeg-devel/2017-March/209239.html)
Collateral damage that needs work locally:
------------------------------------------

View File

@ -2509,7 +2509,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output,
1000, AV_TIME_BASE);
if (end < ist->prev_sub.subtitle.end_display_time) {
av_log(ist->dec_ctx, AV_LOG_DEBUG,
"Subtitle duration reduced from %d to %d%s\n",
"Subtitle duration reduced from %"PRId32" to %d%s\n",
ist->prev_sub.subtitle.end_display_time, end,
end <= 0 ? ", dropping it" : "");
ist->prev_sub.subtitle.end_display_time = end;

View File

@ -2383,7 +2383,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
/* print AVI/FourCC tag */
print_str("codec_tag_string", av_fourcc2str(par->codec_tag));
print_fmt("codec_tag", "0x%04x", par->codec_tag);
print_fmt("codec_tag", "0x%04"PRIx32, par->codec_tag);
switch (par->codec_type) {
case AVMEDIA_TYPE_VIDEO:

View File

@ -1500,7 +1500,7 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
tmp_32 = ff_mlz_decompression(ctx->mlz, gb, nchars, larray);
if(tmp_32 != nchars) {
av_log(ctx->avctx, AV_LOG_ERROR, "Error in MLZ decompression (%d, %d).\n", tmp_32, nchars);
av_log(ctx->avctx, AV_LOG_ERROR, "Error in MLZ decompression (%"PRId32", %d).\n", tmp_32, nchars);
return AVERROR_INVALIDDATA;
}
@ -1543,7 +1543,7 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
tmp_32 = ff_mlz_decompression(ctx->mlz, gb, nchars, larray);
if(tmp_32 != nchars) {
av_log(ctx->avctx, AV_LOG_ERROR, "Error in MLZ decompression (%d, %d).\n", tmp_32, nchars);
av_log(ctx->avctx, AV_LOG_ERROR, "Error in MLZ decompression (%"PRId32", %d).\n", tmp_32, nchars);
return AVERROR_INVALIDDATA;
}

View File

@ -495,7 +495,7 @@ static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,
else if(rice->k <= MIN_CACHE_BITS) {
x = (overflow << rice->k) + get_bits(gb, rice->k);
} else {
av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %d\n", rice->k);
av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %"PRIu32"\n", rice->k);
return AVERROR_INVALIDDATA;
}
rice->ksum += x - (rice->ksum + 8 >> 4);

View File

@ -176,7 +176,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
n = codes[i].bits;
code = codes[i].code;
symbol = codes[i].symbol;
ff_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code);
ff_dlog(NULL, "i=%d n=%d code=0x%"PRIx32"\n", i, n, code);
if (n <= table_nb_bits) {
/* no need to add another table */
j = code >> (32 - table_nb_bits);
@ -310,7 +310,8 @@ int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes,
} \
GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \
if (buf[j].code >= (1LL<<buf[j].bits)) { \
av_log(NULL, AV_LOG_ERROR, "Invalid code %x for %d in init_vlc\n", buf[j].code, i);\
av_log(NULL, AV_LOG_ERROR, "Invalid code %"PRIx32" for %d in " \
"init_vlc\n", buf[j].code, i); \
if (!(flags & INIT_VLC_USE_NEW_STATIC)) \
av_free(buf); \
return -1; \

View File

@ -149,7 +149,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
else if (rgb[0] == 0x000000FF && rgb[1] == 0x0000FF00 && rgb[2] == 0x00FF0000)
avctx->pix_fmt = alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB0;
else {
av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);
av_log(avctx, AV_LOG_ERROR, "Unknown bitfields "
"%0"PRIX32" %0"PRIX32" %0"PRIX32"\n", rgb[0], rgb[1], rgb[2]);
return AVERROR(EINVAL);
}
} else {

View File

@ -111,7 +111,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth)
int index;
if ((index = ff_dnxhd_get_cid_table(cid)) < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %"PRIu32"\n", cid);
return AVERROR(ENOSYS);
}
if (ff_dnxhd_cid_table[index].bit_depth != bitdepth &&
@ -120,7 +120,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth)
return AVERROR_INVALIDDATA;
}
ctx->cid_table = &ff_dnxhd_cid_table[index];
av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %d.\n", cid);
av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %"PRIu32".\n", cid);
ff_free_vlc(&ctx->ac_vlc);
ff_free_vlc(&ctx->dc_vlc);
@ -316,10 +316,11 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
for (i = 0; i < ctx->mb_height; i++) {
ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i << 2));
ff_dlog(ctx->avctx, "mb scan index %d, pos %d: %u\n", i, 0x170 + (i << 2), ctx->mb_scan_index[i]);
ff_dlog(ctx->avctx, "mb scan index %d, pos %d: %"PRIu32"\n",
i, 0x170 + (i << 2), ctx->mb_scan_index[i]);
if (buf_size - ctx->data_offset < ctx->mb_scan_index[i]) {
av_log(ctx->avctx, AV_LOG_ERROR,
"invalid mb scan index (%u vs %u).\n",
"invalid mb scan index (%"PRIu32" vs %u).\n",
ctx->mb_scan_index[i], buf_size - ctx->data_offset);
return AVERROR_INVALIDDATA;
}

View File

@ -222,8 +222,8 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
/* get the AC coefficients until last_index is reached */
for (;;) {
ff_dlog(NULL, "%2d: bits=%04x index=%u\n", pos, SHOW_UBITS(re, gb, 16),
re_index);
ff_dlog(NULL, "%2d: bits=%04"PRIx32" index=%u\n",
pos, SHOW_UBITS(re, gb, 16), re_index);
/* our own optimized GET_RL_VLC */
index = NEG_USR32(re_cache, TEX_VLC_BITS);
vlc_len = ff_dv_rl_vlc[index].len;

View File

@ -747,7 +747,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
int i;
av_log(avctx, AV_LOG_DEBUG, "palette:");
for(i=0;i<16;i++)
av_log(avctx, AV_LOG_DEBUG, " 0x%06x", ctx->palette[i]);
av_log(avctx, AV_LOG_DEBUG, " 0x%06"PRIx32, ctx->palette[i]);
av_log(avctx, AV_LOG_DEBUG, "\n");
}

View File

@ -343,7 +343,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_DEBUG, "Selected palette:");
for (i = 0; i < 4; i++)
av_log(avctx, AV_LOG_DEBUG, " 0x%06x@@%02x (0x%x,0x%x)",
av_log(avctx, AV_LOG_DEBUG, " 0x%06"PRIx32"@@%02x (0x%x,0x%x)",
dvdc->global_palette[out_palette[i]], out_alpha[i],
out_palette[i], out_alpha[i] >> 4);
av_log(avctx, AV_LOG_DEBUG, "\n");

View File

@ -374,7 +374,7 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
break;
case MKBETAG('Y', 'C', 'G', '6'):
case MKBETAG('Y', 'G', '1', '0'):
avpriv_report_missing_feature(avctx, "Tag 0x%08X", tag);
avpriv_report_missing_feature(avctx, "Tag 0x%08"PRIX32, tag);
return AVERROR_PATCHWELCOME;
default:
/* Old version does not have a real header, just size and type. */
@ -401,7 +401,7 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
ctx->tex_funct = ctx->texdsp.dxt1_block;
ctx->tex_step = 8;
} else {
av_log(avctx, AV_LOG_ERROR, "Unsupported header (0x%08X)\n.", tag);
av_log(avctx, AV_LOG_ERROR, "Unsupported header (0x%08"PRIX32")\n.", tag);
return AVERROR_INVALIDDATA;
}
ctx->tex_rat = 1;

View File

@ -870,7 +870,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
fs->slice_damaged = 1;
}
if (avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(avctx, AV_LOG_DEBUG, "slice %d, CRC: 0x%08X\n", i, AV_RB32(buf_p + v - 4));
av_log(avctx, AV_LOG_DEBUG, "slice %d, CRC: 0x%08"PRIX32"\n", i, AV_RB32(buf_p + v - 4));
}
}

View File

@ -649,7 +649,7 @@ static void decode_vui(GetBitContext *gb, AVCodecContext *avctx,
vui->vui_num_units_in_tick = get_bits_long(gb, 32);
vui->vui_time_scale = get_bits_long(gb, 32);
if (alt) {
av_log(avctx, AV_LOG_INFO, "Retry got %i/%i fps\n",
av_log(avctx, AV_LOG_INFO, "Retry got %"PRIu32"/%"PRIu32" fps\n",
vui->vui_time_scale, vui->vui_num_units_in_tick);
}
vui->vui_poc_proportional_to_timing_flag = get_bits1(gb);

View File

@ -417,7 +417,7 @@ static int hqx_decode_frame(AVCodecContext *avctx, void *data,
info_tag = AV_RL32(src);
if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
unsigned info_offset = AV_RL32(src + 4);
uint32_t info_offset = AV_RL32(src + 4);
if (info_offset > INT_MAX || info_offset + 8 > avpkt->size) {
av_log(avctx, AV_LOG_ERROR,
"Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",

View File

@ -934,7 +934,7 @@ static void decode_delta_j(uint8_t *dst,
offset = bytestream2_get_be16(&gb);
if (cols * bpp == 0 || bytestream2_get_bytes_left(&gb) < cols * bpp) {
av_log(NULL, AV_LOG_ERROR, "cols*bpp is invalid (%d*%d)", cols, bpp);
av_log(NULL, AV_LOG_ERROR, "cols*bpp is invalid (%"PRId32"*%d)", cols, bpp);
return;
}
@ -982,7 +982,7 @@ static void decode_delta_j(uint8_t *dst,
unsigned noffset = offset + (r * pitch) + d * planepitch;
if (!bytes || bytestream2_get_bytes_left(&gb) < bytes) {
av_log(NULL, AV_LOG_ERROR, "bytes %d is invalid", bytes);
av_log(NULL, AV_LOG_ERROR, "bytes %"PRId32" is invalid", bytes);
return;
}

View File

@ -214,7 +214,7 @@ static void microdvd_open_tags(AVBPrint *new_line, struct microdvd_tag *tags)
break;
case 'c':
av_bprintf(new_line, "{\\c&H%06X&}", tags[i].data1);
av_bprintf(new_line, "{\\c&H%06"PRIX32"&}", tags[i].data1);
break;
case 'f':
@ -223,7 +223,7 @@ static void microdvd_open_tags(AVBPrint *new_line, struct microdvd_tag *tags)
break;
case 's':
av_bprintf(new_line, "{\\fs%d}", tags[i].data1);
av_bprintf(new_line, "{\\fs%"PRId32"}", tags[i].data1);
break;
case 'p':
@ -232,7 +232,7 @@ static void microdvd_open_tags(AVBPrint *new_line, struct microdvd_tag *tags)
break;
case 'o':
av_bprintf(new_line, "{\\pos(%d,%d)}",
av_bprintf(new_line, "{\\pos(%"PRId32",%"PRId32")}",
tags[i].data1, tags[i].data2);
break;
}

View File

@ -280,7 +280,8 @@ static av_cold void decode_init_static(void)
scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0 * 2.0), FRAC_BITS);
scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
ff_dlog(NULL, "%d: norm=%x s=%x %x %x\n", i, norm,
ff_dlog(NULL, "%d: norm=%x s=%"PRIx32" %"PRIx32" %"PRIx32"\n", i,
(unsigned)norm,
scale_factor_mult[i][0],
scale_factor_mult[i][1],
scale_factor_mult[i][2]);

View File

@ -251,7 +251,7 @@ int ff_combine_frame(ParseContext *pc, int next,
const uint8_t **buf, int *buf_size)
{
if (pc->overread) {
ff_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
ff_dlog(NULL, "overread %d, state:%"PRIX32" next:%d index:%d o_index:%d\n",
pc->overread, pc->state, next, pc->index, pc->overread_index);
ff_dlog(NULL, "%X %X %X %X\n",
(*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
@ -314,7 +314,7 @@ int ff_combine_frame(ParseContext *pc, int next,
}
if (pc->overread) {
ff_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
ff_dlog(NULL, "overread %d, state:%"PRIX32" next:%d index:%d o_index:%d\n",
pc->overread, pc->state, next, pc->index, pc->overread_index);
ff_dlog(NULL, "%X %X %X %X\n",
(*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);

View File

@ -324,7 +324,8 @@ static int read_highpass(AVCodecContext *avctx, uint8_t *ptr, int plane, AVFrame
magic = bytestream2_get_be32(&ctx->gb);
if (magic != 0xDEADBEEF) {
av_log(avctx, AV_LOG_ERROR, "wrong magic number: 0x%08X for plane %d, band %d\n", magic, plane, i);
av_log(avctx, AV_LOG_ERROR, "wrong magic number: 0x%08"PRIX32
" for plane %d, band %d\n", magic, plane, i);
return AVERROR_INVALIDDATA;
}
@ -575,7 +576,7 @@ static int pixlet_decode_frame(AVCodecContext *avctx, void *data,
pktsize = bytestream2_get_be32(&ctx->gb);
if (pktsize <= 44 || pktsize - 4 > bytestream2_get_bytes_left(&ctx->gb)) {
av_log(avctx, AV_LOG_ERROR, "Invalid packet size %u.\n", pktsize);
av_log(avctx, AV_LOG_ERROR, "Invalid packet size %"PRIu32"\n", pktsize);
return AVERROR_INVALIDDATA;
}

View File

@ -491,7 +491,8 @@ static int read_header(ShortenContext *s)
if ((ret = decode_aiff_header(s->avctx, s->header, s->header_size)) < 0)
return ret;
} else {
avpriv_report_missing_feature(s->avctx, "unsupported bit packing %X", AV_RL32(s->header));
avpriv_report_missing_feature(s->avctx, "unsupported bit packing %"
PRIX32, AV_RL32(s->header));
return AVERROR_PATCHWELCOME;
}

View File

@ -97,7 +97,7 @@ int ff_tadd_rational_metadata(int count, const char *name, const char *sep,
for (i = 0; i < count; i++) {
nom = ff_tget_long(gb, le);
denom = ff_tget_long(gb, le);
av_bprintf(&bp, "%s%7i:%-7i", auto_sep(count, sep, i, 4), nom, denom);
av_bprintf(&bp, "%s%7"PRId32":%-7"PRId32, auto_sep(count, sep, i, 4), nom, denom);
}
if ((i = av_bprint_finalize(&bp, &ap))) {

View File

@ -731,7 +731,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
if (!res_setup->classifs)
return AVERROR(ENOMEM);
ff_dlog(NULL, " begin %d end %d part.size %d classif.s %d classbook %d \n",
ff_dlog(NULL, " begin %"PRIu32" end %"PRIu32" part.size %d classif.s %d classbook %d \n",
res_setup->begin, res_setup->end, res_setup->partition_size,
res_setup->classifications, res_setup->classbook);
@ -876,7 +876,7 @@ static int create_map(vorbis_context *vc, unsigned floor_number)
}
for (idx = 0; idx <= n; ++idx) {
ff_dlog(NULL, "floor0 map: map at pos %d is %d\n", idx, map[idx]);
ff_dlog(NULL, "floor0 map: map at pos %d is %"PRId32"\n", idx, map[idx]);
}
return 0;
@ -1012,7 +1012,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
if (!vc->fdsp)
return AVERROR(ENOMEM);
ff_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
ff_dlog(NULL, " vorbis version %"PRIu32" \n audio_channels %"PRIu8" \n audio_samplerate %"PRIu32" \n bitrate_max %"PRIu32" \n bitrate_nom %"PRIu32" \n bitrate_min %"PRIu32" \n blk_0 %"PRIu32" blk_1 %"PRIu32" \n ",
vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
/*

View File

@ -701,7 +701,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
int i;
int offset = 0;
for (i = 0; i < s->channel[c].num_subframes; i++) {
ff_dlog(s->avctx, "frame[%i] channel[%i] subframe[%i]"
ff_dlog(s->avctx, "frame[%"PRIu32"] channel[%i] subframe[%i]"
" len %i\n", s->frame_num, c, i,
s->channel[c].subframe_len[i]);
s->channel[c].subframe_offset[i] = offset;

View File

@ -1077,7 +1077,8 @@ static int hdcd_integrate(HDCDContext *ctx, hdcd_state *states, int channels, in
/* one of bits 3, 6, or 7 was not 0 */
states[i].code_counterA_almost++;
av_log(ctx->fctx, AV_LOG_VERBOSE,
"hdcd error: Control A almost: 0x%02x near %d\n", wbits & 0xff, ctx->sample_count);
"hdcd error: Control A almost: 0x%02"PRIx32" near %d\n",
wbits & 0xff, ctx->sample_count);
}
} else if ((wbits & 0xa0060000) == 0xa0060000) {
/* B: 8-bit code, 8-bit XOR check, 0x7e0fa006[....] */
@ -1091,7 +1092,9 @@ static int hdcd_integrate(HDCDContext *ctx, hdcd_state *states, int channels, in
/* XOR check failed */
states[i].code_counterB_checkfails++;
av_log(ctx->fctx, AV_LOG_VERBOSE,
"hdcd error: Control B check failed: 0x%04x (0x%02x vs 0x%02x) near %d\n", wbits & 0xffff, (wbits & 0xff00) >> 8, ~wbits & 0xff, ctx->sample_count);
"hdcd error: Control B check failed: 0x%04"PRIx32
" (0x%02"PRIx32" vs 0x%02"PRIx32") near %d\n",
wbits & 0xffff, (wbits & 0xff00) >> 8, ~wbits & 0xff, ctx->sample_count);
}
}
if (f) {

View File

@ -64,7 +64,7 @@ static av_cold int init(AVFilterContext *ctx)
if (s->random_seed == -1)
s->random_seed = av_get_random_seed();
seed = s->random_seed;
av_log(ctx, AV_LOG_INFO, "random seed: 0x%08x\n", seed);
av_log(ctx, AV_LOG_INFO, "random seed: 0x%08"PRIx32"\n", seed);
av_lfg_init(&s->lfg, seed);
}

View File

@ -239,7 +239,7 @@ static void write_palette(AVFilterContext *ctx, AVFrame *out)
if (box_id < s->nb_boxes) {
pal[x] = s->boxes[box_id++].color;
if ((x || y) && pal[x] == last_color)
av_log(ctx, AV_LOG_WARNING, "Dupped color: %08X\n", pal[x]);
av_log(ctx, AV_LOG_WARNING, "Dupped color: %08"PRIX32"\n", pal[x]);
last_color = pal[x];
} else {
pal[x] = 0xff000000; // pad with black

View File

@ -491,7 +491,7 @@ static void disp_node(AVBPrint *buf,
av_bprintf(buf, "%*cnode%d ["
"label=\"%c%02X%c%02X%c%02X%c\" "
"fillcolor=\"#%02x%02x%02x\" "
"fontcolor=\"#%06X\"]\n",
"fontcolor=\"#%06"PRIX32"\"]\n",
depth*INDENT, ' ', node->palette_id,
"[ "[node->split], node->val[0],
"][ "[node->split], node->val[1],
@ -552,7 +552,7 @@ static int debug_accuracy(const struct color_node *node, const uint32_t *palette
const int d2 = diff(palrgb2, rgb);
if (d1 != d2) {
av_log(NULL, AV_LOG_ERROR,
"/!\\ %02X%02X%02X: %d ! %d (%06X ! %06X) / dist: %d ! %d\n",
"/!\\ %02X%02X%02X: %d ! %d (%06"PRIX32" ! %06"PRIX32") / dist: %d ! %d\n",
r, g, b, r1, r2, c1 & 0xffffff, c2 & 0xffffff, d1, d2);
ret = 1;
}

View File

@ -199,7 +199,7 @@ static av_cold int init(AVFilterContext *ctx)
}
av_log(ctx, AV_LOG_VERBOSE,
"s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%u\n",
"s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%"PRIu32"\n",
s->w, s->h, s->frame_rate.num, s->frame_rate.den,
s->rule, s->stitch, s->scroll, s->start_full,
s->random_seed);

View File

@ -260,7 +260,7 @@ static av_cold int init(AVFilterContext *ctx)
}
av_log(ctx, AV_LOG_VERBOSE,
"s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%u\n",
"s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%"PRIu32"\n",
life->w, life->h, life->frame_rate.num, life->frame_rate.den,
life->rule_str, life->stay_rule, life->born_rule, life->stitch,
life->random_seed);

View File

@ -112,7 +112,8 @@ static int aa_read_header(AVFormatContext *s)
header_seed = atoi(val);
} else if (!strcmp(key, "HeaderKey")) { // this looks like "1234567890 1234567890 1234567890 1234567890"
av_log(s, AV_LOG_DEBUG, "HeaderKey is <%s>\n", val);
sscanf(val, "%u%u%u%u", &header_key_part[0], &header_key_part[1], &header_key_part[2], &header_key_part[3]);
sscanf(val, "%"SCNu32"%"SCNu32"%"SCNu32"%"SCNu32,
&header_key_part[0], &header_key_part[1], &header_key_part[2], &header_key_part[3]);
for (idx = 0; idx < 4; idx++) {
AV_WB32(&header_key[idx * 4], header_key_part[idx]); // convert each part to BE!
}

View File

@ -404,7 +404,7 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
return 0;
default:
avpriv_request_sample(s, "In-stream tag=%s (0x%08X) len=%"PRIu32,
avpriv_request_sample(s, "In-stream tag=%s (0x%08"PRIX32") len=%"PRIu32,
av_fourcc2str(tag), tag, len);
avio_skip(pb, len + 4);
}

View File

@ -102,7 +102,7 @@ static int ast_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0;
pkt->pos = pos;
} else {
av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", type);
av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", type);
avio_skip(s->pb, size);
ret = AVERROR_INVALIDDATA;
}

View File

@ -230,7 +230,7 @@ static int read_header(AVFormatContext *s)
b->current_block = 0;
b->block_count = read32(s);
if (b->block_count > UINT16_MAX) {
av_log(s, AV_LOG_WARNING, "too many blocks: %u\n", b->block_count);
av_log(s, AV_LOG_WARNING, "too many blocks: %"PRIu32"\n", b->block_count);
return AVERROR_INVALIDDATA;
}

View File

@ -134,7 +134,7 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par,
tags[0] = ff_mp4_obj_type;
oti = av_codec_get_tag(tags, par->codec_id);
if (oti)
av_strlcatf(str, size, ".%02x", oti);
av_strlcatf(str, size, ".%02"PRIx32, oti);
else
return;

View File

@ -421,7 +421,8 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
dump_audioservicetype(ctx, &sd);
break;
case AV_PKT_DATA_QUALITY_STATS:
av_log(ctx, AV_LOG_INFO, "quality factor: %d, pict_type: %c", AV_RL32(sd.data), av_get_picture_type_char(sd.data[4]));
av_log(ctx, AV_LOG_INFO, "quality factor: %"PRId32", pict_type: %c",
AV_RL32(sd.data), av_get_picture_type_char(sd.data[4]));
break;
case AV_PKT_DATA_CPB_PROPERTIES:
av_log(ctx, AV_LOG_INFO, "cpb: ");

View File

@ -68,7 +68,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
pkt->side_data[i].data,
pkt->side_data[i].size);
}
av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08x", pkt->side_data[i].size, side_data_crc);
av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08"PRIx32, pkt->side_data[i].size, side_data_crc);
}
}
av_strlcatf(buf, sizeof(buf), "\n");

View File

@ -94,7 +94,7 @@ static int ircam_read_header(AVFormatContext *s)
st->codecpar->codec_id = ff_codec_get_id(tags, tag);
if (st->codecpar->codec_id == AV_CODEC_ID_NONE) {
av_log(s, AV_LOG_ERROR, "unknown tag %X\n", tag);
av_log(s, AV_LOG_ERROR, "unknown tag %"PRIx32"\n", tag);
return AVERROR_INVALIDDATA;
}

View File

@ -412,7 +412,7 @@ retry:
key = c->meta_keys[index];
} else {
av_log(c->fc, AV_LOG_WARNING,
"The index of 'data' is out of range: %d < 1 or >= %d.\n",
"The index of 'data' is out of range: %"PRId32" < 1 or >= %d.\n",
index, c->meta_keys_count);
}
}
@ -686,7 +686,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, len);
}
} else {
av_log(c->fc, AV_LOG_DEBUG, "Unknown dref type 0x%08x size %d\n",
av_log(c->fc, AV_LOG_DEBUG, "Unknown dref type 0x%08"PRIx32" size %"PRIu32"\n",
dref->type, size);
entries--;
i--;
@ -700,7 +700,7 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
uint32_t type;
uint32_t av_unused ctype;
uint32_t ctype;
int64_t title_size;
char *title_str;
int ret;
@ -712,8 +712,8 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
ctype = avio_rl32(pb);
type = avio_rl32(pb); /* component subtype */
av_log(c->fc, AV_LOG_TRACE, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
av_log(c->fc, AV_LOG_TRACE, "stype= %.4s\n", (char*)&type);
av_log(c->fc, AV_LOG_TRACE, "ctype=%s\n", av_fourcc2str(ctype));
av_log(c->fc, AV_LOG_TRACE, "stype=%s\n", av_fourcc2str(type));
if (c->trak_index < 0) { // meta not inside a trak
if (type == MKTAG('m','d','t','a')) {
@ -2284,8 +2284,8 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
id = mov_codec_id(st, format);
av_log(c->fc, AV_LOG_TRACE,
"size=%"PRId64" 4CC=%s/0x%08x codec_type=%d\n", size,
av_fourcc2str(format), format, st->codecpar->codec_type);
"size=%"PRId64" 4CC=%s codec_type=%d\n", size,
av_fourcc2str(format), st->codecpar->codec_type);
if (st->codecpar->codec_type==AVMEDIA_TYPE_VIDEO) {
st->codecpar->codec_id = id;
@ -3816,7 +3816,7 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, MOVAtom atom)
count = avio_rb32(pb);
if (count > UINT_MAX / sizeof(*c->meta_keys) - 1) {
av_log(c->fc, AV_LOG_ERROR,
"The 'keys' atom with the invalid key count: %d\n", count);
"The 'keys' atom with the invalid key count: %"PRIu32"\n", count);
return AVERROR_INVALIDDATA;
}
@ -3830,7 +3830,8 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, MOVAtom atom)
uint32_t type = avio_rl32(pb);
if (key_size < 8) {
av_log(c->fc, AV_LOG_ERROR,
"The key# %d in meta has invalid size: %d\n", i, key_size);
"The key# %"PRIu32" in meta has invalid size:"
"%"PRIu32"\n", i, key_size);
return AVERROR_INVALIDDATA;
}
key_size -= 8;
@ -5379,8 +5380,8 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
total_size += 8;
}
}
av_log(c->fc, AV_LOG_TRACE, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
av_log(c->fc, AV_LOG_TRACE, "type:'%s' parent:'%s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
av_fourcc2str(a.type), av_fourcc2str(atom.type), a.size, total_size, atom.size);
if (a.size == 0) {
a.size = atom.size - total_size + 8;
}

View File

@ -557,8 +557,9 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
bitmap = avio_rb32(pb);
num_descr = avio_rb32(pb);
av_log(s, AV_LOG_TRACE, "chan: layout=%u bitmap=%u num_descr=%u\n",
layout_tag, bitmap, num_descr);
av_log(s, AV_LOG_TRACE, "chan: layout=%"PRIu32" "
"bitmap=%"PRIu32" num_descr=%"PRIu32"\n",
layout_tag, bitmap, num_descr);
if (size < 12ULL + num_descr * 20ULL)
return 0;

View File

@ -1716,7 +1716,7 @@ static int mov_write_gama_tag(AVIOContext *pb, MOVTrack *track, double gamma)
if (gamma > 1e-6) {
gama = (uint32_t)lrint((double)(1<<16) * gamma);
av_log(pb, AV_LOG_DEBUG, "writing gama value %d\n", gama);
av_log(pb, AV_LOG_DEBUG, "writing gama value %"PRId32"\n", gama);
av_assert0(track->mode == MODE_MOV);
avio_wb32(pb, 12);
@ -2378,8 +2378,8 @@ static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
descr = "TimeCodeHandler";
} else {
av_log(s, AV_LOG_WARNING,
"Unknown hldr_type for %s / 0x%04X, writing dummy values\n",
av_fourcc2str(track->par->codec_tag), track->par->codec_tag);
"Unknown hldr_type for %s, writing dummy values\n",
av_fourcc2str(track->par->codec_tag));
}
if (track->st) {
// hdlr.name is used by some players to identify the content title

View File

@ -319,7 +319,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
if ((mpah.bit_rate == 0) || (mp3->initial_bitrate != mpah.bit_rate))
mp3->has_variable_bitrate = 1;
} else {
av_log(s, AV_LOG_WARNING, "Audio packet of size %d (starting with %08X...) "
av_log(s, AV_LOG_WARNING, "Audio packet of size %d (starting with %08"PRIX32"...) "
"is invalid, writing it anyway.\n", pkt->size, h);
}

View File

@ -1433,7 +1433,8 @@ int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPack
return AVERROR_INVALIDDATA;
}
av_log(s, AV_LOG_WARNING, "H.264 bitstream error, startcode missing, size %d", pkt->size);
if (pkt->size) av_log(s, AV_LOG_WARNING, " data %08X", AV_RB32(pkt->data));
if (pkt->size)
av_log(s, AV_LOG_WARNING, " data %08"PRIX32, AV_RB32(pkt->data));
av_log(s, AV_LOG_WARNING, "\n");
}
return 0;
@ -1447,7 +1448,8 @@ static int check_hevc_startcode(AVFormatContext *s, const AVStream *st, const AV
return AVERROR_PATCHWELCOME;
}
av_log(s, AV_LOG_WARNING, "HEVC bitstream error, startcode missing, size %d", pkt->size);
if (pkt->size) av_log(s, AV_LOG_WARNING, " data %08X", AV_RB32(pkt->data));
if (pkt->size)
av_log(s, AV_LOG_WARNING, " data %08"PRIX32, AV_RB32(pkt->data));
av_log(s, AV_LOG_WARNING, "\n");
}
return 0;
@ -1565,7 +1567,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
do {
p = avpriv_find_start_code(p, buf_end, &state);
av_log(s, AV_LOG_TRACE, "nal %d\n", state & 0x1f);
av_log(s, AV_LOG_TRACE, "nal %"PRId32"\n", state & 0x1f);
if ((state & 0x1f) == 7)
extradd = 0;
} while (p < buf_end && (state & 0x1f) != 9 &&
@ -1631,7 +1633,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
do {
p = avpriv_find_start_code(p, buf_end, &state);
av_log(s, AV_LOG_TRACE, "nal %d\n", (state & 0x7e)>>1);
av_log(s, AV_LOG_TRACE, "nal %"PRId32"\n", (state & 0x7e)>>1);
if ((state & 0x7e) == 2*32)
extradd = 0;
} while (p < buf_end && (state & 0x7e) != 2*35 &&

View File

@ -372,9 +372,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!validate_codec_tag(s, st)) {
const uint32_t otag = av_codec_get_tag(s->oformat->codec_tag, par->codec_id);
av_log(s, AV_LOG_ERROR,
"Tag %s/0x%08x incompatible with output codec id '%d' (%s)\n",
av_fourcc2str(par->codec_tag), par->codec_tag,
par->codec_id, av_fourcc2str(otag));
"Tag %s incompatible with output codec id '%d' (%s)\n",
av_fourcc2str(par->codec_tag), par->codec_id, av_fourcc2str(otag));
ret = AVERROR_INVALIDDATA;
goto fail;
}

View File

@ -89,7 +89,7 @@ static int nist_read_header(AVFormatContext *s)
return 0;
} else if (!memcmp(buffer, "channel_count", 13)) {
sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->channels);
sscanf(buffer, "%*s %*s %u", &st->codecpar->channels);
} else if (!memcmp(buffer, "sample_byte_format", 18)) {
sscanf(buffer, "%*s %*s %31s", format);
@ -108,11 +108,11 @@ static int nist_read_header(AVFormatContext *s)
} else if (!memcmp(buffer, "sample_count", 12)) {
sscanf(buffer, "%*s %*s %"SCNd64, &st->duration);
} else if (!memcmp(buffer, "sample_n_bytes", 14)) {
sscanf(buffer, "%*s %*s %"SCNd32, &bps);
sscanf(buffer, "%*s %*s %d", &bps);
} else if (!memcmp(buffer, "sample_rate", 11)) {
sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->sample_rate);
sscanf(buffer, "%*s %*s %d", &st->codecpar->sample_rate);
} else if (!memcmp(buffer, "sample_sig_bits", 15)) {
sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->bits_per_coded_sample);
sscanf(buffer, "%*s %*s %d", &st->codecpar->bits_per_coded_sample);
} else {
char key[32], value[32];
if (sscanf(buffer, "%31s %*s %31s", key, value) == 2) {

View File

@ -228,7 +228,7 @@ static int nsv_resync(AVFormatContext *s)
v <<= 8;
v |= avio_r8(pb);
if (i < 8) {
av_log(s, AV_LOG_TRACE, "NSV resync: [%d] = %02x\n", i, v & 0x0FF);
av_log(s, AV_LOG_TRACE, "NSV resync: [%d] = %02"PRIx32"\n", i, v & 0x0FF);
}
if ((v & 0x0000ffff) == 0xefbe) { /* BEEF */
@ -543,7 +543,7 @@ null_chunk_retry:
asize = avio_rl16(pb);
vsize = (vsize << 4) | (auxcount >> 4);
auxcount &= 0x0f;
av_log(s, AV_LOG_TRACE, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize);
av_log(s, AV_LOG_TRACE, "NSV CHUNK %d aux, %"PRIu32" bytes video, %d bytes audio\n", auxcount, vsize, asize);
/* skip aux stuff */
for (i = 0; i < auxcount; i++) {
uint32_t av_unused auxtag;

View File

@ -84,8 +84,8 @@ static av_cold int oma_write_header(AVFormatContext *s)
(par->block_align/8 - 1));
break;
default:
av_log(s, AV_LOG_ERROR, "unsupported codec tag %d for write\n",
par->codec_tag);
av_log(s, AV_LOG_ERROR, "unsupported codec tag %s for write\n",
av_fourcc2str(par->codec_tag));
return AVERROR(EINVAL);
}
for (i = 0; i < (EA3_HEADER_SIZE - 36)/4; i++)

View File

@ -380,7 +380,8 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
st->codecpar->codec_tag = avio_rl32(pb);
st->codecpar->codec_id = ff_codec_get_id(ff_rm_codec_tags,
st->codecpar->codec_tag);
av_log(s, AV_LOG_TRACE, "%X %X\n", st->codecpar->codec_tag, MKTAG('R', 'V', '2', '0'));
av_log(s, AV_LOG_TRACE, "%"PRIX32" %X\n",
st->codecpar->codec_tag, MKTAG('R', 'V', '2', '0'));
if (st->codecpar->codec_id == AV_CODEC_ID_NONE)
goto fail1;
st->codecpar->width = avio_rb16(pb);

View File

@ -170,8 +170,8 @@ static int rpl_read_header(AVFormatContext *s)
vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE130;
break;
default:
avpriv_report_missing_feature(s, "Video format %i",
vst->codecpar->codec_tag);
avpriv_report_missing_feature(s, "Video format %s",
av_fourcc2str(vst->codecpar->codec_tag));
vst->codecpar->codec_id = AV_CODEC_ID_NONE;
}
@ -233,8 +233,8 @@ static int rpl_read_header(AVFormatContext *s)
rpl->frames_per_chunk = read_line_and_int(pb, &error); // video frames per chunk
if (rpl->frames_per_chunk > 1 && vst->codecpar->codec_tag != 124)
av_log(s, AV_LOG_WARNING,
"Don't know how to split frames for video format %i. "
"Video stream will be broken!\n", vst->codecpar->codec_tag);
"Don't know how to split frames for video format %s. "
"Video stream will be broken!\n", av_fourcc2str(vst->codecpar->codec_tag));
number_of_chunks = read_line_and_int(pb, &error); // number of chunks in the file
// The number in the header is actually the index of the last chunk.

View File

@ -285,7 +285,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
RTPMuxContext *s = s1->priv_data;
uint32_t rtp_ts;
av_log(s1, AV_LOG_TRACE, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
av_log(s1, AV_LOG_TRACE, "RTCP: %02x %"PRIx64" %"PRIx32"\n", s->payload_type, ntp_time, s->timestamp);
s->last_rtcp_ntp_time = ntp_time;
rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, (AVRational){1, 1000000},

View File

@ -78,7 +78,7 @@ static int get_event_info(const char *line, struct event_info *ei)
ei->pts = AV_NOPTS_VALUE;
ei->pos = -1;
if (sscanf(line, "%d:%d:%d%*1[,.]%d --> %d:%d:%d%*1[,.]%d"
"%*[ ]X1:%u X2:%u Y1:%u Y2:%u",
"%*[ ]X1:%"PRId32" X2:%"PRId32" Y1:%"PRId32" Y2:%"PRId32,
&hh1, &mm1, &ss1, &ms1,
&hh2, &mm2, &ss2, &ms2,
&ei->x1, &ei->x2, &ei->y1, &ei->y2) >= 8) {

View File

@ -115,7 +115,7 @@ static void audio_frame_cksum(AVBPrint *bp, AVFrame *frame)
default:
av_assert0(!"reached");
}
av_bprintf(bp, ", 0x%08x", cksum);
av_bprintf(bp, ", 0x%08"PRIx32, cksum);
}
}

View File

@ -250,7 +250,8 @@ static int wsvqa_read_packet(AVFormatContext *s,
case CMDS_TAG:
break;
default:
av_log(s, AV_LOG_INFO, "Skipping unknown chunk 0x%08X\n", chunk_type);
av_log(s, AV_LOG_INFO, "Skipping unknown chunk %s\n",
av_fourcc2str(av_bswap32(chunk_type)));
}
avio_skip(pb, chunk_size + skip_byte);
}

View File

@ -87,8 +87,9 @@ static int xwma_read_header(AVFormatContext *s)
*/
if (st->codecpar->codec_id != AV_CODEC_ID_WMAV2 &&
st->codecpar->codec_id != AV_CODEC_ID_WMAPRO) {
avpriv_request_sample(s, "Unexpected codec (tag 0x%04x; id %d)",
st->codecpar->codec_tag, st->codecpar->codec_id);
avpriv_request_sample(s, "Unexpected codec (tag %s; id %d)",
av_fourcc2str(st->codecpar->codec_tag),
st->codecpar->codec_id);
} else {
/* In all xWMA files I have seen, there is no extradata. But the WMA
* codecs require extradata, so we provide our own fake extradata.

View File

@ -168,19 +168,19 @@ static void colored_fputs(int level, int tint, const char *str)
#else
if (local_use_color == 1) {
fprintf(stderr,
"\033[%d;3%dm%s\033[0m",
"\033[%"PRIu32";3%"PRIu32"m%s\033[0m",
(color[level] >> 4) & 15,
color[level] & 15,
str);
} else if (tint && use_color == 256) {
fprintf(stderr,
"\033[48;5;%dm\033[38;5;%dm%s\033[0m",
"\033[48;5;%"PRIu32"m\033[38;5;%dm%s\033[0m",
(color[level] >> 16) & 0xff,
tint,
str);
} else if (local_use_color == 256) {
fprintf(stderr,
"\033[48;5;%dm\033[38;5;%dm%s\033[0m",
"\033[48;5;%"PRIu32"m\033[38;5;%"PRIu32"m%s\033[0m",
(color[level] >> 16) & 0xff,
(color[level] >> 8) & 0xff,
str);

View File

@ -129,7 +129,8 @@ char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_
char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit)
{
snprintf(buf, AV_TIMECODE_STR_SIZE, "%02u:%02u:%02u%c%02u",
snprintf(buf, AV_TIMECODE_STR_SIZE,
"%02"PRIu32":%02"PRIu32":%02"PRIu32"%c%02"PRIu32,
tc25bit>>19 & 0x1f, // 5-bit hours
tc25bit>>13 & 0x3f, // 6-bit minutes
tc25bit>>6 & 0x3f, // 6-bit seconds