diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-11 21:05:34 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-11 21:05:34 +0100 |
commit | 28ee7757f5b0859510e3af6bf49fca9881f09966 (patch) | |
tree | 6b6e7ab386a73b664aac3ce21c4ee0d3dff38d4a /libavformat | |
parent | 5171ae781a240cac3860c20f9aefc6d1b2c61cac (diff) | |
parent | d92024f18fa3d69937cb2575f3a8bf973df02430 (diff) | |
download | ffmpeg-28ee7757f5b0859510e3af6bf49fca9881f09966.tar.gz |
Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'
* commit 'd92024f18fa3d69937cb2575f3a8bf973df02430':
lavf: more correct printf format specifiers
Conflicts:
libavformat/asfdec.c
libavformat/cafdec.c
libavformat/dxa.c
libavformat/framecrcenc.c
libavformat/hnm.c
libavformat/iff.c
libavformat/mov.c
libavformat/mxfdec.c
libavformat/rmdec.c
libavformat/rpl.c
libavformat/smacker.c
libavformat/xmv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/apetag.c | 6 | ||||
-rw-r--r-- | libavformat/asfdec.c | 8 | ||||
-rw-r--r-- | libavformat/avidec.c | 4 | ||||
-rw-r--r-- | libavformat/bink.c | 10 | ||||
-rw-r--r-- | libavformat/cafdec.c | 5 | ||||
-rw-r--r-- | libavformat/crcenc.c | 4 | ||||
-rw-r--r-- | libavformat/dfa.c | 7 | ||||
-rw-r--r-- | libavformat/dxa.c | 5 | ||||
-rw-r--r-- | libavformat/electronicarts.c | 8 | ||||
-rw-r--r-- | libavformat/framecrcenc.c | 4 | ||||
-rw-r--r-- | libavformat/gxf.c | 6 | ||||
-rw-r--r-- | libavformat/hnm.c | 11 | ||||
-rw-r--r-- | libavformat/iff.c | 4 | ||||
-rw-r--r-- | libavformat/lxfdec.c | 9 | ||||
-rw-r--r-- | libavformat/matroskadec.c | 3 | ||||
-rw-r--r-- | libavformat/mov.c | 5 | ||||
-rw-r--r-- | libavformat/mvi.c | 5 | ||||
-rw-r--r-- | libavformat/mxfdec.c | 17 | ||||
-rw-r--r-- | libavformat/omadec.c | 8 | ||||
-rw-r--r-- | libavformat/rmdec.c | 4 | ||||
-rw-r--r-- | libavformat/rpl.c | 5 | ||||
-rw-r--r-- | libavformat/smacker.c | 8 | ||||
-rw-r--r-- | libavformat/smjpegdec.c | 8 | ||||
-rw-r--r-- | libavformat/spdifenc.c | 8 | ||||
-rw-r--r-- | libavformat/wtvdec.c | 6 | ||||
-rw-r--r-- | libavformat/xmv.c | 6 |
26 files changed, 117 insertions, 57 deletions
diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 6e59bc7de1..7d2f0b3222 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "libavutil/dict.h" #include "avformat.h" @@ -139,14 +141,14 @@ int64_t ff_ape_parse_tag(AVFormatContext *s) } if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) { - av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes); + av_log(s, AV_LOG_ERROR, "Invalid tag size %"PRIu32".\n", tag_bytes); return 0; } tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES; fields = avio_rl32(pb); /* number of fields */ if (fields > 65536) { - av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields); + av_log(s, AV_LOG_ERROR, "Too many tag fields (%"PRIu32")\n", fields); return 0; } diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 52773ae57e..0e7e910cd8 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/avstring.h" @@ -943,13 +945,13 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) // the following checks prevent overflows and infinite loops if (!packet_length || packet_length >= (1U << 29)) { av_log(s, AV_LOG_ERROR, - "invalid packet_length %d at:%"PRId64"\n", + "invalid packet_length %"PRIu32" at:%"PRId64"\n", packet_length, avio_tell(pb)); return AVERROR_INVALIDDATA; } if (padsize >= packet_length) { av_log(s, AV_LOG_ERROR, - "invalid padsize %d at:%"PRId64"\n", padsize, avio_tell(pb)); + "invalid padsize %"PRIu32" at:%"PRId64"\n", padsize, avio_tell(pb)); return AVERROR_INVALIDDATA; } @@ -968,7 +970,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) if (rsize > packet_length - padsize) { asf->packet_size_left = 0; av_log(s, AV_LOG_ERROR, - "invalid packet header length %d for pktlen %d-%d at %"PRId64"\n", + "invalid packet header length %d for pktlen %"PRIu32"-%"PRIu32" at %"PRId64"\n", rsize, packet_length, padsize, avio_tell(pb)); return AVERROR_INVALIDDATA; } diff --git a/libavformat/avidec.c b/libavformat/avidec.c index a4666361de..0a837d4e5a 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <stdint.h> +#include <inttypes.h> #include "libavutil/avassert.h" #include "libavutil/avstring.h" @@ -597,7 +597,7 @@ static int avi_read_header(AVFormatContext *s) ast->rate = avio_rl32(pb); if (!(ast->scale && ast->rate)) { av_log(s, AV_LOG_WARNING, - "scale/rate is %u/%u which is invalid. " + "scale/rate is %"PRIu32"/%"PRIu32" which is invalid. " "(This file has been generated by broken software.)\n", ast->scale, ast->rate); diff --git a/libavformat/bink.c b/libavformat/bink.c index ec9257bca2..395c8d9aa8 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -28,6 +28,8 @@ * http://wiki.multimedia.cx/index.php?title=Bink_Container */ +#include <inttypes.h> + #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" @@ -111,7 +113,9 @@ static int read_header(AVFormatContext *s) fps_num = avio_rl32(pb); fps_den = avio_rl32(pb); if (fps_num == 0 || fps_den == 0) { - av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den); + av_log(s, AV_LOG_ERROR, + "invalid header: invalid fps (%"PRIu32"/%"PRIu32")\n", + fps_num, fps_den); return AVERROR(EIO); } avpriv_set_pts_info(vst, 64, fps_den, fps_num); @@ -132,7 +136,7 @@ static int read_header(AVFormatContext *s) if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) { av_log(s, AV_LOG_ERROR, - "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n", + "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%"PRIu32")\n", bink->num_audio_tracks); return AVERROR(EIO); } @@ -226,7 +230,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) uint32_t audio_size = avio_rl32(pb); if (audio_size > bink->remain_packet_size - 4) { av_log(s, AV_LOG_ERROR, - "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n", + "frame %"PRId64": audio size in header (%"PRIu32") > size of packet left (%"PRIu32")\n", bink->video_pts, audio_size, bink->remain_packet_size); return AVERROR(EIO); } diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 0b5d59cdae..04aa4dc563 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -25,6 +25,8 @@ * Core Audio Format demuxer */ +#include <inttypes.h> + #include "avformat.h" #include "internal.h" #include "isom.h" @@ -285,7 +287,8 @@ static int read_header(AVFormatContext *s) default: #define _(x) ((x) >= ' ' ? (x) : ' ') - av_log(s, AV_LOG_WARNING, "skipping CAF chunk: %08X (%c%c%c%c), size %"PRId64"\n", + av_log(s, AV_LOG_WARNING, + "skipping CAF chunk: %08"PRIX32" (%"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8"), size %"PRId64"\n", tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF), size); #undef _ case MKBETAG('f','r','e','e'): diff --git a/libavformat/crcenc.c b/libavformat/crcenc.c index ac0638037e..3fdfea5207 100644 --- a/libavformat/crcenc.c +++ b/libavformat/crcenc.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/adler32.h" #include "avformat.h" @@ -48,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s) CRCState *crc = s->priv_data; char buf[64]; - snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval); + snprintf(buf, sizeof(buf), "CRC=0x%08"PRIx32"\n", crc->crcval); avio_write(s->pb, buf, strlen(buf)); return 0; diff --git a/libavformat/dfa.c b/libavformat/dfa.c index 9cd13e24d9..dfa0590e2e 100644 --- a/libavformat/dfa.c +++ b/libavformat/dfa.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -98,12 +100,13 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt) first = 0; frame_size = AV_RL32(pkt->data + pkt->size - 8); if (frame_size > INT_MAX - 4) { - av_log(s, AV_LOG_ERROR, "Too large chunk size: %d\n", frame_size); + av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size); return AVERROR(EIO); } if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) { if (frame_size) { - av_log(s, AV_LOG_WARNING, "skipping %d bytes of end-of-frame marker chunk\n", + av_log(s, AV_LOG_WARNING, + "skipping %"PRIu32" bytes of end-of-frame marker chunk\n", frame_size); avio_skip(pb, frame_size); } diff --git a/libavformat/dxa.c b/libavformat/dxa.c index 5b2d7c0cbe..ea5b4f7163 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -196,7 +198,8 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) } size = AV_RB32(buf + 5); if(size > 0xFFFFFF){ - av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size); + av_log(s, AV_LOG_ERROR, "Frame size is too big: %"PRIu32"\n", + size); return AVERROR_INVALIDDATA; } if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 4ba0fa0b61..1acaa14c8c 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -25,6 +25,8 @@ * by Robin Kay (komadori at gekkou.co.uk) */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -152,7 +154,7 @@ static int process_audio_header_elements(AVFormatContext *s) break; case 0x8A: av_log(s, AV_LOG_DEBUG, - "element 0x%02x set to 0x%08x\n", + "element 0x%02x set to 0x%08"PRIx32"\n", subbyte, read_arbitrary(pb)); av_log(s, AV_LOG_DEBUG, "exited audio subheader\n"); in_subheader = 0; @@ -171,7 +173,7 @@ static int process_audio_header_elements(AVFormatContext *s) break; default: av_log(s, AV_LOG_DEBUG, - "element 0x%02x set to 0x%08x\n", + "element 0x%02x set to 0x%08"PRIx32"\n", subbyte, read_arbitrary(pb)); break; } @@ -183,7 +185,7 @@ static int process_audio_header_elements(AVFormatContext *s) break; default: av_log(s, AV_LOG_DEBUG, - "header element 0x%02x set to 0x%08x\n", + "header element 0x%02x set to 0x%08"PRIx32"\n", byte, read_arbitrary(pb)); break; } diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c index dbe49b5ba1..4a96083953 100644 --- a/libavformat/framecrcenc.c +++ b/libavformat/framecrcenc.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/adler32.h" #include "libavutil/avstring.h" #include "avformat.h" @@ -29,7 +31,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) uint32_t crc = av_adler32_update(0, pkt->data, pkt->size); char buf[256]; - snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x", + snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08"PRIx32, pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc); if (pkt->flags != AV_PKT_FLAG_KEY) av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); diff --git a/libavformat/gxf.c b/libavformat/gxf.c index c36479a821..479a8fb394 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "avformat.h" @@ -293,7 +295,9 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) { } st = s->streams[0]; if (map_cnt > 1000) { - av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt); + av_log(s, AV_LOG_ERROR, + "too many index entries %"PRIu32" (%"PRIx32")\n", + map_cnt, map_cnt); map_cnt = 1000; } if (pkt_len < 4 * map_cnt) { diff --git a/libavformat/hnm.c b/libavformat/hnm.c index 47a1808afb..8c381021c5 100644 --- a/libavformat/hnm.c +++ b/libavformat/hnm.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -149,8 +151,9 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) avio_skip(pb, 2); if (chunk_size > hnm->superchunk_remaining || !chunk_size) { - av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n", - chunk_size, (int) avio_tell(pb)); + av_log(s, AV_LOG_ERROR, + "invalid chunk size: %"PRIu32", offset: %"PRId64"\n", + chunk_size, avio_tell(pb)); avio_skip(pb, hnm->superchunk_remaining - 8); hnm->superchunk_remaining = 0; } @@ -172,8 +175,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) break; default: - av_log(s, AV_LOG_WARNING, "unknown chunk found: %d, offset: %d\n", - chunk_id, (int) avio_tell(pb)); + av_log(s, AV_LOG_WARNING, "unknown chunk found: %"PRIu16", offset: %"PRId64"\n", + chunk_id, avio_tell(pb)); avio_skip(pb, chunk_size - 8); hnm->superchunk_remaining -= chunk_size; break; diff --git a/libavformat/iff.c b/libavformat/iff.c index 3838db116c..5fba77d0b8 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -28,6 +28,8 @@ * http://wiki.multimedia.cx/index.php?title=IFF */ +#include <inttypes.h> + #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" @@ -251,7 +253,7 @@ static int iff_read_header(AVFormatContext *s) case ID_CMAP: if (data_size < 3 || data_size > 768 || data_size % 3) { - av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n", + av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %"PRIu32"\n", data_size); return AVERROR_INVALIDDATA; } diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index f0a96396b4..19f7f27385 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/intreadwrite.h" #include "libavcodec/bytestream.h" #include "avformat.h" @@ -128,12 +130,12 @@ static int get_packet_header(AVFormatContext *s) version = bytestream_get_le32(&p); header_size = bytestream_get_le32(&p); if (version > 1) - avpriv_request_sample(s, "Unknown format version %i\n", version); + avpriv_request_sample(s, "Unknown format version %"PRIu32"\n", version); if (header_size < (version ? 72 : 60) || header_size > LXF_MAX_PACKET_HEADER_SIZE || (header_size & 3)) { - av_log(s, AV_LOG_ERROR, "Invalid header size 0x%x\n", header_size); + av_log(s, AV_LOG_ERROR, "Invalid header size 0x%"PRIx32"\n", header_size); return AVERROR_INVALIDDATA; } @@ -301,7 +303,8 @@ static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt) stream = lxf->packet_type; if (stream > 1) { - av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream); + av_log(s, AV_LOG_WARNING, + "got packet with illegal stream index %"PRIu32"\n", stream); return AVERROR(EAGAIN); } diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index d0066b908e..4390b6bb99 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -30,6 +30,7 @@ #include "config.h" +#include <inttypes.h> #include <stdio.h> #if CONFIG_BZLIB #include <bzlib.h> @@ -921,7 +922,7 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, matroska->levels[matroska->num_levels - 1].length == 0xffffffffffffff) return 0; // we reached the end of an unknown size cluster if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) { - av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); + av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%"PRIX32"\n", id); if (matroska->ctx->error_recognition & AV_EF_EXPLODE) return AVERROR_INVALIDDATA; } diff --git a/libavformat/mov.c b/libavformat/mov.c index c14e3c15e5..7570234673 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -23,6 +23,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> #include <limits.h> #include <stdint.h> @@ -767,7 +768,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); av_dict_set(&c->fc->metadata, "major_brand", type, 0); minor_ver = avio_rb32(pb); /* minor version */ - snprintf(minor_ver_str, sizeof(minor_ver_str), "%d", minor_ver); + snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver); av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0); comp_brand_size = atom.size - 8; @@ -1649,7 +1650,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) id = mov_codec_id(st, format); - av_dlog(c->fc, "size=%"PRId64" 4CC= %c%c%c%c codec_type=%d\n", size, + av_dlog(c->fc, "size=%"PRId64" 4CC= %"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8" codec_type=%d\n", size, (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 24) & 0xff, st->codec->codec_type); diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 5efc443152..a7cfcb9a7a 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" @@ -95,7 +97,8 @@ static int read_header(AVFormatContext *s) mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count; if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) { - av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n", + av_log(s, AV_LOG_ERROR, + "Invalid audio_data_size (%"PRIu32") or frames_count (%u)\n", mvi->audio_data_size, frames_count); return AVERROR_INVALIDDATA; } diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index ad622f05b6..c08a796844 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -43,7 +43,7 @@ * Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1 */ -#include <stdint.h> +#include <inttypes.h> #include "libavutil/aes.h" #include "libavutil/avassert.h" @@ -542,8 +542,10 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size /* only nag once */ if (!mxf->op) - av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming %s\n", - nb_essence_containers, op == OP1a ? "OP1a" : "OPAtom"); + av_log(mxf->fc, AV_LOG_WARNING, + "\"OPAtom\" with %"PRIu32" ECs - assuming %s\n", + nb_essence_containers, + op == OP1a ? "OP1a" : "OPAtom"); mxf->op = op; } else @@ -554,14 +556,15 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size } if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) { - av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %i - guessing ", partition->kag_size); + av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %"PRId32" - guessing ", + partition->kag_size); if (mxf->op == OPSONYOpt) partition->kag_size = 512; else partition->kag_size = 1; - av_log(mxf->fc, AV_LOG_WARNING, "%i\n", partition->kag_size); + av_log(mxf->fc, AV_LOG_WARNING, "%"PRId32"\n", partition->kag_size); } return 0; @@ -2324,7 +2327,9 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) AVCodecContext *codec; if (index < 0) { - av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12)); + av_log(s, AV_LOG_ERROR, + "error getting stream index %"PRIu32"\n", + AV_RB32(klv.key + 12)); goto skip; } diff --git a/libavformat/omadec.c b/libavformat/omadec.c index dc6a12af3c..9f0d52087c 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -40,6 +40,8 @@ * Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM */ +#include <inttypes.h> + #include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" @@ -215,7 +217,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) if (geob->datasize < 64) { av_log(s, AV_LOG_ERROR, - "Invalid GEOB data size: %u\n", geob->datasize); + "Invalid GEOB data size: %"PRIu32"\n", geob->datasize); return AVERROR_INVALIDDATA; } @@ -239,7 +241,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) return AVERROR_INVALIDDATA; } oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]); - av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid); + av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid); memcpy(oc->iv, &header[0x58], 8); hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8); @@ -366,7 +368,7 @@ static int oma_read_header(AVFormatContext *s) channel_id = (codec_params >> 10) & 7; if (!channel_id) { av_log(s, AV_LOG_ERROR, - "Invalid ATRAC-X channel id: %d\n", channel_id); + "Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id); return AVERROR_INVALIDDATA; } st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1]; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index b62f8e0628..1775d6cdfb 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <inttypes.h> + #include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" @@ -279,7 +281,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, case DEINT_ID_VBRF: break; default: - av_log(s, AV_LOG_ERROR, "Unknown interleaver %X\n", ast->deint_id); + av_log(s, AV_LOG_ERROR ,"Unknown interleaver %"PRIX32"\n", ast->deint_id); return AVERROR_INVALIDDATA; } if (ast->deint_id == DEINT_ID_INT4 || diff --git a/libavformat/rpl.c b/libavformat/rpl.c index fb60379d3f..46a5796414 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <stdint.h> +#include <inttypes.h> #include <stdlib.h> #include "libavutil/avstring.h" @@ -222,7 +222,8 @@ static int rpl_read_header(AVFormatContext *s) break; } if (ast->codec->codec_id == AV_CODEC_ID_NONE) - avpriv_request_sample(s, "Audio format %i", audio_format); + avpriv_request_sample(s, "Audio format %"PRId32, + audio_format); avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate); } else { for (i = 0; i < 3; i++) diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 0d38588e21..46215ee73d 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -23,6 +23,8 @@ * Based on http://wiki.multimedia.cx/index.php?title=Smacker */ +#include <inttypes.h> + #include "libavutil/bswap.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" @@ -142,7 +144,7 @@ static int smacker_read_header(AVFormatContext *s) smk->pad = avio_rl32(pb); /* setup data */ if(smk->frames > 0xFFFFFF) { - av_log(s, AV_LOG_ERROR, "Too many frames: %i\n", smk->frames); + av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n", smk->frames); return AVERROR_INVALIDDATA; } smk->frm_size = av_malloc_array(smk->frames, sizeof(*smk->frm_size)); @@ -221,7 +223,9 @@ static int smacker_read_header(AVFormatContext *s) /* load trees to extradata, they will be unpacked by decoder */ if(ff_alloc_extradata(st->codec, smk->treesize + 16)){ - av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16); + av_log(s, AV_LOG_ERROR, + "Cannot allocate %"PRIu32" bytes of extradata\n", + smk->treesize + 16); av_freep(&smk->frm_size); av_freep(&smk->frm_flags); return AVERROR(ENOMEM); diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c index 38ac2fb086..e4c7a9b890 100644 --- a/libavformat/smjpegdec.c +++ b/libavformat/smjpegdec.c @@ -24,6 +24,8 @@ * This is a demuxer for Loki SDL Motion JPEG files */ +#include <inttypes.h> + #include "avformat.h" #include "internal.h" #include "riff.h" @@ -52,7 +54,7 @@ static int smjpeg_read_header(AVFormatContext *s) avio_skip(pb, 8); // magic version = avio_rb32(pb); if (version) - avpriv_request_sample(s, "Unknown version %d", version); + avpriv_request_sample(s, "Unknown version %"PRIu32, version); duration = avio_rb32(pb); // in msec @@ -124,7 +126,7 @@ static int smjpeg_read_header(AVFormatContext *s) case SMJPEG_HEND: return 0; default: - av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype); + av_log(s, AV_LOG_ERROR, "unknown header %"PRIx32"\n", htype); return AVERROR_INVALIDDATA; } } @@ -164,7 +166,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt) ret = AVERROR_EOF; break; default: - av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype); + av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", dtype); ret = AVERROR_INVALIDDATA; break; } diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 210d63f39c..18afd42801 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -44,6 +44,8 @@ * dependent from data-type (spaces between packets are filled by zeros) */ +#include <inttypes.h> + #include "avformat.h" #include "avio_internal.h" #include "spdif.h" @@ -274,7 +276,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n"); return AVERROR_INVALIDDATA; default: - av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts); + av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%"PRIx32"\n", syncword_dts); return AVERROR_INVALIDDATA; } blocks++; @@ -369,8 +371,8 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096; break; default: - av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n", - hdr.samples); + av_log(s, AV_LOG_ERROR, + "%"PRIu32" samples in AAC frame not supported\n", hdr.samples); return AVERROR(EINVAL); } //TODO Data type dependent info (LC profile/SBR) diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 21236fa952..834198fe59 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -25,6 +25,8 @@ * @author Peter Ross <pross@xvid.org> */ +#include <inttypes.h> + #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" @@ -35,7 +37,7 @@ /* Macros for formating GUIDs */ #define PRI_PRETTY_GUID \ - "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x" + "%08"PRIx32"-%04"PRIx16"-%04"PRIx16"-%02x%02x%02x%02x%02x%02x%02x%02x" #define ARG_PRETTY_GUID(g) \ AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15] #define LEN_PRETTY_GUID 34 @@ -471,7 +473,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty return; if (type == 0 && length == 4) { - snprintf(buf, buf_size, "%"PRIi32, avio_rl32(pb)); + snprintf(buf, buf_size, "%u", avio_rl32(pb)); } else if (type == 1) { avio_get_str16le(pb, length, buf, buf_size); if (!strlen(buf)) { diff --git a/libavformat/xmv.c b/libavformat/xmv.c index 20f9bea55b..705a302f0b 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -25,7 +25,7 @@ * Microsoft XMV demuxer */ -#include <stdint.h> +#include <inttypes.h> #include "libavutil/intreadwrite.h" @@ -155,7 +155,7 @@ static int xmv_read_header(AVFormatContext *s) file_version = avio_rl32(pb); if ((file_version != 4) && (file_version != 2)) - avpriv_request_sample(s, "Uncommon version %d", file_version); + avpriv_request_sample(s, "Uncommon version %"PRIu32"", file_version); /* Video track */ @@ -219,7 +219,7 @@ static int xmv_read_header(AVFormatContext *s) if (!packet->channels || !packet->sample_rate || packet->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) { - av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %d.\n", + av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %"PRIu16".\n", audio_track); ret = AVERROR_INVALIDDATA; goto fail; |