avfilter: more correct printf format specifiers
[ffmpeg.git] / libavfilter / af_ashowinfo.c
index c8e830e..99d9dde 100644 (file)
@@ -27,6 +27,7 @@
 #include <stddef.h>
 
 #include "libavutil/adler32.h"
+#include "libavutil/attributes.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/common.h"
 #include "libavutil/mem.h"
@@ -59,22 +60,22 @@ static int config_input(AVFilterLink *inlink)
     return 0;
 }
 
-static void uninit(AVFilterContext *ctx)
+static av_cold void uninit(AVFilterContext *ctx)
 {
     AShowInfoContext *s = ctx->priv;
     av_freep(&s->plane_checksums);
 }
 
-static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
+static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 {
     AVFilterContext *ctx = inlink->dst;
     AShowInfoContext *s  = ctx->priv;
     char chlayout_str[128];
     uint32_t checksum = 0;
-    int channels    = av_get_channel_layout_nb_channels(buf->audio->channel_layout);
+    int channels    = av_get_channel_layout_nb_channels(buf->channel_layout);
     int planar      = av_sample_fmt_is_planar(buf->format);
     int block_align = av_get_bytes_per_sample(buf->format) * (planar ? 1 : channels);
-    int data_size   = buf->audio->nb_samples * block_align;
+    int data_size   = buf->nb_samples * block_align;
     int planes      = planar ? channels : 1;
     int i;
 
@@ -87,20 +88,20 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
     }
 
     av_get_channel_layout_string(chlayout_str, sizeof(chlayout_str), -1,
-                                 buf->audio->channel_layout);
+                                 buf->channel_layout);
 
     av_log(ctx, AV_LOG_INFO,
            "n:%"PRIu64" pts:%"PRId64" pts_time:%f "
            "fmt:%s chlayout:%s rate:%d nb_samples:%d "
-           "checksum:%08X ",
+           "checksum:%08"PRIX32" ",
            s->frame, buf->pts, buf->pts * av_q2d(inlink->time_base),
            av_get_sample_fmt_name(buf->format), chlayout_str,
-           buf->audio->sample_rate, buf->audio->nb_samples,
+           buf->sample_rate, buf->nb_samples,
            checksum);
 
     av_log(ctx, AV_LOG_INFO, "plane_checksums: [ ");
     for (i = 0; i < planes; i++)
-        av_log(ctx, AV_LOG_INFO, "%08X ", s->plane_checksums[i]);
+        av_log(ctx, AV_LOG_INFO, "%08"PRIX32" ", s->plane_checksums[i]);
     av_log(ctx, AV_LOG_INFO, "]\n");
 
     s->frame++;
@@ -114,7 +115,6 @@ static const AVFilterPad inputs[] = {
         .get_audio_buffer = ff_null_get_audio_buffer,
         .config_props     = config_input,
         .filter_frame     = filter_frame,
-        .min_perms        = AV_PERM_READ,
     },
     { NULL },
 };
@@ -127,7 +127,7 @@ static const AVFilterPad outputs[] = {
     { NULL },
 };
 
-AVFilter avfilter_af_ashowinfo = {
+AVFilter ff_af_ashowinfo = {
     .name        = "ashowinfo",
     .description = NULL_IF_CONFIG_SMALL("Show textual information for each audio frame."),
     .priv_size   = sizeof(AShowInfoContext),