[SCM] libav/experimental: avcodec: more correct printf specifiers

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:02:18 UTC 2014


The following commit has been merged in the experimental branch:
commit cc8163e1a3601a56f722a4720516e860bf1c6198
Author: Diego Biurrun <diego at biurrun.de>
Date:   Thu Mar 13 12:13:33 2014 +0100

    avcodec: more correct printf specifiers

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 687fb89..3c89f1c 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -24,6 +24,8 @@
  * 4XM codec.
  */
 
+#include <inttypes.h>
+
 #include "libavutil/frame.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
@@ -803,7 +805,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     }
 
     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;
     }
diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index 5981dd8..68ae728 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "dsputil.h"
@@ -169,7 +171,7 @@ static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
     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;
     }
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index f972531..5272f84 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -45,6 +45,8 @@
  * 32bit  samplerate
  */
 
+#include <inttypes.h>
+
 #include "libavutil/channel_layout.h"
 #include "avcodec.h"
 #include "get_bits.h"
@@ -276,7 +278,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
     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;
     }
@@ -288,7 +290,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
             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;
     }
@@ -500,7 +502,8 @@ static int alac_set_info(ALACContext *alac)
     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;
     }
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index f7dee7d..866e5ef 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -25,6 +25,8 @@
  * @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "get_bits.h"
 #include "unary.h"
@@ -703,7 +705,9 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
                     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;
                     }
                 }
@@ -1378,7 +1382,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
             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;
             }
 
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 8669db8..fb41918 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -20,6 +20,8 @@
  * 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"
@@ -1456,7 +1458,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
         }
 
         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;
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index e5f7ebb..15c33a0 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "bmp.h"
@@ -57,7 +59,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
 
     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;
     }
@@ -68,7 +70,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
     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;
     }
 
@@ -77,7 +79,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
         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;
     }
@@ -163,7 +166,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
             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);
             }
         }
@@ -179,12 +184,13 @@ static int bmp_decode_frame(AVCodecContext *avctx,
         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;
     }
 
@@ -234,7 +240,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
             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;
             }
diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c
index 6818f9f..7481251 100644
--- a/libavcodec/cllc.c
+++ b/libavcodec/cllc.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 "dsputil.h"
 #include "get_bits.h"
@@ -367,7 +369,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
         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;
         }
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index ab65fdc..6fa4edc 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "internal.h"
@@ -363,7 +365,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
                 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;
diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c
index 5cb7fae..662cd9f 100644
--- a/libavcodec/dxtory.c
+++ b/libavcodec/dxtory.c
@@ -20,6 +20,8 @@
  * 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"
@@ -269,18 +271,18 @@ static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
         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);
@@ -350,18 +352,19 @@ static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
         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);
@@ -448,18 +451,18 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
         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);
@@ -552,18 +555,18 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
         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);
@@ -645,18 +648,18 @@ static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
         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);
@@ -728,7 +731,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         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;
     }
 
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 6d773ba..fe0c929 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -24,6 +24,7 @@
  * Go2Webinar decoder
  */
 
+#include <inttypes.h>
 #include <zlib.h>
 
 #include "libavutil/intreadwrite.h"
@@ -500,19 +501,19 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
 
     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;
     }
@@ -692,7 +693,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
         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;
         }
@@ -700,7 +701,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
         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;
             }
@@ -748,7 +749,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
                 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;
                 }
@@ -799,7 +800,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
             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;
             }
@@ -808,7 +809,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
             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;
             }
@@ -820,7 +821,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
         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);
         }
 
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index b5b6a44..f3477c1 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -25,6 +25,8 @@
  * @author Michael Niedermayer <michaelni at gmx.at>
  */
 
+#include <inttypes.h>
+
 #include "libavutil/imgutils.h"
 #include "internal.h"
 #include "avcodec.h"
@@ -186,7 +188,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
         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;
         }
@@ -388,7 +390,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
         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;
         }
 
@@ -444,7 +446,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
 
         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   =
@@ -493,7 +495,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     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,
@@ -639,7 +641,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
 
     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,
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index 1e064ed..923cd75 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -26,6 +26,8 @@
  * Indeo5 decoders.
  */
 
+#include <inttypes.h>
+
 #define BITSTREAM_READER_LE
 #include "libavutil/attributes.h"
 #include "libavutil/timer.h"
@@ -514,7 +516,7 @@ static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
             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];
@@ -933,7 +935,7 @@ static int decode_band(IVI45DecContext *ctx,
         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);
         }
     }
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index cc154c3..f6fa2a5 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -25,6 +25,8 @@
  * JPEG 2000 image decoder
  */
 
+#include <inttypes.h>
+
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
@@ -345,7 +347,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
 
     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;
     }
@@ -497,12 +499,12 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
     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;
     }
 
@@ -718,7 +720,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
 
             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;
             }
@@ -1343,14 +1345,15 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
             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;
         }
     }
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 2814e2d..a4fa6d2 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -25,6 +25,8 @@
  * @author Nathan Caldwell
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "get_bits.h"
 #include "mathops.h"
@@ -449,7 +451,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
 
         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;
@@ -666,7 +668,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
         break;
     default:
         av_log(avctx, AV_LOG_ERROR,
-               "Unsupported Lagarith frame type: %#x\n", frametype);
+               "Unsupported Lagarith frame type: %#"PRIu8"\n", frametype);
         return -1;
     }
 
