mirror of https://git.ffmpeg.org/ffmpeg.git
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->sample_rate = 44100;
|
||||
c->channels = 2;
|
||||
c->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
|
||||
/* open it */
|
||||
if (avcodec_open(c, codec) < 0) {
|
||||
|
|
Loading…
Reference in New Issue