[FFmpeg-devel,v1] lavf/dump: dump the vbv_delay with N/A instead of 18446744073709551615

Submitted by lance.lmwang@gmail.com on Aug. 18, 2019, 2:31 p.m.

Details

Message ID 20190818143120.23493-1-lance.lmwang@gmail.com
State Accepted
Commit ffd65c8862e1cb9f49f71ab30640ac0e8bdfe7ce
Headers show

Commit Message

lance.lmwang@gmail.com Aug. 18, 2019, 2:31 p.m.
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/dump.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Michael Niedermayer Aug. 20, 2019, 2:59 p.m.
On Sun, Aug 18, 2019 at 10:31:20PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/dump.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index a3791a3..56814ff 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -321,13 +321,16 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
>  
>      av_log(ctx, AV_LOG_INFO,
>  #if FF_API_UNSANITIZED_BITRATES
> -           "bitrate max/min/avg: %d/%d/%d buffer size: %d vbv_delay: %"PRIu64,
> +           "bitrate max/min/avg: %d/%d/%d buffer size: %d ",
>  #else
> -           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d vbv_delay: %"PRIu64,
> +           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d ",
>  #endif
>             cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
> -           cpb->buffer_size,
> -           cpb->vbv_delay);
> +           cpb->buffer_size);
> +    if (cpb->vbv_delay == UINT64_MAX)
> +        av_log(ctx, AV_LOG_INFO, "vbv_delay: N/A");
> +    else
> +        av_log(ctx, AV_LOG_INFO, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
>  }

LGTM

thx

[...]
lance.lmwang@gmail.com Aug. 27, 2019, 2:36 p.m.
Add Reviewed-by: only, please help to push it, thanks.

On Tue, Aug 27, 2019 at 10:34:54PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> How to check it:
> ./ffmpeg -f lavfi -i testsrc  -c:v mpeg2video  -f null  -
> master:
>   Side data:
>         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
>         18446744073709551615
> patch applied:
> Side data:
>       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
> 
> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/dump.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index a3791a3..56814ff 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -321,13 +321,16 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
>  
>      av_log(ctx, AV_LOG_INFO,
>  #if FF_API_UNSANITIZED_BITRATES
> -           "bitrate max/min/avg: %d/%d/%d buffer size: %d vbv_delay: %"PRIu64,
> +           "bitrate max/min/avg: %d/%d/%d buffer size: %d ",
>  #else
> -           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d vbv_delay: %"PRIu64,
> +           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d ",
>  #endif
>             cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
> -           cpb->buffer_size,
> -           cpb->vbv_delay);
> +           cpb->buffer_size);
> +    if (cpb->vbv_delay == UINT64_MAX)
> +        av_log(ctx, AV_LOG_INFO, "vbv_delay: N/A");
> +    else
> +        av_log(ctx, AV_LOG_INFO, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
>  }
>  
>  static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
> -- 
> 2.6.4
>
Michael Niedermayer Aug. 28, 2019, 4:19 p.m.
On Tue, Aug 27, 2019 at 10:36:58PM +0800, Limin Wang wrote:
> 
> Add Reviewed-by: only, please help to push it, thanks.

will apply

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/dump.c b/libavformat/dump.c
index a3791a3..56814ff 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -321,13 +321,16 @@  static void dump_cpb(void *ctx, AVPacketSideData *sd)
 
     av_log(ctx, AV_LOG_INFO,
 #if FF_API_UNSANITIZED_BITRATES
-           "bitrate max/min/avg: %d/%d/%d buffer size: %d vbv_delay: %"PRIu64,
+           "bitrate max/min/avg: %d/%d/%d buffer size: %d ",
 #else
-           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d vbv_delay: %"PRIu64,
+           "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d ",
 #endif
            cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
-           cpb->buffer_size,
-           cpb->vbv_delay);
+           cpb->buffer_size);
+    if (cpb->vbv_delay == UINT64_MAX)
+        av_log(ctx, AV_LOG_INFO, "vbv_delay: N/A");
+    else
+        av_log(ctx, AV_LOG_INFO, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
 }
 
 static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {