* 4XM codec.
*/
+#include <inttypes.h>
+
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
}
if (buf_size < AV_RL32(buf + 4) + 8) {
- av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n",
+ av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %"PRIu32"\n",
buf_size, AV_RL32(buf + 4));
return AVERROR_INVALIDDATA;
}
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "dsputil.h"
width = AV_RB16(src + 6);
height = AV_RB16(src + 8);
if (frame_size > size) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Frame size should be %d got %d\n",
+ av_log(ctx->avctx, AV_LOG_ERROR, "Frame size should be %"PRIu32" got %d\n",
frame_size, size);
return AVERROR_INVALIDDATA;
}
* 32bit samplerate
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
else
output_samples = alac->max_samples_per_frame;
if (!output_samples || output_samples > alac->max_samples_per_frame) {
- av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %"PRIu32"\n",
output_samples);
return AVERROR_INVALIDDATA;
}
return ret;
}
} else if (output_samples != alac->nb_samples) {
- av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
+ av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %"PRIu32" != %d\n",
output_samples, alac->nb_samples);
return AVERROR_INVALIDDATA;
}
alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
if (!alac->max_samples_per_frame ||
alac->max_samples_per_frame > INT_MAX / sizeof(int32_t)) {
- av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
+ av_log(alac->avctx, AV_LOG_ERROR,
+ "max samples per frame invalid: %"PRIu32"\n",
alac->max_samples_per_frame);
return AVERROR_INVALIDDATA;
}
* @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "get_bits.h"
#include "unary.h"
int offset = parcor_rice_table[sconf->coef_table][k][0];
quant_cof[k] = decode_rice(gb, rice_param) + offset;
if (quant_cof[k] < -64 || quant_cof[k] > 63) {
- av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range\n", quant_cof[k]);
+ av_log(avctx, AV_LOG_ERROR,
+ "quant_cof %"PRIu32" is out of range\n",
+ quant_cof[k]);
return AVERROR_INVALIDDATA;
}
}
bd.block_length = div_blocks[b];
if (bd.block_length <= 0) {
av_log(ctx->avctx, AV_LOG_WARNING,
- "Invalid block length %d in channel data!\n", bd.block_length);
+ "Invalid block length %u in channel data!\n",
+ bd.block_length);
continue;
}
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
}
if (!nblocks || nblocks > INT_MAX) {
- av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
+ av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %"PRIu32".\n",
+ nblocks);
return AVERROR_INVALIDDATA;
}
s->samples = nblocks;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "bmp.h"
fsize = bytestream_get_le32(&buf);
if (buf_size < fsize) {
- av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d), trying to decode anyway\n",
+ av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %u), trying to decode anyway\n",
buf_size, fsize);
fsize = buf_size;
}
hsize = bytestream_get_le32(&buf); /* header size */
ihsize = bytestream_get_le32(&buf); /* more header size */
if (ihsize + 14 > hsize) {
- av_log(avctx, AV_LOG_ERROR, "invalid header size %d\n", hsize);
+ av_log(avctx, AV_LOG_ERROR, "invalid header size %u\n", hsize);
return AVERROR_INVALIDDATA;
}
fsize = buf_size - 2;
if (fsize <= hsize) {
- av_log(avctx, AV_LOG_ERROR, "declared file size is less than header size (%d < %d)\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Declared file size is less than header size (%u < %u)\n",
fsize, hsize);
return AVERROR_INVALIDDATA;
}
else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F)
avctx->pix_fmt = AV_PIX_FMT_RGB444;
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);
}
}
if (hsize - ihsize - 14 > 0) {
avctx->pix_fmt = AV_PIX_FMT_PAL8;
} else {
- av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);
+ av_log(avctx, AV_LOG_ERROR, "Unknown palette for %u-colour BMP\n",
+ 1 << depth);
return AVERROR_INVALIDDATA;
}
break;
default:
- av_log(avctx, AV_LOG_ERROR, "depth %d not supported\n", depth);
+ av_log(avctx, AV_LOG_ERROR, "depth %u not supported\n", depth);
return AVERROR_INVALIDDATA;
}
buf = buf0 + 46;
t = bytestream_get_le32(&buf);
if (t < 0 || t > (1 << depth)) {
- av_log(avctx, AV_LOG_ERROR, "Incorrect number of colors - %X for bitdepth %d\n", t, depth);
+ av_log(avctx, AV_LOG_ERROR,
+ "Incorrect number of colors - %X for bitdepth %u\n",
+ t, depth);
} else if (t) {
colors = t;
}
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "dsputil.h"
#include "get_bits.h"
info_offset = AV_RL32(src + 4);
if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
av_log(avctx, AV_LOG_ERROR,
- "Invalid INFO header offset: 0x%08X is too large.\n",
+ "Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",
info_offset);
return AVERROR_INVALIDDATA;
}
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
return AVERROR_INVALIDDATA;
}
} else {
- av_log(avctx, AV_LOG_WARNING, "Ignoring unknown chunk type %d\n",
+ av_log(avctx, AV_LOG_WARNING,
+ "Ignoring unknown chunk type %"PRIu32"\n",
chunk_type);
}
buf += chunk_size;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "bytestream.h"
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n",
+ slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
slice_height = (next_y & ~3) - (cur_y & ~3);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
slice_height = (next_y & ~1) - (cur_y & ~1);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 0);
break;
default:
- avpriv_request_sample(avctx, "Frame header %X", AV_RB32(src));
+ avpriv_request_sample(avctx, "Frame header %"PRIX32, AV_RB32(src));
return AVERROR_PATCHWELCOME;
}
* Go2Webinar decoder
*/
+#include <inttypes.h>
#include <zlib.h>
#include "libavutil/intreadwrite.h"
if (cursor_w < 1 || cursor_w > 256 ||
cursor_h < 1 || cursor_h > 256) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %dx%d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %"PRIu32"x%"PRIu32"\n",
cursor_w, cursor_h);
return AVERROR_INVALIDDATA;
}
if (cursor_hot_x > cursor_w || cursor_hot_y > cursor_h) {
- av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %d,%d\n",
+ av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %"PRIu32",%"PRIu32"\n",
cursor_hot_x, cursor_hot_y);
cursor_hot_x = FFMIN(cursor_hot_x, cursor_w - 1);
cursor_hot_y = FFMIN(cursor_hot_y, cursor_h - 1);
}
if (cur_size - 9 > bytestream2_get_bytes_left(gb) ||
c->cursor_w * c->cursor_h / 4 > cur_size) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d/%d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %"PRIu32"/%u\n",
cur_size, bytestream2_get_bytes_left(gb));
return AVERROR_INVALIDDATA;
}
chunk_type = bytestream2_get_byte(&bc);
chunk_start = bytestream2_tell(&bc);
if (chunk_size > bytestream2_get_bytes_left(&bc)) {
- av_log(avctx, AV_LOG_ERROR, "Invalid chunk size %d type %02X\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid chunk size %"PRIu32" type %02X\n",
chunk_size, chunk_type);
break;
}
case DISPLAY_INFO:
c->got_header = 0;
if (chunk_size < 21) {
- av_log(avctx, AV_LOG_ERROR, "Invalid display info size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid display info size %"PRIu32"\n",
chunk_size);
break;
}
b_mask = bytestream2_get_be32(&bc);
if (r_mask != 0xFF0000 || g_mask != 0xFF00 || b_mask != 0xFF) {
av_log(avctx, AV_LOG_ERROR,
- "Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
+ "Invalid or unsupported bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32"\n",
r_mask, g_mask, b_mask);
return AVERROR_PATCHWELCOME;
}
break;
case CURSOR_POS:
if (chunk_size < 5) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor pos size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor pos size %"PRIu32"\n",
chunk_size);
break;
}
break;
case CURSOR_SHAPE:
if (chunk_size < 8) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %"PRIu32"\n",
chunk_size);
break;
}
case CHUNK_CD:
break;
default:
- av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02X\n",
+ av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02"PRIX32"\n",
chunk_type);
}
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
#include "internal.h"
#include "avcodec.h"
sps->time_scale = get_bits_long(&h->gb, 32);
if (!sps->num_units_in_tick || !sps->time_scale) {
av_log(h->avctx, AV_LOG_ERROR,
- "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n",
+ "time_scale/num_units_in_tick invalid or unsupported (%"PRIu32"/%"PRIu32")\n",
sps->time_scale, sps->num_units_in_tick);
return AVERROR_INVALIDDATA;
}
if ((unsigned)sps->poc_cycle_length >=
FF_ARRAY_ELEMS(sps->offset_for_ref_frame)) {
av_log(h->avctx, AV_LOG_ERROR,
- "poc_cycle_length overflow %u\n", sps->poc_cycle_length);
+ "poc_cycle_length overflow %d\n", sps->poc_cycle_length);
goto fail;
}
if (h->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
av_log(h->avctx, AV_LOG_DEBUG, "discarding sps cropping, original "
- "values are l:%u r:%u t:%u b:%u\n",
+ "values are l:%d r:%d t:%d b:%d\n",
crop_left, crop_right, crop_top, crop_bottom);
sps->crop_left =
if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
static const char csp[4][5] = { "Gray", "420", "422", "444" };
av_log(h->avctx, AV_LOG_DEBUG,
- "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n",
+ "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %d/%d\n",
sps_id, sps->profile_idc, sps->level_idc,
sps->poc_type,
sps->ref_frame_count,
if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(h->avctx, AV_LOG_DEBUG,
- "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n",
+ "pps:%u sps:%u %s slice_groups:%d ref:%u/%u %s qp:%d/%d/%d/%d %s %s %s %s\n",
pps_id, pps->sps_id,
pps->cabac ? "CABAC" : "CAVLC",
pps->slice_group_count,
* Indeo5 decoders.
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "libavutil/attributes.h"
#include "libavutil/timer.h"
val = IVI_TOSIGNED((hi << 6) | lo);
} else {
if (sym >= 256U) {
- av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym);
+ av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %"PRIu32".\n", sym);
return AVERROR_INVALIDDATA;
}
run = rvmap->runtab[sym];
if (chksum != band->checksum) {
av_log(avctx, AV_LOG_ERROR,
"Band checksum mismatch! Plane %d, band %d, "
- "received: %x, calculated: %x\n",
+ "received: %"PRIx32", calculated: %"PRIx16"\n",
band->plane, band->band_num, band->checksum, chksum);
}
}
* JPEG 2000 image decoder
*/
+#include <inttypes.h>
+
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "avcodec.h"
if (tmp.mct && s->ncomponents < 3) {
av_log(s->avctx, AV_LOG_ERROR,
- "MCT %d with too few components (%d)\n",
+ "MCT %"PRIu8" with too few components (%d)\n",
tmp.mct, s->ncomponents);
return AVERROR_INVALIDDATA;
}
bytestream2_get_byteu(&s->g); // TNsot
if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
- av_log(s->avctx, AV_LOG_ERROR, "Psot %d too big\n", Psot);
+ av_log(s->avctx, AV_LOG_ERROR, "Psot %"PRIu32" too big\n", Psot);
return AVERROR_INVALIDDATA;
}
if (TPsot >= FF_ARRAY_ELEMS(s->tile[Isot].tile_part)) {
- avpriv_request_sample(s->avctx, "Support for %d components", TPsot);
+ avpriv_request_sample(s->avctx, "Support for %"PRIu8" components", TPsot);
return AVERROR_PATCHWELCOME;
}
if (cblk->length > sizeof(cblk->data)) {
av_log(s->avctx, AV_LOG_ERROR,
- "Block length %d > data size %zd\n",
+ "Block length %"PRIu16" > data size %zd\n",
cblk->length, sizeof(cblk->data));
return AVERROR_INVALIDDATA;
}
break;
default:
av_log(s->avctx, AV_LOG_ERROR,
- "unsupported marker 0x%.4X at pos 0x%X\n",
+ "unsupported marker 0x%.4"PRIX16" at pos 0x%X\n",
marker, bytestream2_tell(&s->g) - 4);
bytestream2_skip(&s->g, len - 2);
break;
}
if (bytestream2_tell(&s->g) - oldpos != len || ret) {
av_log(s->avctx, AV_LOG_ERROR,
- "error during processing marker segment %.4x\n", marker);
+ "error during processing marker segment %.4"PRIx16"\n",
+ marker);
return ret ? ret : -1;
}
}
* @author Nathan Caldwell
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "get_bits.h"
#include "mathops.h"
if (read > length)
av_log(l->avctx, AV_LOG_WARNING,
- "Output more bytes than length (%d of %d)\n", read,
+ "Output more bytes than length (%d of %"PRIu32")\n", read,
length);
} else if (esc_count < 8) {
esc_count -= 4;
break;
default:
av_log(avctx, AV_LOG_ERROR,
- "Unsupported Lagarith frame type: %#x\n", frametype);
+ "Unsupported Lagarith frame type: %#"PRIu8"\n", frametype);
return -1;
}
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
#include <math.h>
#include <stdint.h>
for (;;) {
if (!props->tag) {
- av_log(avctx, AV_LOG_ERROR, "Could not find tag %08X\n", tag);
+ av_log(avctx, AV_LOG_ERROR, "Could not find tag %08"PRIX32"\n", tag);
return AVERROR_INVALIDDATA;
}
if (props->tag == tag) {
* Apple MJPEG-B decoder.
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "mjpeg.h"
#include "mjpegdec.h"
}
field_size = get_bits_long(&hgb, 32); /* field size */
- av_log(avctx, AV_LOG_DEBUG, "field size: 0x%x\n", field_size);
+ av_log(avctx, AV_LOG_DEBUG, "field size: 0x%"PRIx32"\n", field_size);
skip_bits(&hgb, 32); /* padded field size */
second_field_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "second_field_offs is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%x\n", second_field_offs);
+ av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%"PRIx32"\n",
+ second_field_offs);
dqt_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dqt is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%x\n", dqt_offs);
+ av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%"PRIx32"\n", dqt_offs);
if (dqt_offs)
{
init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
}
dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%x\n", dht_offs);
+ av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%"PRIx32"\n", dht_offs);
if (dht_offs)
{
init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - (buf_ptr+dht_offs))*8);
}
sof_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%x\n", sof_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%"PRIx32"\n", sof_offs);
if (sof_offs)
{
init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
}
sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%x\n", sos_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%"PRIx32"\n", sos_offs);
sod_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%"PRIx32"\n", sod_offs);
if (sos_offs)
{
init_get_bits(&s->gb, buf_ptr + sos_offs,
* MPEG-1/2 decoder
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavutil/stereo3d.h"
}
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "pde (%"PRId16",%"PRId16") (%"PRId16",%"PRId16") (%"PRId16",%"PRId16")\n",
s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
s1->pan_scan.position[2][0], s1->pan_scan.position[2][1]);
input_size = buf_end - buf_ptr;
if (avctx->debug & FF_DEBUG_STARTCODE)
- av_log(avctx, AV_LOG_DEBUG, "%3X at %td left %d\n",
+ av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %td left %d\n",
start_code, buf_ptr - buf, input_size);
/* prepare data for next start code */
* Common functions for Microsoft Screen 1 and 2
*/
+#include <inttypes.h>
+
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
if (AV_RB32(avctx->extradata) < avctx->extradata_size) {
av_log(avctx, AV_LOG_ERROR,
- "Insufficient extradata size: expected %d got %d\n",
+ "Insufficient extradata size: expected %"PRIu32" got %d\n",
AV_RB32(avctx->extradata),
avctx->extradata_size);
return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
}
- av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "Encoder version %"PRIu32".%"PRIu32"\n",
AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
if (version != AV_RB32(avctx->extradata + 4) > 1) {
av_log(avctx, AV_LOG_ERROR,
}
av_log(avctx, AV_LOG_DEBUG, "%d free colour(s)\n", c->free_colours);
- av_log(avctx, AV_LOG_DEBUG, "Display dimensions %dx%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "Display dimensions %"PRIu32"x%"PRIu32"\n",
AV_RB32(avctx->extradata + 12), AV_RB32(avctx->extradata + 16));
av_log(avctx, AV_LOG_DEBUG, "Coded dimensions %dx%d\n",
avctx->coded_width, avctx->coded_height);
av_log(avctx, AV_LOG_DEBUG, "%g frames per second\n",
av_int2float(AV_RB32(avctx->extradata + 28)));
- av_log(avctx, AV_LOG_DEBUG, "Bitrate %d bps\n",
+ av_log(avctx, AV_LOG_DEBUG, "Bitrate %"PRIu32" bps\n",
AV_RB32(avctx->extradata + 32));
av_log(avctx, AV_LOG_DEBUG, "Max. lead time %g ms\n",
av_int2float(AV_RB32(avctx->extradata + 36)));
* RV10/RV20 decoder
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
#include "avcodec.h"
if (avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id,
- avctx->extradata_size >= 4 ? ((uint32_t *) avctx->extradata)[0]
- : -1);
+ avctx->extradata_size >= 4 ? ((int *) avctx->extradata)[0] : -1);
}
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
* http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "internal.h"
#include "avcodec.h"
vlc = svq3_get_ue_golomb(&h->gb);
if (vlc >= 25) {
- av_log(h->avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR,
+ "luma prediction:%"PRIu32"\n", vlc);
return -1;
}
if (!IS_INTRA16x16(mb_type) &&
(!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B)) {
if ((vlc = svq3_get_ue_golomb(&h->gb)) >= 48) {
- av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%"PRIu32"\n", vlc);
return -1;
}
}
if ((slice_id = svq3_get_ue_golomb(&h->gb)) >= 3) {
- av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %d \n", slice_id);
+ av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %u \n", slice_id);
return -1;
}
return -1;
buf = av_malloc(buf_len);
- av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "watermark size: %ux%u\n",
watermark_width, watermark_height);
av_log(avctx, AV_LOG_DEBUG,
"u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n",
s->watermark_key = ff_svq1_packet_checksum(buf, buf_len, 0);
s->watermark_key = s->watermark_key << 16 | s->watermark_key;
av_log(avctx, AV_LOG_DEBUG,
- "watermark key %#x\n", s->watermark_key);
+ "watermark key %#"PRIx32"\n", s->watermark_key);
av_free(buf);
#else
av_log(avctx, AV_LOG_ERROR,
* Duck TrueMotion2 decoder.
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
case TM2_NEW_HEADER_MAGIC:
return 0;
default:
- av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
+ av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08"PRIX32"\n",
+ magic);
return AVERROR_INVALIDDATA;
}
}
* TechSmith Screen Codec 2 decoder
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "get_bits.h"
bytestream2_init(&gb, buf, buf_size);
frame_type = bytestream2_get_byte(&gb);
if (frame_type > 1) {
- av_log(avctx, AV_LOG_ERROR, "Incorrect frame type %d\n", frame_type);
+ av_log(avctx, AV_LOG_ERROR, "Incorrect frame type %"PRIu32"\n",
+ frame_type);
return AVERROR_INVALIDDATA;
}
}
}
if (bytestream2_get_bytes_left(&gb) < size) {
- av_log(avctx, AV_LOG_ERROR, "Invalid slice size (%d/%d)\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid slice size (%"PRIu32"/%u)\n",
size, bytestream2_get_bytes_left(&gb));
return AVERROR_INVALIDDATA;
}
* Ut Video decoder
*/
+#include <inttypes.h>
#include <stdlib.h>
#include "libavutil/intreadwrite.h"
return AVERROR_INVALIDDATA;
}
c->frame_info = bytestream2_get_le32u(&gb);
- av_log(avctx, AV_LOG_DEBUG, "frame information flags %X\n", c->frame_info);
+ av_log(avctx, AV_LOG_DEBUG, "frame information flags %"PRIX32"\n",
+ c->frame_info);
c->frame_pred = (c->frame_info >> 8) & 3;
if (c->frame_info_size != 4)
avpriv_request_sample(avctx, "Frame info not 4 bytes");
- av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08X\n", c->flags);
+ av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08"PRIX32"\n", c->flags);
c->slices = (c->flags >> 24) + 1;
c->compression = c->flags & 1;
c->interlaced = c->flags & 0x800;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
avpriv_report_missing_feature(avctx, "Bit-depth higher than 16");
return AVERROR_PATCHWELCOME;
} else {
- av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %"PRIu8"\n",
s->bits_per_sample);
return AVERROR_INVALIDDATA;
}
s->bV3RTM = s->decode_flags & 0x100;
if (s->max_num_subframes > MAX_SUBFRAMES) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %"PRIu8"\n",
s->max_num_subframes);
return AVERROR_INVALIDDATA;
}
}
if (s->num_channels < 0) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of channels %"PRId8"\n",
s->num_channels);
return AVERROR_INVALIDDATA;
} else if (s->num_channels > WMALL_MAX_CHANNELS) {
++chan->num_subframes;
if (num_samples[c] > s->samples_per_frame) {
av_log(s->avctx, AV_LOG_ERROR, "broken frame: "
- "channel len(%d) > samples_per_frame(%d)\n",
+ "channel len(%"PRIu16") > samples_per_frame(%"PRIu16")\n",
num_samples[c], s->samples_per_frame);
return AVERROR_INVALIDDATA;
}
if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
/* FIXME: not sure if this is always an error */
av_log(s->avctx, AV_LOG_ERROR,
- "frame[%i] would have to skip %i bits\n", s->frame_num,
+ "frame[%"PRIu32"] would have to skip %i bits\n",
+ s->frame_num,
len - (get_bits_count(gb) - s->frame_offset) - 1);
s->packet_loss = 1;
return 0;
if (!s->packet_loss &&
((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
s->packet_loss = 1;
- av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Packet loss detected! seq %"PRIx8" vs %x\n",
s->packet_sequence_number, packet_sequence_number);
}
s->packet_sequence_number = packet_sequence_number;
* subframe in order to reconstruct the output samples.
*/
+#include <inttypes.h>
+
#include "libavutil/float_dsp.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
s->dynamic_range_compression = (s->decode_flags & 0x80);
if (s->max_num_subframes > MAX_SUBFRAMES) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %"PRId8"\n",
s->max_num_subframes);
return AVERROR_INVALIDDATA;
}
if (s->min_samples_per_subframe < WMAPRO_BLOCK_MIN_SIZE) {
- av_log(avctx, AV_LOG_ERROR, "Invalid minimum block size %i\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid minimum block size %"PRId8"\n",
s->max_num_subframes);
return AVERROR_INVALIDDATA;
}
if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
/** FIXME: not sure if this is always an error */
av_log(s->avctx, AV_LOG_ERROR,
- "frame[%i] would have to skip %i bits\n", s->frame_num,
+ "frame[%"PRIu32"] would have to skip %i bits\n",
+ s->frame_num,
len - (get_bits_count(gb) - s->frame_offset) - 1);
s->packet_loss = 1;
return 0;
if (!s->packet_loss &&
((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
s->packet_loss = 1;
- av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Packet loss detected! seq %"PRIx8" vs %x\n",
s->packet_sequence_number, packet_sequence_number);
}
s->packet_sequence_number = packet_sequence_number;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
ncolors = bytestream2_get_be32u(&gb);
bytestream2_skipu(&gb, header_size - (XWD_HEADER_SIZE - 20));
- av_log(avctx, AV_LOG_DEBUG, "pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d\n",
+ av_log(avctx, AV_LOG_DEBUG,
+ "pixformat %"PRIu32", pixdepth %"PRIu32", bunit %"PRIu32", bitorder %"PRIu32", bpad %"PRIu32"\n",
pixformat, pixdepth, bunit, bitorder, bpad);
- av_log(avctx, AV_LOG_DEBUG, "vclass %d, ncolors %d, bpp %d, be %d, lsize %d, xoffset %d\n",
+ av_log(avctx, AV_LOG_DEBUG,
+ "vclass %"PRIu32", ncolors %"PRIu32", bpp %"PRIu32", be %"PRIu32", lsize %"PRIu32", xoffset %"PRIu32"\n",
vclass, ncolors, bpp, be, lsize, xoffset);
av_log(avctx, AV_LOG_DEBUG, "red %0x, green %0x, blue %0x\n", rgb[0], rgb[1], rgb[2]);
}
if (xoffset) {
- avpriv_request_sample(avctx, "xoffset %d", xoffset);
+ avpriv_request_sample(avctx, "xoffset %"PRIu32"", xoffset);
return AVERROR_PATCHWELCOME;
}
}
if (pixformat != XWD_Z_PIXMAP) {
- av_log(avctx, AV_LOG_ERROR, "pixmap format %d unsupported\n", pixformat);
+ av_log(avctx, AV_LOG_ERROR, "pixmap format %"PRIu32" unsupported\n", pixformat);
return AVERROR_PATCHWELCOME;
}
if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
avpriv_request_sample(avctx,
- "Unknown file: bpp %d, pixdepth %d, vclass %d",
+ "Unknown file: bpp %"PRIu32", pixdepth %"PRIu32", vclass %"PRIu32"",
bpp, pixdepth, vclass);
return AVERROR_PATCHWELCOME;
}