[FFmpeg-devel] [PATCH] Make libavcodec/apiexample.c compile
Michael Niedermayer
michaelni
Mon Mar 23 06:43:09 CET 2009
On Mon, Mar 23, 2009 at 12:35:29AM +0000, Robert Swain wrote:
> On 20/3/09 15:56, Michael Niedermayer wrote:
>> On Fri, Mar 20, 2009 at 03:33:33PM +0000, Robert Swain wrote:
>>> Is anything more than the attached needed to bring
>>> libavcodec/apiexample.c
>>
>> setting out_size
>
> So the attached should do it? I thought it would be a good idea to set it
> close to where it is allocated in case it is changed in future.
[...]
> @@ -138,6 +138,7 @@
> }
>
> outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
> + out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
>
> f = fopen(filename, "rb");
> if (!f) {
> @@ -159,7 +160,7 @@
>
> inbuf_ptr = inbuf;
> while (size > 0) {
> - len = avcodec_decode_audio(c, (short *)outbuf, &out_size,
> + len = avcodec_decode_audio2(c, (short *)outbuf, &out_size,
> inbuf_ptr, size);
> if (len < 0) {
> fprintf(stderr, "Error while decoding\n");
i just wanted to say ok, then i saw the while()
is te out_size value correct if this is executed more than once?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090323/1ea676b0/attachment.pgp>
More information about the ffmpeg-devel
mailing list