[FFmpeg-cvslog] examples/muxing: set sample formats from list of codec supported sample formats

Stefano Sabatini git at videolan.org
Thu Jan 9 10:55:36 CET 2014


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Jan  7 12:59:50 2014 +0100| [eadc42125905ae889a7d9d793ebae38dd48d9552] | committer: Stefano Sabatini

examples/muxing: set sample formats from list of codec supported sample formats

Avoid the need of tweaking, also show how to get list of supported sample
formats.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eadc42125905ae889a7d9d793ebae38dd48d9552
---

 doc/examples/muxing.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index 4cd3f65..4cf72e5 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -73,7 +73,8 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
 
     switch ((*codec)->type) {
     case AVMEDIA_TYPE_AUDIO:
-        c->sample_fmt  = AV_SAMPLE_FMT_FLTP;
+        c->sample_fmt  = (*codec)->sample_fmts ?
+            (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
         c->bit_rate    = 64000;
         c->sample_rate = 44100;
         c->channels    = 2;



More information about the ffmpeg-cvslog mailing list