[FFmpeg-devel] FreeBSD libamr.c block_size error

John J Fitzgerald jjfitzgerald
Wed Feb 27 16:23:27 CET 2008


Ah, right, thanks.

The diff -urN patch is named freebsd_libamr.patch and can be downloaded
here:

http://www.mediafire.com/?dnl0z5xrrae

Contents of freebsd_libamr.patch:

--- libavcodec/libamr.c.orig    Wed Feb 27 11:21:44 2008
+++ libavcodec/libamr.c Wed Feb 27 11:21:58 2008
@@ -663,6 +663,7 @@
     }

     mode = (amrData[0] >> 3) & 0x000F;
+    static short block_size[16]={18, 23, 33, 37, 41, 47, 51, 59, 61, 6, 6,
0, 0, 0, 1, 1};
     packet_size = block_size[mode];

     if(packet_size > buf_size) {

Hope this is all you need,

-JJ


-----Original Message-----
From: ffmpeg-devel-bounces at mplayerhq.hu
[mailto:ffmpeg-devel-bounces at mplayerhq.hu] On Behalf Of Benoit Fouet
Sent: Wednesday, February 27, 2008 3:54 AM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] FreeBSD libamr.c block_size error

Hi,

John J Fitzgerald wrote:
> Hi everyone,
>
> New to the list here, but been an ffmpeg user for awhile. I just grabbed
the
> latest snapshot and when compiling on FreeBSD, a problem comes when
> gmake'ing with --enable-libamr-wb:
>
> libamr.c: In function `amr_wb_decode_frame':
> libamr.c:666: error: `block_size' undeclared (first use in this function)
> libamr.c:666: error: (Each undeclared identifier is reported only once
> libamr.c:666: error: for each function it appears in.)
>
>   

do you use the latest version of libamr_wb from
http://www.penguin.cz/~utx/amr ?

> It was a problem when I first compiled a year ago and I fixed it for mine
at
> the time, but forgot to let other people know then, so I am now, since
it's
> still a problem. So, this can be fixed by adding:
>
> static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0,
0,
> 0, 0, 0 };
>
> on line 665 of libavcodec/libamr.c. Can this be incorporated into the next
> nightly snapshot, etc? I hope I've got this right.
>
>   

the size you specify are AMR-NB ones, for AMR-WB, that should be (if we
take the IF2 size, i.e. the shortest):
{18, 23, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1};
(and BTW I think that fits in a uint8_t table)

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel





More information about the ffmpeg-devel mailing list