[FFmpeg-devel] [EXTERNE] Re: [PATCH 1/2] fftools/textformat: fix print 64 bit integers
Nicolas Gaullier
nicolas.gaullier at cji.paris
Fri Jun 20 20:18:13 EEST 2025
On 6/20/25 13:29, Marvin Scholz wrote:
> On 20 Jun 2025, at 13:07, Nicolas Gaullier wrote:
>
>> Regression in ffprobe since textformat introduction
>> in d7a3f68feae0b1c3718f9d2671c6d41c60a40680.
>>
>> Fixes #11638
>>
>> Signed-off-by: Nicolas Gaullier <nicolas.gaullier at cji.paris>
>> ---
>> fftools/textformat/avtextformat.c | 2 +-
>> fftools/textformat/avtextformat.h | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fftools/textformat/avtextformat.c b/fftools/textformat/avtextformat.c
>> index 14779e6f0c..14bad9022b 100644
>> --- a/fftools/textformat/avtextformat.c
>> +++ b/fftools/textformat/avtextformat.c
>> @@ -437,7 +437,7 @@ static char *value_string(const AVTextFormatContext *tctx, char *buf, int buf_si
>> }
>>
>>
>> -void avtext_print_unit_int(AVTextFormatContext *tctx, const char *key, int value, const char *unit)
>> +void avtext_print_unit_int(AVTextFormatContext *tctx, const char *key, int64_t value, const char *unit)
>> {
>> char val_str[128];
>> struct unit_value uv;
>> diff --git a/fftools/textformat/avtextformat.h b/fftools/textformat/avtextformat.h
>> index cf23d93871..8316829af5 100644
>> --- a/fftools/textformat/avtextformat.h
>> +++ b/fftools/textformat/avtextformat.h
>> @@ -169,7 +169,7 @@ void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t va
>>
>> int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char *val, int flags);
>>
>> -void avtext_print_unit_int(AVTextFormatContext *tctx, const char *key, int value, const char *unit);
>> +void avtext_print_unit_int(AVTextFormatContext *tctx, const char *key, int64_t value, const char *unit);
>>
>> void avtext_print_rational(AVTextFormatContext *tctx, const char *key, AVRational q, char sep);
>>
>> --
>> 2.47.2
>>
> Looks good.
>
> Would it be possible to add a test for this to make sure we catch such
> a regression next time?
>
> (I can also give it a try if you don't want to)
I suppose it would be one more entry in ffprobe.mak.
First thing is this "print_unit_int"...
I found the sox format is a possibility to get a high bitrate for testing:
./ffmpeg -y -f lavfi -i "anullsrc=d=1ms:r=1234567890:cl=22.2" -f sox -
| ./ffprobe -f sox -i - -of flat -show_entries stream=bit_rate
It works, it's quick, but I am wondering if it is not a bit "too much"
for such a very limited test.
Second thing is the "print_integer" (with no unit), which was not
affected by the regression,
but I guess we would like to include a test for it too.
That could be done typically with some HDR metadata, I think, but this
is an additional test again...
Another way to do the job would be to make up a dedicated sample and add
it to the fate-suite,
but that does not look very great.
More information about the ffmpeg-devel
mailing list