[FFmpeg-devel] [PATCH 04/10] avcodec/dca: don't set initial sample_fmt

Michael Niedermayer michael at niedermayer.cc
Sat May 14 20:08:11 CEST 2016


On Sat, May 14, 2016 at 06:48:51PM +0300, foo86 wrote:
> On Fri, May 13, 2016 at 12:00:24PM +0200, Hendrik Leppkes wrote:
> > On Fri, May 13, 2016 at 11:48 AM, foo86 <foobaz86 at gmail.com> wrote:
> > > Valid sample_fmt will be set by dcadec_decode_frame() based on stream
> > > type.
> > > ---
> > >  libavcodec/dcadec.c | 3 ---
> > >  1 file changed, 3 deletions(-)
> > >
> > > diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
> > > index e3a4b0d..565242d 100644
> > > --- a/libavcodec/dcadec.c
> > > +++ b/libavcodec/dcadec.c
> > > @@ -374,9 +374,6 @@ static av_cold int dcadec_init(AVCodecContext *avctx)
> > >          break;
> > >      }
> > >
> > > -    avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
> > > -    avctx->bits_per_raw_sample = 24;
> > > -
> > >      return 0;
> > >  }
> > >
> > 
> > Having an initial format for the most "common" types of streams is
> > generally sensible.
> 
> Do you suggest it should be changed to AV_SAMPLE_FMT_FLTP then? Core
> streams are probably the most "common".
> 

> I don't have a strong prefenence on this, but I thought that not having
> initial sample_fmt set will serve as useful indication to API user that
> sample_fmt can (and will) change after the frame is decoded.

i feel similarly ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160514/158492f2/attachment.sig>


More information about the ffmpeg-devel mailing list