[FFmpeg-devel] [PATCH 5/5] examples/filtering_audio: use av_buffersrc_add_frame.

Nicolas George nicolas.george at normalesup.org
Thu May 3 20:02:53 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 doc/examples/filtering_audio.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)


Unchanged and approved, sent only for reference.


diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c
index 45d5c64..5fa3f9b 100644
--- a/doc/examples/filtering_audio.c
+++ b/doc/examples/filtering_audio.c
@@ -203,17 +203,8 @@ int main(int argc, char **argv)
             }
 
             if (got_frame) {
-                const int bps = av_get_bytes_per_sample(dec_ctx->sample_fmt);
-                const int decoded_data_size = frame.nb_samples * dec_ctx->channels * bps;
-
                 /* push the audio data from decoded frame into the filtergraph */
-                if (av_asrc_buffer_add_buffer(buffersrc_ctx,
-                                              frame.data[0],
-                                              decoded_data_size,
-                                              dec_ctx->sample_rate,
-                                              dec_ctx->sample_fmt,
-                                              dec_ctx->channel_layout,
-                                              0, frame.pts, 0) < 0) {
+                if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
                     av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n");
                     break;
                 }
-- 
1.7.10



More information about the ffmpeg-devel mailing list