mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
examples/muxing.c: set sample format for encoding
This is required, or avcodec_open() will abort because of invalid sample format.
This commit is contained in:
parent
58257ea29e
commit
26f373988d
@ -71,6 +71,7 @@ static void audio_encode_example(const char *filename)
|
|||||||
c->bit_rate = 64000;
|
c->bit_rate = 64000;
|
||||||
c->sample_rate = 44100;
|
c->sample_rate = 44100;
|
||||||
c->channels = 2;
|
c->channels = 2;
|
||||||
|
c->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||||
|
|
||||||
/* open it */
|
/* open it */
|
||||||
if (avcodec_open(c, codec) < 0) {
|
if (avcodec_open(c, codec) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user