diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-01 22:03:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-01 22:40:50 +0100 |
commit | 5ade6bfb03d475c9717ff5f12c0f506fec4c7e70 (patch) | |
tree | c2f9c5ca2019d8828278c072fec6726878b5d104 | |
parent | bf90ef0314e298f7ecfa133685e938e694dd3cad (diff) | |
download | ffmpeg-streaming-5ade6bfb03d475c9717ff5f12c0f506fec4c7e70.zip ffmpeg-streaming-5ade6bfb03d475c9717ff5f12c0f506fec4c7e70.tar.gz |
doc/examples/demuxing: use AVFrame accessor functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/examples/demuxing.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/examples/demuxing.c b/doc/examples/demuxing.c index 6780e07..8a1b69b 100644 --- a/doc/examples/demuxing.c +++ b/doc/examples/demuxing.c @@ -98,7 +98,7 @@ static int decode_packet(int *got_frame, int cached) audio_frame_count++, frame->nb_samples, av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); - ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, frame->channels, + ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, av_frame_get_channels(frame), frame->nb_samples, frame->format, 1); if (ret < 0) { fprintf(stderr, "Could not allocate audio buffer\n"); @@ -107,13 +107,13 @@ static int decode_packet(int *got_frame, int cached) /* TODO: extend return code of the av_samples_* functions so that this call is not needed */ audio_dst_bufsize = - av_samples_get_buffer_size(NULL, frame->channels, + av_samples_get_buffer_size(NULL, av_frame_get_channels(frame), frame->nb_samples, frame->format, 1); /* copy audio data to destination buffer: * this is required since rawaudio expects non aligned data */ av_samples_copy(audio_dst_data, frame->data, 0, 0, - frame->nb_samples, frame->channels, frame->format); + frame->nb_samples, av_frame_get_channels(frame), frame->format); /* write to rawaudio file */ fwrite(audio_dst_data[0], 1, audio_dst_bufsize, audio_dst_file); |