[FFmpeg-devel] [PATCH 3/3] examples/muxing: use S16 sample_fmt for resample src regardless of codec sample_fmt

Ilya Basin basinilya at gmail.com
Mon Dec 16 10:08:03 CET 2013


We generate S16 samples and we should allocate the right buffer
---
 doc/examples/muxing.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index f3826e8..4cd3f65 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -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);
-- 
1.7.9



More information about the ffmpeg-devel mailing list