diff --git a/libavcodec/metasound.c b/libavcodec/metasound.c
index ae16ad0..dd9ffe0 100644
--- a/libavcodec/metasound.c
+++ b/libavcodec/metasound.c
@@ -21,6 +21,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <inttypes.h>
 #include <math.h>
 #include <stdint.h>
 
@@ -283,7 +284,7 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx)
 
     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) {
diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index a5f32a6..66cf2d4 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -24,6 +24,8 @@
  * Apple MJPEG-B decoder.
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "mjpeg.h"
 #include "mjpegdec.h"
@@ -73,13 +75,14 @@ read_header:
     }
 
     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);
@@ -90,7 +93,7 @@ read_header:
     }
 
     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);
@@ -99,7 +102,7 @@ read_header:
     }
 
     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);
@@ -109,9 +112,9 @@ read_header:
     }
 
     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,
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 06b7565..2095eea 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -25,6 +25,8 @@
  * MPEG-1/2 decoder
  */
 
+#include <inttypes.h>
+
 #include "libavutil/attributes.h"
 #include "libavutil/internal.h"
 #include "libavutil/stereo3d.h"
@@ -1452,7 +1454,8 @@ static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
     }
 
     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]);
@@ -2343,7 +2346,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
         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 */
diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index 3601978..d4b621f 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -23,6 +23,8 @@
  * Common functions for Microsoft Screen 1 and 2
  */
 
+#include <inttypes.h>
+
 #include "libavutil/intfloat.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
@@ -573,7 +575,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
 
     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;
@@ -587,7 +589,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
         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,
@@ -604,13 +606,13 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
     }
     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)));
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 771d5a8..ddaaae1 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -25,6 +25,8 @@
  * RV10/RV20 decoder
  */
 
+#include <inttypes.h>
+
 #include "libavutil/imgutils.h"
 
 #include "avcodec.h"
@@ -489,8 +491,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
 
     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;
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index ce42fcf..4916314 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -40,6 +40,8 @@
  *  http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
  */
 
+#include <inttypes.h>
+
 #include "libavutil/attributes.h"
 #include "internal.h"
 #include "avcodec.h"
@@ -614,7 +616,8 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
                 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;
                 }
 
@@ -683,7 +686,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
     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;
         }
 
@@ -805,7 +808,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
     }
 
     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;
     }
 
@@ -988,7 +991,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
                 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",
@@ -1003,7 +1006,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
             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,
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index e41d7a3..8886924 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -24,6 +24,8 @@
  * Duck TrueMotion2 decoder.
  */
 
+#include <inttypes.h>
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "get_bits.h"
@@ -231,7 +233,8 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
     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;
     }
 }
diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c
index 3d22fd7..bd1854b 100644
--- a/libavcodec/tscc2.c
+++ b/libavcodec/tscc2.c
@@ -24,6 +24,8 @@
  * TechSmith Screen Codec 2 decoder
  */
 
+#include <inttypes.h>
+
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "get_bits.h"
@@ -226,7 +228,8 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
     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;
     }
 
@@ -309,7 +312,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
             }
         }
         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;
         }
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 3492595..41d5344 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -24,6 +24,7 @@
  * Ut Video decoder
  */
 
+#include <inttypes.h>
 #include <stdlib.h>
 
 #include "libavutil/intreadwrite.h"
@@ -371,7 +372,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         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;
 
@@ -492,7 +494,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     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;
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 2f341c0..6ee27d3 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <inttypes.h>
+
 #include "libavutil/attributes.h"
 #include "libavutil/avassert.h"
 
@@ -192,7 +194,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
             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;
         }
@@ -234,7 +236,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     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;
     }
@@ -252,7 +254,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     }
 
     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) {
@@ -377,7 +379,7 @@ static int decode_tilehdr(WmallDecodeCtx *s)
                 ++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;
                 }
@@ -1087,7 +1089,8 @@ static int decode_frame(WmallDecodeCtx *s)
         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;
@@ -1202,7 +1205,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
         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;
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 2657a0e..0a8ebc5 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -86,6 +86,8 @@
  * subframe in order to reconstruct the output samples.
  */
 
+#include <inttypes.h>
+
 #include "libavutil/float_dsp.h"
 #include "libavutil/intfloat.h"
 #include "libavutil/intreadwrite.h"
@@ -332,13 +334,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
     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;
     }
@@ -1408,7 +1410,8 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
         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;
@@ -1546,7 +1549,8 @@ static int decode_packet(AVCodecContext *avctx, void *data,
         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;
diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c
index 8963c96..eede5e5 100644
--- a/libavcodec/xwddec.c
+++ b/libavcodec/xwddec.c
@@ -20,6 +20,8 @@
  * 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"
@@ -75,9 +77,11 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
     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]);
 
@@ -92,7 +96,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     if (xoffset) {
-        avpriv_request_sample(avctx, "xoffset %d", xoffset);
+        avpriv_request_sample(avctx, "xoffset %"PRIu32"", xoffset);
         return AVERROR_PATCHWELCOME;
     }
 
@@ -141,7 +145,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     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;
     }
 
@@ -193,7 +197,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
 
     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;
     }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list