OSDN Git Service

examples/muxing: use S16 sample_fmt for resample src regardless of codec sample_fmt
authorIlya Basin <basinilya@gmail.com>
Mon, 16 Dec 2013 09:08:03 +0000 (13:08 +0400)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Dec 2013 11:21:05 +0000 (12:21 +0100)
We generate S16 samples and we should allocate the right buffer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing.c

index 5f716c2..d6e0256 100644 (file)
@@ -157,7 +157,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
         10000 : c->frame_size;
 
     ret = av_samples_alloc_array_and_samples(&src_samples_data, &src_samples_linesize, c->channels,
-                                             src_nb_samples, c->sample_fmt, 0);
+                                             src_nb_samples, AV_SAMPLE_FMT_S16, 0);
     if (ret < 0) {
         fprintf(stderr, "Could not allocate source samples\n");
         exit(1);