mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
doc/examples/muxing: select a supported sample rate for the encoder, favor 44100
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ead22f42f4
commit
5d2cf1ae86
@ -117,6 +117,14 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
|||||||
(*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
|
(*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
|
||||||
c->bit_rate = 64000;
|
c->bit_rate = 64000;
|
||||||
c->sample_rate = 44100;
|
c->sample_rate = 44100;
|
||||||
|
if ((*codec)->supported_samplerates) {
|
||||||
|
c->sample_rate = (*codec)->supported_samplerates[0];
|
||||||
|
for (i = 0; (*codec)->supported_samplerates[i]; i++) {
|
||||||
|
if ((*codec)->supported_samplerates[i] == 44100)
|
||||||
|
c->sample_rate = 44100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
|
||||||
c->channel_layout = AV_CH_LAYOUT_STEREO;
|
c->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||||
if ((*codec)->channel_layouts) {
|
if ((*codec)->channel_layouts) {
|
||||||
c->channel_layout = (*codec)->channel_layouts[0];
|
c->channel_layout = (*codec)->channel_layouts[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user