[FFmpeg-devel] [PATCH 1/3] examples/decoding_encoding: upgrade to encode_audio2.

Nicolas George nicolas.george at normalesup.org
Thu Apr 12 12:48:21 CEST 2012

Le quartidi 24 germinal, an CCXX, Michael Niedermayer a écrit :
> while its a tiny amount of code for us, i think we should investigate
> if the API could be simplified to reduce the amount of code each
> application needs to interface to avcodec_encode_audio2()

I rather agree. All the more since that examples synthesizes its samples on
the fly with exact framing: otherwise, it becomes necessary to split the
samples according to the codec's frame_size, and that becomes even more

nb_packets = av_simple_encode_samples(simple_context, samples, nb_samples, eof);
for (i = 0; i < nb_packets; i++) {
    packet = avcodec_simple_get_packet(simple_context);

Maybe, something like that?

> > +        got_packet = 0;
> unneeded

Removed in both patches.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120412/33758541/attachment.asc>

More information about the ffmpeg-devel mailing list