[FFmpeg-cvslog] r18667 - trunk/libavcodec/wavpack.c
Laurent Aimar
fenrir
Thu Apr 23 22:03:42 CEST 2009
On Thu, Apr 23, 2009, Kostya wrote:
> On Thu, Apr 23, 2009 at 08:00:34PM +0200, Laurent Aimar wrote:
> > Why not using (s->frame_flags&0x03) to dynamically set the output
> > format (avctx->sample_fmt) ?
> > This way, a user app will automatically have the right sample size and will
> > not have to fill bits_per_coded_sample (which is kind of undocumented and
> > I have no idea how to fill it right except by always setting 32 here).
>
> It is set by lavf demuxer as ((frame_flags&3)+1)<<3 from the first block.
It supposes that a libavcodec user is using lavf which may not always be
the cases.
> And I'm a bit suspicious about setting it dynamically.
It is already the cases with some libavcodec demuxer and so will be more
consistent (flac, mlp does it).
VLC does support it perfectly. It is not different from having the sample rate
or the number of channels changing dynamically (mp3, ac3, aac codecs at least do
it for exemple).
You can still use bits_per_coded_sample in the init function, so that if set
you can directly set the right output format.
> Sane alternative variant is setting avctx->sample_fmt in demuxer instead of
> codec itself (for future float support as well).
I already have a float support patch that I need to clean up, and it works by
setting dynamically the output format. Doing it otherwise may be more complicated
and at least need to transfert more informations from the demuxer. I don't even
know if wavpack forbid dynamic changes.
--
fenrir
More information about the ffmpeg-cvslog
mailing list