* 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>
... | ... |
@@ -20,6 +20,8 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include <inttypes.h> |
|
24 |
+ |
|
23 | 25 |
#include "libavutil/intreadwrite.h" |
24 | 26 |
#include "libavutil/dict.h" |
25 | 27 |
#include "avformat.h" |
... | ... |
@@ -139,14 +141,14 @@ int64_t ff_ape_parse_tag(AVFormatContext *s) |
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) { |
142 |
- av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes); |
|
142 |
+ av_log(s, AV_LOG_ERROR, "Invalid tag size %"PRIu32".\n", tag_bytes); |
|
143 | 143 |
return 0; |
144 | 144 |
} |
145 | 145 |
tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES; |
146 | 146 |
|
147 | 147 |
fields = avio_rl32(pb); /* number of fields */ |
148 | 148 |
if (fields > 65536) { |
149 |
- av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields); |
|
149 |
+ av_log(s, AV_LOG_ERROR, "Too many tag fields (%"PRIu32")\n", fields); |
|
150 | 150 |
return 0; |
151 | 151 |
} |
152 | 152 |
|
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/attributes.h" |
23 | 25 |
#include "libavutil/avassert.h" |
24 | 26 |
#include "libavutil/avstring.h" |
... | ... |
@@ -943,13 +945,13 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) |
943 | 943 |
// the following checks prevent overflows and infinite loops |
944 | 944 |
if (!packet_length || packet_length >= (1U << 29)) { |
945 | 945 |
av_log(s, AV_LOG_ERROR, |
946 |
- "invalid packet_length %d at:%"PRId64"\n", |
|
946 |
+ "invalid packet_length %"PRIu32" at:%"PRId64"\n", |
|
947 | 947 |
packet_length, avio_tell(pb)); |
948 | 948 |
return AVERROR_INVALIDDATA; |
949 | 949 |
} |
950 | 950 |
if (padsize >= packet_length) { |
951 | 951 |
av_log(s, AV_LOG_ERROR, |
952 |
- "invalid padsize %d at:%"PRId64"\n", padsize, avio_tell(pb)); |
|
952 |
+ "invalid padsize %"PRIu32" at:%"PRId64"\n", padsize, avio_tell(pb)); |
|
953 | 953 |
return AVERROR_INVALIDDATA; |
954 | 954 |
} |
955 | 955 |
|
... | ... |
@@ -968,7 +970,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) |
968 | 968 |
if (rsize > packet_length - padsize) { |
969 | 969 |
asf->packet_size_left = 0; |
970 | 970 |
av_log(s, AV_LOG_ERROR, |
971 |
- "invalid packet header length %d for pktlen %d-%d at %"PRId64"\n", |
|
971 |
+ "invalid packet header length %d for pktlen %"PRIu32"-%"PRIu32" at %"PRId64"\n", |
|
972 | 972 |
rsize, packet_length, padsize, avio_tell(pb)); |
973 | 973 |
return AVERROR_INVALIDDATA; |
974 | 974 |
} |
... | ... |
@@ -19,7 +19,7 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
-#include <stdint.h> |
|
22 |
+#include <inttypes.h> |
|
23 | 23 |
|
24 | 24 |
#include "libavutil/avassert.h" |
25 | 25 |
#include "libavutil/avstring.h" |
... | ... |
@@ -597,7 +597,7 @@ static int avi_read_header(AVFormatContext *s) |
597 | 597 |
ast->rate = avio_rl32(pb); |
598 | 598 |
if (!(ast->scale && ast->rate)) { |
599 | 599 |
av_log(s, AV_LOG_WARNING, |
600 |
- "scale/rate is %u/%u which is invalid. " |
|
600 |
+ "scale/rate is %"PRIu32"/%"PRIu32" which is invalid. " |
|
601 | 601 |
"(This file has been generated by broken software.)\n", |
602 | 602 |
ast->scale, |
603 | 603 |
ast->rate); |
... | ... |
@@ -28,6 +28,8 @@ |
28 | 28 |
* http://wiki.multimedia.cx/index.php?title=Bink_Container |
29 | 29 |
*/ |
30 | 30 |
|
31 |
+#include <inttypes.h> |
|
32 |
+ |
|
31 | 33 |
#include "libavutil/channel_layout.h" |
32 | 34 |
#include "libavutil/intreadwrite.h" |
33 | 35 |
#include "avformat.h" |
... | ... |
@@ -111,7 +113,9 @@ static int read_header(AVFormatContext *s) |
111 | 111 |
fps_num = avio_rl32(pb); |
112 | 112 |
fps_den = avio_rl32(pb); |
113 | 113 |
if (fps_num == 0 || fps_den == 0) { |
114 |
- av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den); |
|
114 |
+ av_log(s, AV_LOG_ERROR, |
|
115 |
+ "invalid header: invalid fps (%"PRIu32"/%"PRIu32")\n", |
|
116 |
+ fps_num, fps_den); |
|
115 | 117 |
return AVERROR(EIO); |
116 | 118 |
} |
117 | 119 |
avpriv_set_pts_info(vst, 64, fps_den, fps_num); |
... | ... |
@@ -132,7 +136,7 @@ static int read_header(AVFormatContext *s) |
132 | 132 |
|
133 | 133 |
if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) { |
134 | 134 |
av_log(s, AV_LOG_ERROR, |
135 |
- "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n", |
|
135 |
+ "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%"PRIu32")\n", |
|
136 | 136 |
bink->num_audio_tracks); |
137 | 137 |
return AVERROR(EIO); |
138 | 138 |
} |
... | ... |
@@ -226,7 +230,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
226 | 226 |
uint32_t audio_size = avio_rl32(pb); |
227 | 227 |
if (audio_size > bink->remain_packet_size - 4) { |
228 | 228 |
av_log(s, AV_LOG_ERROR, |
229 |
- "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n", |
|
229 |
+ "frame %"PRId64": audio size in header (%"PRIu32") > size of packet left (%"PRIu32")\n", |
|
230 | 230 |
bink->video_pts, audio_size, bink->remain_packet_size); |
231 | 231 |
return AVERROR(EIO); |
232 | 232 |
} |
... | ... |
@@ -25,6 +25,8 @@ |
25 | 25 |
* Core Audio Format demuxer |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include <inttypes.h> |
|
29 |
+ |
|
28 | 30 |
#include "avformat.h" |
29 | 31 |
#include "internal.h" |
30 | 32 |
#include "isom.h" |
... | ... |
@@ -285,7 +287,8 @@ static int read_header(AVFormatContext *s) |
285 | 285 |
|
286 | 286 |
default: |
287 | 287 |
#define _(x) ((x) >= ' ' ? (x) : ' ') |
288 |
- av_log(s, AV_LOG_WARNING, "skipping CAF chunk: %08X (%c%c%c%c), size %"PRId64"\n", |
|
288 |
+ av_log(s, AV_LOG_WARNING, |
|
289 |
+ "skipping CAF chunk: %08"PRIX32" (%"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8"), size %"PRId64"\n", |
|
289 | 290 |
tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF), size); |
290 | 291 |
#undef _ |
291 | 292 |
case MKBETAG('f','r','e','e'): |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/adler32.h" |
23 | 25 |
#include "avformat.h" |
24 | 26 |
|
... | ... |
@@ -48,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s) |
48 | 48 |
CRCState *crc = s->priv_data; |
49 | 49 |
char buf[64]; |
50 | 50 |
|
51 |
- snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval); |
|
51 |
+ snprintf(buf, sizeof(buf), "CRC=0x%08"PRIx32"\n", crc->crcval); |
|
52 | 52 |
avio_write(s->pb, buf, strlen(buf)); |
53 | 53 |
|
54 | 54 |
return 0; |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/intreadwrite.h" |
23 | 25 |
#include "avformat.h" |
24 | 26 |
#include "internal.h" |
... | ... |
@@ -98,12 +100,13 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt) |
98 | 98 |
first = 0; |
99 | 99 |
frame_size = AV_RL32(pkt->data + pkt->size - 8); |
100 | 100 |
if (frame_size > INT_MAX - 4) { |
101 |
- av_log(s, AV_LOG_ERROR, "Too large chunk size: %d\n", frame_size); |
|
101 |
+ av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size); |
|
102 | 102 |
return AVERROR(EIO); |
103 | 103 |
} |
104 | 104 |
if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) { |
105 | 105 |
if (frame_size) { |
106 |
- av_log(s, AV_LOG_WARNING, "skipping %d bytes of end-of-frame marker chunk\n", |
|
106 |
+ av_log(s, AV_LOG_WARNING, |
|
107 |
+ "skipping %"PRIu32" bytes of end-of-frame marker chunk\n", |
|
107 | 108 |
frame_size); |
108 | 109 |
avio_skip(pb, frame_size); |
109 | 110 |
} |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/intreadwrite.h" |
23 | 25 |
#include "avformat.h" |
24 | 26 |
#include "internal.h" |
... | ... |
@@ -196,7 +198,8 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) |
196 | 196 |
} |
197 | 197 |
size = AV_RB32(buf + 5); |
198 | 198 |
if(size > 0xFFFFFF){ |
199 |
- av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size); |
|
199 |
+ av_log(s, AV_LOG_ERROR, "Frame size is too big: %"PRIu32"\n", |
|
200 |
+ size); |
|
200 | 201 |
return AVERROR_INVALIDDATA; |
201 | 202 |
} |
202 | 203 |
if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) |
... | ... |
@@ -25,6 +25,8 @@ |
25 | 25 |
* by Robin Kay (komadori at gekkou.co.uk) |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include <inttypes.h> |
|
29 |
+ |
|
28 | 30 |
#include "libavutil/intreadwrite.h" |
29 | 31 |
#include "avformat.h" |
30 | 32 |
#include "internal.h" |
... | ... |
@@ -152,7 +154,7 @@ static int process_audio_header_elements(AVFormatContext *s) |
152 | 152 |
break; |
153 | 153 |
case 0x8A: |
154 | 154 |
av_log(s, AV_LOG_DEBUG, |
155 |
- "element 0x%02x set to 0x%08x\n", |
|
155 |
+ "element 0x%02x set to 0x%08"PRIx32"\n", |
|
156 | 156 |
subbyte, read_arbitrary(pb)); |
157 | 157 |
av_log(s, AV_LOG_DEBUG, "exited audio subheader\n"); |
158 | 158 |
in_subheader = 0; |
... | ... |
@@ -171,7 +173,7 @@ static int process_audio_header_elements(AVFormatContext *s) |
171 | 171 |
break; |
172 | 172 |
default: |
173 | 173 |
av_log(s, AV_LOG_DEBUG, |
174 |
- "element 0x%02x set to 0x%08x\n", |
|
174 |
+ "element 0x%02x set to 0x%08"PRIx32"\n", |
|
175 | 175 |
subbyte, read_arbitrary(pb)); |
176 | 176 |
break; |
177 | 177 |
} |
... | ... |
@@ -183,7 +185,7 @@ static int process_audio_header_elements(AVFormatContext *s) |
183 | 183 |
break; |
184 | 184 |
default: |
185 | 185 |
av_log(s, AV_LOG_DEBUG, |
186 |
- "header element 0x%02x set to 0x%08x\n", |
|
186 |
+ "header element 0x%02x set to 0x%08"PRIx32"\n", |
|
187 | 187 |
byte, read_arbitrary(pb)); |
188 | 188 |
break; |
189 | 189 |
} |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/adler32.h" |
23 | 25 |
#include "libavutil/avstring.h" |
24 | 26 |
#include "avformat.h" |
... | ... |
@@ -29,7 +31,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) |
29 | 29 |
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size); |
30 | 30 |
char buf[256]; |
31 | 31 |
|
32 |
- snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x", |
|
32 |
+ snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08"PRIx32, |
|
33 | 33 |
pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc); |
34 | 34 |
if (pkt->flags != AV_PKT_FLAG_KEY) |
35 | 35 |
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/channel_layout.h" |
23 | 25 |
#include "libavutil/common.h" |
24 | 26 |
#include "avformat.h" |
... | ... |
@@ -293,7 +295,9 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) { |
293 | 293 |
} |
294 | 294 |
st = s->streams[0]; |
295 | 295 |
if (map_cnt > 1000) { |
296 |
- av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt); |
|
296 |
+ av_log(s, AV_LOG_ERROR, |
|
297 |
+ "too many index entries %"PRIu32" (%"PRIx32")\n", |
|
298 |
+ map_cnt, map_cnt); |
|
297 | 299 |
map_cnt = 1000; |
298 | 300 |
} |
299 | 301 |
if (pkt_len < 4 * map_cnt) { |
... | ... |
@@ -20,6 +20,8 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include <inttypes.h> |
|
24 |
+ |
|
23 | 25 |
#include "libavutil/intreadwrite.h" |
24 | 26 |
#include "avformat.h" |
25 | 27 |
#include "internal.h" |
... | ... |
@@ -149,8 +151,9 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) |
149 | 149 |
avio_skip(pb, 2); |
150 | 150 |
|
151 | 151 |
if (chunk_size > hnm->superchunk_remaining || !chunk_size) { |
152 |
- av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n", |
|
153 |
- chunk_size, (int) avio_tell(pb)); |
|
152 |
+ av_log(s, AV_LOG_ERROR, |
|
153 |
+ "invalid chunk size: %"PRIu32", offset: %"PRId64"\n", |
|
154 |
+ chunk_size, avio_tell(pb)); |
|
154 | 155 |
avio_skip(pb, hnm->superchunk_remaining - 8); |
155 | 156 |
hnm->superchunk_remaining = 0; |
156 | 157 |
} |
... | ... |
@@ -172,8 +175,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) |
172 | 172 |
break; |
173 | 173 |
|
174 | 174 |
default: |
175 |
- av_log(s, AV_LOG_WARNING, "unknown chunk found: %d, offset: %d\n", |
|
176 |
- chunk_id, (int) avio_tell(pb)); |
|
175 |
+ av_log(s, AV_LOG_WARNING, "unknown chunk found: %"PRIu16", offset: %"PRId64"\n", |
|
176 |
+ chunk_id, avio_tell(pb)); |
|
177 | 177 |
avio_skip(pb, chunk_size - 8); |
178 | 178 |
hnm->superchunk_remaining -= chunk_size; |
179 | 179 |
break; |
... | ... |
@@ -28,6 +28,8 @@ |
28 | 28 |
* http://wiki.multimedia.cx/index.php?title=IFF |
29 | 29 |
*/ |
30 | 30 |
|
31 |
+#include <inttypes.h> |
|
32 |
+ |
|
31 | 33 |
#include "libavutil/avassert.h" |
32 | 34 |
#include "libavutil/channel_layout.h" |
33 | 35 |
#include "libavutil/intreadwrite.h" |
... | ... |
@@ -251,7 +253,7 @@ static int iff_read_header(AVFormatContext *s) |
251 | 251 |
|
252 | 252 |
case ID_CMAP: |
253 | 253 |
if (data_size < 3 || data_size > 768 || data_size % 3) { |
254 |
- av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n", |
|
254 |
+ av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %"PRIu32"\n", |
|
255 | 255 |
data_size); |
256 | 256 |
return AVERROR_INVALIDDATA; |
257 | 257 |
} |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/intreadwrite.h" |
23 | 25 |
#include "libavcodec/bytestream.h" |
24 | 26 |
#include "avformat.h" |
... | ... |
@@ -128,12 +130,12 @@ static int get_packet_header(AVFormatContext *s) |
128 | 128 |
version = bytestream_get_le32(&p); |
129 | 129 |
header_size = bytestream_get_le32(&p); |
130 | 130 |
if (version > 1) |
131 |
- avpriv_request_sample(s, "Unknown format version %i\n", version); |
|
131 |
+ avpriv_request_sample(s, "Unknown format version %"PRIu32"\n", version); |
|
132 | 132 |
|
133 | 133 |
if (header_size < (version ? 72 : 60) || |
134 | 134 |
header_size > LXF_MAX_PACKET_HEADER_SIZE || |
135 | 135 |
(header_size & 3)) { |
136 |
- av_log(s, AV_LOG_ERROR, "Invalid header size 0x%x\n", header_size); |
|
136 |
+ av_log(s, AV_LOG_ERROR, "Invalid header size 0x%"PRIx32"\n", header_size); |
|
137 | 137 |
return AVERROR_INVALIDDATA; |
138 | 138 |
} |
139 | 139 |
|
... | ... |
@@ -301,7 +303,8 @@ static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt) |
301 | 301 |
stream = lxf->packet_type; |
302 | 302 |
|
303 | 303 |
if (stream > 1) { |
304 |
- av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream); |
|
304 |
+ av_log(s, AV_LOG_WARNING, |
|
305 |
+ "got packet with illegal stream index %"PRIu32"\n", stream); |
|
305 | 306 |
return AVERROR(EAGAIN); |
306 | 307 |
} |
307 | 308 |
|
... | ... |
@@ -30,6 +30,7 @@ |
30 | 30 |
|
31 | 31 |
#include "config.h" |
32 | 32 |
|
33 |
+#include <inttypes.h> |
|
33 | 34 |
#include <stdio.h> |
34 | 35 |
#if CONFIG_BZLIB |
35 | 36 |
#include <bzlib.h> |
... | ... |
@@ -921,7 +922,7 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, |
921 | 921 |
matroska->levels[matroska->num_levels - 1].length == 0xffffffffffffff) |
922 | 922 |
return 0; // we reached the end of an unknown size cluster |
923 | 923 |
if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) { |
924 |
- av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); |
|
924 |
+ av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%"PRIX32"\n", id); |
|
925 | 925 |
if (matroska->ctx->error_recognition & AV_EF_EXPLODE) |
926 | 926 |
return AVERROR_INVALIDDATA; |
927 | 927 |
} |
... | ... |
@@ -23,6 +23,7 @@ |
23 | 23 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
24 | 24 |
*/ |
25 | 25 |
|
26 |
+#include <inttypes.h> |
|
26 | 27 |
#include <limits.h> |
27 | 28 |
#include <stdint.h> |
28 | 29 |
|
... | ... |
@@ -767,7 +768,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
767 | 767 |
av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); |
768 | 768 |
av_dict_set(&c->fc->metadata, "major_brand", type, 0); |
769 | 769 |
minor_ver = avio_rb32(pb); /* minor version */ |
770 |
- snprintf(minor_ver_str, sizeof(minor_ver_str), "%d", minor_ver); |
|
770 |
+ snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver); |
|
771 | 771 |
av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0); |
772 | 772 |
|
773 | 773 |
comp_brand_size = atom.size - 8; |
... | ... |
@@ -1649,7 +1650,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) |
1649 | 1649 |
|
1650 | 1650 |
id = mov_codec_id(st, format); |
1651 | 1651 |
|
1652 |
- av_dlog(c->fc, "size=%"PRId64" 4CC= %c%c%c%c codec_type=%d\n", size, |
|
1652 |
+ av_dlog(c->fc, "size=%"PRId64" 4CC= %"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8" codec_type=%d\n", size, |
|
1653 | 1653 |
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, |
1654 | 1654 |
(format >> 24) & 0xff, st->codec->codec_type); |
1655 | 1655 |
|
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/channel_layout.h" |
23 | 25 |
#include "avformat.h" |
24 | 26 |
#include "internal.h" |
... | ... |
@@ -95,7 +97,8 @@ static int read_header(AVFormatContext *s) |
95 | 95 |
|
96 | 96 |
mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count; |
97 | 97 |
if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) { |
98 |
- av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n", |
|
98 |
+ av_log(s, AV_LOG_ERROR, |
|
99 |
+ "Invalid audio_data_size (%"PRIu32") or frames_count (%u)\n", |
|
99 | 100 |
mvi->audio_data_size, frames_count); |
100 | 101 |
return AVERROR_INVALIDDATA; |
101 | 102 |
} |
... | ... |
@@ -43,7 +43,7 @@ |
43 | 43 |
* Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1 |
44 | 44 |
*/ |
45 | 45 |
|
46 |
-#include <stdint.h> |
|
46 |
+#include <inttypes.h> |
|
47 | 47 |
|
48 | 48 |
#include "libavutil/aes.h" |
49 | 49 |
#include "libavutil/avassert.h" |
... | ... |
@@ -542,8 +542,10 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size |
542 | 542 |
|
543 | 543 |
/* only nag once */ |
544 | 544 |
if (!mxf->op) |
545 |
- av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming %s\n", |
|
546 |
- nb_essence_containers, op == OP1a ? "OP1a" : "OPAtom"); |
|
545 |
+ av_log(mxf->fc, AV_LOG_WARNING, |
|
546 |
+ "\"OPAtom\" with %"PRIu32" ECs - assuming %s\n", |
|
547 |
+ nb_essence_containers, |
|
548 |
+ op == OP1a ? "OP1a" : "OPAtom"); |
|
547 | 549 |
|
548 | 550 |
mxf->op = op; |
549 | 551 |
} else |
... | ... |
@@ -554,14 +556,15 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size |
554 | 554 |
} |
555 | 555 |
|
556 | 556 |
if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) { |
557 |
- av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %i - guessing ", partition->kag_size); |
|
557 |
+ av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %"PRId32" - guessing ", |
|
558 |
+ partition->kag_size); |
|
558 | 559 |
|
559 | 560 |
if (mxf->op == OPSONYOpt) |
560 | 561 |
partition->kag_size = 512; |
561 | 562 |
else |
562 | 563 |
partition->kag_size = 1; |
563 | 564 |
|
564 |
- av_log(mxf->fc, AV_LOG_WARNING, "%i\n", partition->kag_size); |
|
565 |
+ av_log(mxf->fc, AV_LOG_WARNING, "%"PRId32"\n", partition->kag_size); |
|
565 | 566 |
} |
566 | 567 |
|
567 | 568 |
return 0; |
... | ... |
@@ -2324,7 +2327,9 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) |
2324 | 2324 |
AVCodecContext *codec; |
2325 | 2325 |
|
2326 | 2326 |
if (index < 0) { |
2327 |
- av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12)); |
|
2327 |
+ av_log(s, AV_LOG_ERROR, |
|
2328 |
+ "error getting stream index %"PRIu32"\n", |
|
2329 |
+ AV_RB32(klv.key + 12)); |
|
2328 | 2330 |
goto skip; |
2329 | 2331 |
} |
2330 | 2332 |
|
... | ... |
@@ -40,6 +40,8 @@ |
40 | 40 |
* Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM |
41 | 41 |
*/ |
42 | 42 |
|
43 |
+#include <inttypes.h> |
|
44 |
+ |
|
43 | 45 |
#include "libavutil/channel_layout.h" |
44 | 46 |
#include "avformat.h" |
45 | 47 |
#include "internal.h" |
... | ... |
@@ -215,7 +217,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) |
215 | 215 |
|
216 | 216 |
if (geob->datasize < 64) { |
217 | 217 |
av_log(s, AV_LOG_ERROR, |
218 |
- "Invalid GEOB data size: %u\n", geob->datasize); |
|
218 |
+ "Invalid GEOB data size: %"PRIu32"\n", geob->datasize); |
|
219 | 219 |
return AVERROR_INVALIDDATA; |
220 | 220 |
} |
221 | 221 |
|
... | ... |
@@ -239,7 +241,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) |
239 | 239 |
return AVERROR_INVALIDDATA; |
240 | 240 |
} |
241 | 241 |
oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]); |
242 |
- av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid); |
|
242 |
+ av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid); |
|
243 | 243 |
|
244 | 244 |
memcpy(oc->iv, &header[0x58], 8); |
245 | 245 |
hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8); |
... | ... |
@@ -366,7 +368,7 @@ static int oma_read_header(AVFormatContext *s) |
366 | 366 |
channel_id = (codec_params >> 10) & 7; |
367 | 367 |
if (!channel_id) { |
368 | 368 |
av_log(s, AV_LOG_ERROR, |
369 |
- "Invalid ATRAC-X channel id: %d\n", channel_id); |
|
369 |
+ "Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id); |
|
370 | 370 |
return AVERROR_INVALIDDATA; |
371 | 371 |
} |
372 | 372 |
st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1]; |
... | ... |
@@ -19,6 +19,8 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include <inttypes.h> |
|
23 |
+ |
|
22 | 24 |
#include "libavutil/avassert.h" |
23 | 25 |
#include "libavutil/avstring.h" |
24 | 26 |
#include "libavutil/channel_layout.h" |
... | ... |
@@ -279,7 +281,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, |
279 | 279 |
case DEINT_ID_VBRF: |
280 | 280 |
break; |
281 | 281 |
default: |
282 |
- av_log(s, AV_LOG_ERROR, "Unknown interleaver %X\n", ast->deint_id); |
|
282 |
+ av_log(s, AV_LOG_ERROR ,"Unknown interleaver %"PRIX32"\n", ast->deint_id); |
|
283 | 283 |
return AVERROR_INVALIDDATA; |
284 | 284 |
} |
285 | 285 |
if (ast->deint_id == DEINT_ID_INT4 || |
... | ... |
@@ -19,7 +19,7 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
-#include <stdint.h> |
|
22 |
+#include <inttypes.h> |
|
23 | 23 |
#include <stdlib.h> |
24 | 24 |
|
25 | 25 |
#include "libavutil/avstring.h" |
... | ... |
@@ -222,7 +222,8 @@ static int rpl_read_header(AVFormatContext *s) |
222 | 222 |
break; |
223 | 223 |
} |
224 | 224 |
if (ast->codec->codec_id == AV_CODEC_ID_NONE) |
225 |
- avpriv_request_sample(s, "Audio format %i", audio_format); |
|
225 |
+ avpriv_request_sample(s, "Audio format %"PRId32, |
|
226 |
+ audio_format); |
|
226 | 227 |
avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate); |
227 | 228 |
} else { |
228 | 229 |
for (i = 0; i < 3; i++) |
... | ... |
@@ -23,6 +23,8 @@ |
23 | 23 |
* Based on http://wiki.multimedia.cx/index.php?title=Smacker |
24 | 24 |
*/ |
25 | 25 |
|
26 |
+#include <inttypes.h> |
|
27 |
+ |
|
26 | 28 |
#include "libavutil/bswap.h" |
27 | 29 |
#include "libavutil/channel_layout.h" |
28 | 30 |
#include "libavutil/intreadwrite.h" |
... | ... |
@@ -142,7 +144,7 @@ static int smacker_read_header(AVFormatContext *s) |
142 | 142 |
smk->pad = avio_rl32(pb); |
143 | 143 |
/* setup data */ |
144 | 144 |
if(smk->frames > 0xFFFFFF) { |
145 |
- av_log(s, AV_LOG_ERROR, "Too many frames: %i\n", smk->frames); |
|
145 |
+ av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n", smk->frames); |
|
146 | 146 |
return AVERROR_INVALIDDATA; |
147 | 147 |
} |
148 | 148 |
smk->frm_size = av_malloc_array(smk->frames, sizeof(*smk->frm_size)); |
... | ... |
@@ -221,7 +223,9 @@ static int smacker_read_header(AVFormatContext *s) |
221 | 221 |
|
222 | 222 |
/* load trees to extradata, they will be unpacked by decoder */ |
223 | 223 |
if(ff_alloc_extradata(st->codec, smk->treesize + 16)){ |
224 |
- av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16); |
|
224 |
+ av_log(s, AV_LOG_ERROR, |
|
225 |
+ "Cannot allocate %"PRIu32" bytes of extradata\n", |
|
226 |
+ smk->treesize + 16); |
|
225 | 227 |
av_freep(&smk->frm_size); |
226 | 228 |
av_freep(&smk->frm_flags); |
227 | 229 |
return AVERROR(ENOMEM); |
... | ... |
@@ -24,6 +24,8 @@ |
24 | 24 |
* This is a demuxer for Loki SDL Motion JPEG files |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+#include <inttypes.h> |
|
28 |
+ |
|
27 | 29 |
#include "avformat.h" |
28 | 30 |
#include "internal.h" |
29 | 31 |
#include "riff.h" |
... | ... |
@@ -52,7 +54,7 @@ static int smjpeg_read_header(AVFormatContext *s) |
52 | 52 |
avio_skip(pb, 8); // magic |
53 | 53 |
version = avio_rb32(pb); |
54 | 54 |
if (version) |
55 |
- avpriv_request_sample(s, "Unknown version %d", version); |
|
55 |
+ avpriv_request_sample(s, "Unknown version %"PRIu32, version); |
|
56 | 56 |
|
57 | 57 |
duration = avio_rb32(pb); // in msec |
58 | 58 |
|
... | ... |
@@ -124,7 +126,7 @@ static int smjpeg_read_header(AVFormatContext *s) |
124 | 124 |
case SMJPEG_HEND: |
125 | 125 |
return 0; |
126 | 126 |
default: |
127 |
- av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype); |
|
127 |
+ av_log(s, AV_LOG_ERROR, "unknown header %"PRIx32"\n", htype); |
|
128 | 128 |
return AVERROR_INVALIDDATA; |
129 | 129 |
} |
130 | 130 |
} |
... | ... |
@@ -164,7 +166,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt) |
164 | 164 |
ret = AVERROR_EOF; |
165 | 165 |
break; |
166 | 166 |
default: |
167 |
- av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype); |
|
167 |
+ av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", dtype); |
|
168 | 168 |
ret = AVERROR_INVALIDDATA; |
169 | 169 |
break; |
170 | 170 |
} |
... | ... |
@@ -44,6 +44,8 @@ |
44 | 44 |
* dependent from data-type (spaces between packets are filled by zeros) |
45 | 45 |
*/ |
46 | 46 |
|
47 |
+#include <inttypes.h> |
|
48 |
+ |
|
47 | 49 |
#include "avformat.h" |
48 | 50 |
#include "avio_internal.h" |
49 | 51 |
#include "spdif.h" |
... | ... |
@@ -274,7 +276,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt) |
274 | 274 |
av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n"); |
275 | 275 |
return AVERROR_INVALIDDATA; |
276 | 276 |
default: |
277 |
- av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts); |
|
277 |
+ av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%"PRIx32"\n", syncword_dts); |
|
278 | 278 |
return AVERROR_INVALIDDATA; |
279 | 279 |
} |
280 | 280 |
blocks++; |
... | ... |
@@ -369,8 +371,8 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) |
369 | 369 |
ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096; |
370 | 370 |
break; |
371 | 371 |
default: |
372 |
- av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n", |
|
373 |
- hdr.samples); |
|
372 |
+ av_log(s, AV_LOG_ERROR, |
|
373 |
+ "%"PRIu32" samples in AAC frame not supported\n", hdr.samples); |
|
374 | 374 |
return AVERROR(EINVAL); |
375 | 375 |
} |
376 | 376 |
//TODO Data type dependent info (LC profile/SBR) |
... | ... |
@@ -25,6 +25,8 @@ |
25 | 25 |
* @author Peter Ross <pross@xvid.org> |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include <inttypes.h> |
|
29 |
+ |
|
28 | 30 |
#include "libavutil/channel_layout.h" |
29 | 31 |
#include "libavutil/intreadwrite.h" |
30 | 32 |
#include "libavutil/intfloat.h" |
... | ... |
@@ -35,7 +37,7 @@ |
35 | 35 |
|
36 | 36 |
/* Macros for formating GUIDs */ |
37 | 37 |
#define PRI_PRETTY_GUID \ |
38 |
- "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x" |
|
38 |
+ "%08"PRIx32"-%04"PRIx16"-%04"PRIx16"-%02x%02x%02x%02x%02x%02x%02x%02x" |
|
39 | 39 |
#define ARG_PRETTY_GUID(g) \ |
40 | 40 |
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] |
41 | 41 |
#define LEN_PRETTY_GUID 34 |
... | ... |
@@ -471,7 +473,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty |
471 | 471 |
return; |
472 | 472 |
|
473 | 473 |
if (type == 0 && length == 4) { |
474 |
- snprintf(buf, buf_size, "%"PRIi32, avio_rl32(pb)); |
|
474 |
+ snprintf(buf, buf_size, "%u", avio_rl32(pb)); |
|
475 | 475 |
} else if (type == 1) { |
476 | 476 |
avio_get_str16le(pb, length, buf, buf_size); |
477 | 477 |
if (!strlen(buf)) { |
... | ... |
@@ -25,7 +25,7 @@ |
25 | 25 |
* Microsoft XMV demuxer |
26 | 26 |
*/ |
27 | 27 |
|
28 |
-#include <stdint.h> |
|
28 |
+#include <inttypes.h> |
|
29 | 29 |
|
30 | 30 |
#include "libavutil/intreadwrite.h" |
31 | 31 |
|
... | ... |
@@ -155,7 +155,7 @@ static int xmv_read_header(AVFormatContext *s) |
155 | 155 |
|
156 | 156 |
file_version = avio_rl32(pb); |
157 | 157 |
if ((file_version != 4) && (file_version != 2)) |
158 |
- avpriv_request_sample(s, "Uncommon version %d", file_version); |
|
158 |
+ avpriv_request_sample(s, "Uncommon version %"PRIu32"", file_version); |
|
159 | 159 |
|
160 | 160 |
|
161 | 161 |
/* Video track */ |
... | ... |
@@ -219,7 +219,7 @@ static int xmv_read_header(AVFormatContext *s) |
219 | 219 |
|
220 | 220 |
if (!packet->channels || !packet->sample_rate || |
221 | 221 |
packet->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) { |
222 |
- av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %d.\n", |
|
222 |
+ av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %"PRIu16".\n", |
|
223 | 223 |
audio_track); |
224 | 224 |
ret = AVERROR_INVALIDDATA; |
225 | 225 |
goto fail; |