From cb750e331b4e457e053c09e164344fc94aed5ec6 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Fri, 8 Aug 2003 18:03:31 +0000 Subject: [PATCH] added get_audio_frame() Originally committed as revision 2116 to svn://svn.ffmpeg.org/ffmpeg/trunk --- output_example.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/output_example.c b/output_example.c index 0e06b0cbb6..42153f1103 100644 --- a/output_example.c +++ b/output_example.c @@ -115,21 +115,33 @@ void open_audio(AVFormatContext *oc, AVStream *st) samples = malloc(audio_input_frame_size * 2 * c->channels); } +/* prepare a 16 bit dummy audio frame of 'frame_size' samples and + 'nb_channels' channels */ +void get_audio_frame(int16_t *samples, int frame_size, int nb_channels) +{ + int j, i, v; + int16_t *q; + + q = samples; + for(j=0;jcodec; - for(j=0;jchannels); + out_size = avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples); /* write the compressed frame in the media file */