GNOME Bugzilla – Bug 569441
Use AVCodec.sample_fmts for list of compatible sample formats.
Last modified: 2009-01-29 06:51:55 UTC
In previous version of gst-ffmpeg, the encoder ffenc_adpcm_yamaha was only accepting sample depth of 16. Now it accepts depth of 32 but then generate a corrupted stream when decoded. This works on old and new versions: gst-launch-0.10 -v audiotestsrc ! audio/x-raw-int,width=16,depth=16 ! ffenc_adpcm_yamaha ! ffdec_adpcm_yamaha ! alsasink This was failing with the error "could not link audiotestsrc0 to ffenc_adpcm_yamaha0", and now it plays noise: gst-launch-0.10 -v audiotestsrc ! audio/x-raw-int,width=32,depth=32 ! ffenc_adpcm_yamaha ! ffdec_adpcm_yamaha ! alsasink
So the generic problem is that, for codecs that implement it, we don't look at AVCodec->sample_fmts which lists the sample formats compatible with that codec. If that field is empty, it means it supports any sample formats.
commit 9fc91546ea91af0b6f14418b8ec26abf64b0cc72 Author: Edward Hervey <bilboed@bilboed.com> Date: Thu Jan 29 07:48:19 2009 +0100 Only use valid SampleFormat for audio encoders/decoders. For a given AVCodec, when the sample_fmts field is non-NULL, that means that that codec can only handle a specific set of SampleFormat. With this patch, we now look for its presence and create the proper pad template caps. Fixes #569441