Thanks for that email. The one lihe change I made is this :
from #define FLAC__MAX_RICE_PARTITION_ORDER (15u)
to #define FLAC__MAX_RICE_PARTITION_ORDER (6u)
and that seemed to make decoder_new() happy, but it's promptly crashing
after making a call to the read callback (below), then to the meta
callback. The meta callback did nothing but print a string and return.
I removed it, and it's just crashing at the read callback. The flac
file I'm using is a 16/44.1 wav file i encoded(and decoded to verify it
worked).
Any thoughts? Alas, although I can generate a core file, I havn't been
able to get get gdb to recognize it. Is there any way to turn on
verbose debugging messages from flac?
Thanks,
Reza
FLAC__StreamDecoderReadStatus rio_flac_read(const FLAC__StreamDecoder
*decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data) {
r_glue *g = (r_glue*) client_data;
unsigned int bytesAvailable = rio_ringbuffer_datasize(
g->readAhead );
unsigned int bytesToCopy = 0;
char* inBuffer;
if (g->decode_request == DECODE_STOP)
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
if (g->eof && bytesAvailable == 0)
return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
g->decode_status = DECODE_RUN
bytesToCopy = MIN(bytesAvailable, *bytes);
inBuffer = rio_ringbuffer_read( g->readAhead, bytesToCopy);
memcpy(buffer, inBuffer, bytesToCopy);
if (bytesToCopy < *bytes)
*bytes = bytesToCopy;
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
Josh Coalson wrote:> --- Reza Naima <reza@reza.net> wrote:
>
>>I've cross-compiled flac for the armv4l processor (rio receiver),
and
>>
>>i'm trying to start up a decode thread :
>>
>> #include <FLAC/stream_decoder.h>
>> ....
>> FLAC__StreamDecoder *flac = NULL;
>> flac = FLAC__stream_decoder_new();
>> if (flac == NULL) {
>> printf("[DECODE] Unable to initalize flac
>>object\n");
>> pthread_exit(NULL);
>> }
>>
>>And, oddly enough, it's consistantly failling at the
>>FLAC__stream_decoder_new(). Is there any way to determine exactly
>>why
>>it isn't able to start a new instance?
>>
>>Though the flac executable wasn't able to compile, the libs did
>>manage
>>to compile. Here's the configure syntax I used (along with CC set
to
>>
>>the cross-compiler)
>>
>> $ ./configure --prefix=/home/reza/projects/rio/flac --host=armv4l
>
>
> FLAC__stream_decoder_new() should only fail allocating memory.
> In 1.0.3 the decoder instance is around 2 megs. I have fixed
> this in CVS (should be a few K now). There's a thread on
> flac-users with a workaround but it looks like it hasn't made
> the archive yet... I'll forward it on to you.
>
> Josh
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> Flac-dev mailing list
> Flac-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flac-dev