[FFmpeg-devel] [PATCH 3/6] avformat/s337m: New ff_s337m_probe()

Nicolas Gaullier nicolas.gaullier at cji.paris
Tue Feb 21 12:57:12 EET 2023

>> ff_s337m_probe is very similar to s337m_probe: what mainly differs is 
>> the input parameters.
>> The one little thing I added is the S337M_PROBE_GUARDBAND_MIN_BYTES.
>> Currently it is set to 0, so has no effect (and of course I can remove 
>> it if someone object).
>> There is two things to know about it:
>> - one is that some DolbyE decoder implementations does not support the 
>> s337m sync word to be the first word, A minimal guard band (full of 
>> zero) is required in such a case : 1 word is enough in the cases I 
>> experimented.
>> One developer might find it useful to set 
>> S337M_PROBE_GUARDBAND_MIN_BYTES to 1 in order to ffprobe-qc/reject 
>> such files.
>> - one other thing is that, currently, the detection is based on 3 
>> consecutive samples, But there are other implementations in the wild. 
>> A common single- sample implementation is to simply require a 
>> sufficient S337M_PROBE_GUARDBAND_MIN_BYTES in order to avoid a fake 
>> detection.
>> (for 16 bits, this is really dangerous!; for 24 bits, I think it is 
>> fair but would still require some little additions to be 100% sure).
>What a mess.. And there's no other way to reliably probe this?

No! But the statistics are such that at some time, a fake probe is not "possible".
Anyway, we already have stream probings in current code, not only considering wav.
I think my patch is similar to the spdif probe and safe.


More information about the ffmpeg-devel mailing list