diff options
author | Måns Rullgård <mans@mansr.com> | 2005-12-12 04:56:46 +0300 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2005-12-12 04:56:46 +0300 |
commit | 4733abcbf30fb662785d0c4ad3a0601e749dc57d (patch) | |
tree | 5b8bbe0c89f35eb6fedc535909dae1ffc65bc67f /libavformat | |
parent | fccfc4753386d3aacb067f5e4117ea4d266acf72 (diff) |
use PRIxN, %zd, %td formats where needed
Originally committed as revision 4740 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asf.c | 2 | ||||
-rw-r--r-- | libavformat/crc.c | 2 | ||||
-rw-r--r-- | libavformat/matroska.c | 26 | ||||
-rw-r--r-- | libavformat/mov.c | 2 | ||||
-rw-r--r-- | libavformat/nsvdec.c | 13 | ||||
-rw-r--r-- | libavformat/nut.c | 10 | ||||
-rw-r--r-- | libavformat/sierravmd.c | 2 | ||||
-rw-r--r-- | libavformat/utils.c | 14 |
8 files changed, 36 insertions, 35 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c index fdbb4e3d0c..7867713e1e 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -430,7 +430,7 @@ static int asf_get_packet(AVFormatContext *s) c = get_byte(pb); if (c != 0x82) { if (!url_feof(pb)) - av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%lld\n", c, url_ftell(pb)); + av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%"PRId64"\n", c, url_ftell(pb)); } if ((c & 0x0f) == 2) { // always true for now if (get_le16(pb) != 0) { diff --git a/libavformat/crc.c b/libavformat/crc.c index 809102564a..991ccf8a27 100644 --- a/libavformat/crc.c +++ b/libavformat/crc.c @@ -94,7 +94,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) uint32_t crc = update_adler32(0, pkt->data, pkt->size); char buf[256]; - snprintf(buf, sizeof(buf), "%d, %Ld, %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc); + snprintf(buf, sizeof(buf), "%d, %"PRId64", %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc); put_buffer(&s->pb, buf, strlen(buf)); put_flush_packet(&s->pb); return 0; diff --git a/libavformat/matroska.c b/libavformat/matroska.c index dda4f45877..8d0df203eb 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -379,7 +379,7 @@ ebml_read_num (MatroskaDemuxContext *matroska, if (!url_feof(pb)) { offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Read error at pos. %llu (0x%llx)\n", + "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); } return AVERROR_IO; /* EOS or actual I/O error */ @@ -393,7 +393,7 @@ ebml_read_num (MatroskaDemuxContext *matroska, if (read > max_size) { offset_t pos = url_ftell(pb) - 1; av_log(matroska->ctx, AV_LOG_ERROR, - "Invalid EBML number size tag 0x%02x at pos %llu (0x%llx)\n", + "Invalid EBML number size tag 0x%02x at pos %"PRIu64" (0x%"PRIx64")\n", (uint8_t) total, pos, pos); return AVERROR_INVALIDDATA; } @@ -537,7 +537,7 @@ ebml_read_uint (MatroskaDemuxContext *matroska, if (size < 1 || size > 8) { offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Invalid uint element size %d at position %lld (0x%llx)\n", + "Invalid uint element size %d at position %"PRId64" (0x%"PRIx64")\n", size, pos, pos); return AVERROR_INVALIDDATA; } @@ -571,7 +571,7 @@ ebml_read_sint (MatroskaDemuxContext *matroska, if (size < 1 || size > 8) { offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Invalid sint element size %d at position %lld (0x%llx)\n", + "Invalid sint element size %d at position %"PRId64" (0x%"PRIx64")\n", size, pos, pos); return AVERROR_INVALIDDATA; } @@ -620,7 +620,7 @@ ebml_read_float (MatroskaDemuxContext *matroska, } else{ offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Invalid float element size %d at position %llu (0x%llx)\n", + "Invalid float element size %d at position %"PRIu64" (0x%"PRIx64")\n", size, pos, pos); return AVERROR_INVALIDDATA; } @@ -656,7 +656,7 @@ ebml_read_ascii (MatroskaDemuxContext *matroska, if (get_buffer(pb, (uint8_t *) *str, size) != size) { offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Read error at pos. %llu (0x%llx)\n", pos, pos); + "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); return AVERROR_IO; } (*str)[size] = '\0'; @@ -753,7 +753,7 @@ ebml_read_binary (MatroskaDemuxContext *matroska, if (get_buffer(pb, *binary, *size) != *size) { offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, - "Read error at pos. %llu (0x%llx)\n", pos, pos); + "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); return AVERROR_IO; } @@ -877,7 +877,7 @@ ebml_read_header (MatroskaDemuxContext *matroska, return res; if (num > EBML_VERSION) { av_log(matroska->ctx, AV_LOG_ERROR, - "EBML version %llu (> %d) is not supported\n", + "EBML version %"PRIu64" (> %d) is not supported\n", num, EBML_VERSION); return AVERROR_INVALIDDATA; } @@ -892,7 +892,7 @@ ebml_read_header (MatroskaDemuxContext *matroska, return res; if (num > sizeof(uint64_t)) { av_log(matroska->ctx, AV_LOG_ERROR, - "Integers of size %llu (> %d) not supported\n", + "Integers of size %"PRIu64" (> %zd) not supported\n", num, sizeof(uint64_t)); return AVERROR_INVALIDDATA; } @@ -907,7 +907,7 @@ ebml_read_header (MatroskaDemuxContext *matroska, return res; if (num > sizeof(uint32_t)) { av_log(matroska->ctx, AV_LOG_ERROR, - "IDs of size %llu (> %u) not supported\n", + "IDs of size %"PRIu64" (> %zu) not supported\n", num, sizeof(uint32_t)); return AVERROR_INVALIDDATA; } @@ -1870,7 +1870,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska) if (!seek_id || seek_pos == (uint64_t) -1) { av_log(matroska->ctx, AV_LOG_INFO, - "Incomplete seekhead entry (0x%x/%llu)\n", + "Incomplete seekhead entry (0x%x/%"PRIu64")\n", seek_id, seek_pos); break; } @@ -1913,7 +1913,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska) if (id != seek_id) { av_log(matroska->ctx, AV_LOG_INFO, "We looked for ID=0x%x but got " - "ID=0x%x (pos=%llu)", + "ID=0x%x (pos=%"PRIu64")", seek_id, id, seek_pos + matroska->segment_start); goto finish; @@ -2543,7 +2543,7 @@ matroska_parse_cluster (MatroskaDemuxContext *matroska) uint64_t cluster_time = 0; av_log(matroska->ctx, AV_LOG_DEBUG, - "parsing cluster at %lld\n", url_ftell(&matroska->ctx->pb)); + "parsing cluster at %"PRId64"\n", url_ftell(&matroska->ctx->pb)); while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { diff --git a/libavformat/mov.c b/libavformat/mov.c index 71cd5113b0..3df408457b 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1749,7 +1749,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) /* check MOV header */ err = mov_read_default(mov, pb, atom); if (err<0 || (!mov->found_moov && !mov->found_mdat)) { - av_log(s, AV_LOG_ERROR, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%lld\n", + av_log(s, AV_LOG_ERROR, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%"PRId64"\n", err, mov->found_moov, mov->found_mdat, url_ftell(pb)); return -1; } diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 3082cff1c5..61abb6dde2 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -236,7 +236,7 @@ static int nsv_resync(AVFormatContext *s) uint32_t v = 0; int i; - PRINT(("%s(), offset = %Ld, state = %d\n", __FUNCTION__, url_ftell(pb), nsv->state)); + PRINT(("%s(), offset = %"PRId64", state = %d\n", __FUNCTION__, url_ftell(pb), nsv->state)); //nsv->state = NSV_UNSYNC; @@ -301,7 +301,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) PRINT(("NSV NSVf file_size %u\n", file_size)); nsv->duration = duration = get_le32(pb); /* in ms */ - PRINT(("NSV NSVf duration %Ld ms\n", duration)); + PRINT(("NSV NSVf duration %"PRId64" ms\n", duration)); // XXX: store it in AVStreams strings_size = get_le32(pb); @@ -312,7 +312,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) if (url_feof(pb)) return -1; - PRINT(("NSV got header; filepos %Ld\n", url_ftell(pb))); + PRINT(("NSV got header; filepos %"PRId64"\n", url_ftell(pb))); if (strings_size > 0) { char *strings; /* last byte will be '\0' to play safe with str*() */ @@ -355,17 +355,18 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) if (url_feof(pb)) return -1; - PRINT(("NSV got infos; filepos %Ld\n", url_ftell(pb))); + PRINT(("NSV got infos; filepos %"PRId64"\n", url_ftell(pb))); if (table_entries_used > 0) { nsv->index_entries = table_entries_used; if((unsigned)table_entries >= UINT_MAX / sizeof(uint32_t)) return -1; nsv->nsvf_index_data = av_malloc(table_entries * sizeof(uint32_t)); - get_buffer(pb, nsv->nsvf_index_data, table_entries * sizeof(uint32_t)); +#warning "FIXME: Byteswap buffer as needed" + get_buffer(pb, (unsigned char *)nsv->nsvf_index_data, table_entries * sizeof(uint32_t)); } - PRINT(("NSV got index; filepos %Ld\n", url_ftell(pb))); + PRINT(("NSV got index; filepos %"PRId64"\n", url_ftell(pb))); #ifdef DEBUG_DUMP_INDEX #define V(v) ((v<0x20 || v > 127)?'.':v) diff --git a/libavformat/nut.c b/libavformat/nut.c index b33e4ca52b..4bcfbb9fae 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -868,7 +868,7 @@ static int decode_main_header(NUTContext *nut){ tmp = get_v(bc); if (tmp != 2){ - av_log(s, AV_LOG_ERROR, "bad version (%Ld)\n", tmp); + av_log(s, AV_LOG_ERROR, "bad version (%"PRId64")\n", tmp); return -1; } @@ -1034,7 +1034,7 @@ static int decode_info_header(NUTContext *nut){ if(!id) break; else if(id >= sizeof(info_table)/sizeof(info_table[0])){ - av_log(s, AV_LOG_ERROR, "info id is too large %d %d\n", id, sizeof(info_table)/sizeof(info_table[0])); + av_log(s, AV_LOG_ERROR, "info id is too large %d %zd\n", id, sizeof(info_table)/sizeof(info_table[0])); return -1; } @@ -1297,7 +1297,7 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt) break; default: resync: -av_log(s, AV_LOG_DEBUG, "syncing from %lld\n", nut->packet_start[2]+1); +av_log(s, AV_LOG_DEBUG, "syncing from %"PRId64"\n", nut->packet_start[2]+1); tmp= find_any_startcode(bc, nut->packet_start[2]+1); if(tmp==0) return -1; @@ -1314,7 +1314,7 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index, int64_t int64_t pos, pts; uint64_t code; int frame_code,step, stream_id, i,size, key_frame; -av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%lld,%lld)\n", stream_index, *pos_arg, pos_limit); +av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n", stream_index, *pos_arg, pos_limit); if(*pos_arg < 0) return AV_NOPTS_VALUE; @@ -1381,7 +1381,7 @@ av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%lld,%lld)\n", stream_index, *pos_a return pts; default: resync: -av_log(s, AV_LOG_DEBUG, "syncing from %lld\n", nut->packet_start[2]+1); +av_log(s, AV_LOG_DEBUG, "syncing from %"PRId64"\n", nut->packet_start[2]+1); if(!find_any_startcode(bc, nut->packet_start[2]+1)) return AV_NOPTS_VALUE; diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 5f6005bca4..bc69c0ecd1 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -290,7 +290,7 @@ static int vmd_read_packet(AVFormatContext *s, pkt->data, pkt->size, vmd->audio_block_align); } -av_log(NULL, AV_LOG_INFO, " dispatching %s frame with %d bytes and pts %lld (%0.1f sec)\n", +av_log(NULL, AV_LOG_INFO, " dispatching %s frame with %d bytes and pts %"PRId64" (%0.1f sec)\n", (frame->frame_record[0] == 0x02) ? "video" : "audio", frame->frame_size + BYTES_PER_FRAME_RECORD, pkt->pts, (float)(pkt->pts / 90000.0)); diff --git a/libavformat/utils.c b/libavformat/utils.c index 3848fb1f6d..adeebcb627 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1274,7 +1274,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts return -1; #ifdef DEBUG_SEEK - av_log(s, AV_LOG_DEBUG, "read_seek: %d %lld\n", stream_index, target_ts); + av_log(s, AV_LOG_DEBUG, "read_seek: %d %"PRId64"\n", stream_index, target_ts); #endif ts_max= @@ -1293,7 +1293,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts pos_min= e->pos; ts_min= e->timestamp; #ifdef DEBUG_SEEK - av_log(s, AV_LOG_DEBUG, "using cached pos_min=0x%llx dts_min=%lld\n", + av_log(s, AV_LOG_DEBUG, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n", pos_min,ts_min); #endif }else{ @@ -1309,7 +1309,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts ts_max= e->timestamp; pos_limit= pos_max - e->min_distance; #ifdef DEBUG_SEEK - av_log(s, AV_LOG_DEBUG, "using cached pos_max=0x%llx pos_limit=0x%llx dts_max=%lld\n", + av_log(s, AV_LOG_DEBUG, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64" dts_max=%"PRId64"\n", pos_max,pos_limit, ts_max); #endif } @@ -1350,7 +1350,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts no_change=0; while (pos_min < pos_limit) { #ifdef DEBUG_SEEK - av_log(s, AV_LOG_DEBUG, "pos_min=0x%llx pos_max=0x%llx dts_min=%lld dts_max=%lld\n", + av_log(s, AV_LOG_DEBUG, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64" dts_max=%"PRId64"\n", pos_min, pos_max, ts_min, ts_max); #endif @@ -1380,7 +1380,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts else no_change=0; #ifdef DEBUG_SEEK -av_log(s, AV_LOG_DEBUG, "%Ld %Ld %Ld / %Ld %Ld %Ld target:%Ld limit:%Ld start:%Ld noc:%d\n", pos_min, pos, pos_max, ts_min, ts, ts_max, target_ts, pos_limit, start_pos, no_change); +av_log(s, AV_LOG_DEBUG, "%"PRId64" %"PRId64" %"PRId64" / %"PRId64" %"PRId64" %"PRId64" target:%"PRId64" limit:%"PRId64" start:%"PRId64" noc:%d\n", pos_min, pos, pos_max, ts_min, ts, ts_max, target_ts, pos_limit, start_pos, no_change); #endif assert(ts != AV_NOPTS_VALUE); if (target_ts <= ts) { @@ -1401,7 +1401,7 @@ av_log(s, AV_LOG_DEBUG, "%Ld %Ld %Ld / %Ld %Ld %Ld target:%Ld limit:%Ld start:%L ts_min = avif->read_timestamp(s, stream_index, &pos_min, INT64_MAX); pos_min++; ts_max = avif->read_timestamp(s, stream_index, &pos_min, INT64_MAX); - av_log(s, AV_LOG_DEBUG, "pos=0x%llx %lld<=%lld<=%lld\n", + av_log(s, AV_LOG_DEBUG, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n", pos, ts_min, target_ts, ts_max); #endif /* do the seek */ @@ -2324,7 +2324,7 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){ } if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){ - av_log(NULL, AV_LOG_ERROR, "error, non monotone timestamps %Ld >= %Ld\n", st->cur_dts, pkt->dts); + av_log(NULL, AV_LOG_ERROR, "error, non monotone timestamps %"PRId64" >= %"PRId64"\n", st->cur_dts, pkt->dts); return -1; } if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts < pkt->dts){ |