projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
fb8f5d0
)
examples/muxing: set sample formats from list of codec supported sample formats
author
Stefano Sabatini
<stefasab@gmail.com>
Tue, 7 Jan 2014 11:59:50 +0000
(12:59 +0100)
committer
Stefano Sabatini
<stefasab@gmail.com>
Thu, 9 Jan 2014 09:51:41 +0000
(10:51 +0100)
Avoid the need of tweaking, also show how to get list of supported sample
formats.
doc/examples/muxing.c
patch
|
blob
|
history
diff --git
a/doc/examples/muxing.c
b/doc/examples/muxing.c
index
4cd3f65
..
4cf72e5
100644
(file)
--- 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;