[FFmpeg-devel] [PATCH 3/3] sbc: add raw muxer and demuxer for SBC

Aurelien Jacobs aurel at gnuage.org
Mon Nov 6 02:31:32 EET 2017


On Mon, Nov 06, 2017 at 12:48:32AM +0100, Carl Eugen Hoyos wrote:
> 2017-11-06 0:35 GMT+01:00 Aurelien Jacobs <aurel at gnuage.org>:
> 
> > +static int sbc_probe(AVProbeData *p)
> > +{
> > +    int score = 0;
> 
> > +    int l = strlen(p->filename);
> > +    if (l > 4 && !strcmp(&p->filename[l-4], ".sbc"))
> > +        score = AVPROBE_SCORE_EXTENSION;
> 
> This may make sense but we don't do it for any
> other demuxer and if we want it it should imo be
> done for all demuxers.
> 
> > +    if (p->buf[0] == SBC_SYNCWORD)
> > +        score++;
> 
> Am I correct that the syncword is repeated
> throughout the file? If yes, the probing can
> be significantly improved (and would not
> depend on the suffix).

Indeed it is repeated, and indeed the probing could
be improved by looking at several syncwords.
The problem is that they are not repeated at fixed
intervals, and that the offset to the next one is
not simply encoded in the stream.
So basically, the same process as the parser should
be used to find where is the next syncword. This
seems a bit to much for my taste for a simple probing
function.

> Additionally, it is a little better not to return
> a positive score - not even 1 - for eight bits
> conformance.

Well, the best might be to just remove this probing
function. SBC is not usually stored in files AFAIK
(it is streamed over bluetooth), so this demuxer is
mostly for testing purpose.
Relying on extension autodetection should be good
enough for testing.
Does this sound OK ?

Thanks for the review.
--
Aurel


More information about the ffmpeg-devel mailing list