1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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.
This commit is contained in:
Stefano Sabatini 2014-01-07 12:59:50 +01:00
parent fb8f5d0510
commit eadc421259

View File

@ -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;