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

Michael Niedermayer michaelni at gmx.at
Thu Apr 12 11:47:39 CEST 2012


On Thu, Apr 12, 2012 at 11:32:57AM +0200, Nicolas George wrote:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  doc/examples/decoding_encoding.c |   31 ++++++++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 7 deletions(-)

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()

patch itself LGTM, excpet one comment below



[...]
> @@ -97,11 +103,22 @@ static void audio_encode_example(const char *filename)
>              t += tincr;
>          }
>          /* encode the samples */
> -        out_size = avcodec_encode_audio(c, outbuf, outbuf_size, samples);
> -        fwrite(outbuf, 1, out_size, f);
> +        av_init_packet(&packet);
> +        packet.data = NULL;
> +        packet.size = 0;

> +        got_packet = 0;

unneeded

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- 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/fd3a55aa/attachment.asc>


More information about the ffmpeg-devel mailing list