osdir.com
mailing list archive

Subject: dave: apps/codecs flac.c,1.11,1.12 - msg#00165

List: systems.archos.rockbox.cvs

Date: Prev Next Index Thread: Prev Next Index
Update of /cvsroot/rockbox/apps/codecs
In directory labb:/tmp/cvs-serv30990

Modified Files:
flac.c
Log Message:
Add more useful error codes from decoder

Index: flac.c
===================================================================
RCS file: /cvsroot/rockbox/apps/codecs/flac.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- flac.c 27 Oct 2005 16:59:23 -0000 1.11
+++ flac.c 28 Oct 2005 20:09:46 -0000 1.12
@@ -117,6 +117,8 @@
uint32_t elapsedtime;
int bytesleft;
int consumed;
+ int res;
+ int frame;

/* Generic codec initialisation */
TEST_CODEC_API(api);
@@ -151,6 +153,7 @@

/* The main decoding loop */
samplesdone=0;
+ frame=0;
bytesleft=ci->read_filebuf(buf,sizeof(buf));
while (bytesleft) {
ci->yield();
@@ -171,12 +174,13 @@
ci->seek_time = 0;
}

- if(flac_decode_frame(&fc,decoded0,decoded1,buf,
- bytesleft,ci->yield) < 0) {
- LOGF("FLAC: Decode error, aborting\n");
+ if((res=flac_decode_frame(&fc,decoded0,decoded1,buf,
+ bytesleft,ci->yield)) < 0) {
+ LOGF("FLAC: Frame %d, error %d\n",frame,res);
return CODEC_ERROR;
}
consumed=fc.gb.index/8;
+ frame++;

ci->yield();
while(!ci->pcmbuf_insert_split((char*)decoded0,(char*)decoded1,

_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@xxxxxxxxxxxx
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

amiconn: firmware usb.c,1.65,1.66

Update of /cvsroot/rockbox/firmware In directory labb:/tmp/cvs-serv14590/firmware Modified Files: usb.c Log Message: USB power mode: Made the code ignore the power button (On for recorder fm/v2, OnOff for Ondio) to make it easier to enter USB power mode at startup. Index: usb.c =================================================================== RCS file: /cvsroot/rockbox/firmware/usb.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- usb.c 22 Aug 2005 13:27:56 -0000 1.65 +++ usb.c 28 Oct 2005 18:47:25 -0000 1.66 @@ -58,8 +58,10 @@ #if CONFIG_KEYPAD == RECORDER_PAD #define USBPOWER_BUTTON BUTTON_F1 +#define USBPOWER_BTN_IGNORE BUTTON_ON #elif CONFIG_KEYPAD == ONDIO_PAD #define USBPOWER_BUTTON BUTTON_MENU +#define USBPOWER_BTN_IGNORE BUTTON_OFF #endif #endif /* HAVE_USB_POWER */ @@ -225,7 +227,7 @@ else #endif #ifdef HAVE_USB_POWER - if(button_status() == USBPOWER_BUTTON) + if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON) { usb_state = USB_POWERED; } _______________________________________________ rockbox-cvs mailing list rockbox-cvs@xxxxxxxxxxxx http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs

Next Message by Date: click to view message preview

dave: apps/codecs/libffmpegFLAC decoder.c,1.1,1.2

Update of /cvsroot/rockbox/apps/codecs/libffmpegFLAC In directory labb:/tmp/cvs-serv30990/libffmpegFLAC Modified Files: decoder.c Log Message: Add more useful error codes from decoder Index: decoder.c =================================================================== RCS file: /cvsroot/rockbox/apps/codecs/libffmpegFLAC/decoder.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- decoder.c 26 Oct 2005 12:32:41 -0000 1.1 +++ decoder.c 28 Oct 2005 20:09:47 -0000 1.2 @@ -124,7 +124,7 @@ const int tmp = get_bits(gb, 8); if((tmp>>6) != 2) - return -1; + return -2; val<<=6; val|= tmp&0x3F; } @@ -150,7 +150,7 @@ method_type = get_bits(&s->gb, 2); if (method_type != 0){ //fprintf(stderr,"illegal residual coding method %d\n", method_type); - return -1; + return -3; } rice_order = get_bits(&s->gb, 4); @@ -192,7 +192,7 @@ } if (decode_residuals(s, decoded, pred_order) < 0) - return -1; + return -4; switch(pred_order) { @@ -221,7 +221,7 @@ - decoded[i-4]; break; default: - return -1; + return -5; } return 0; @@ -244,13 +244,13 @@ if (coeff_prec == 16) { //fprintf(stderr,"invalid coeff precision\n"); - return -1; + return -6; } qlevel = get_sbits(&s->gb, 5); if (qlevel < 0) { //fprintf(stderr,"qlevel %d not supported, maybe buggy stream\n", qlevel); - return -1; + return -7; } for (i = 0; i < pred_order; i++) @@ -259,7 +259,7 @@ } if (decode_residuals(s, decoded, pred_order) < 0) - return -1; + return -8; if ((s->bps + coeff_prec + av_log2(pred_order)) <= 32) { for (i = pred_order; i < s->blocksize; i++) @@ -298,8 +298,8 @@ if (get_bits1(&s->gb)) { - //av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n"); - return -1; + //fprintf(stderr,"invalid subframe padding\n"); + return -9; } type = get_bits(&s->gb, 6); // wasted = get_bits1(&s->gb); @@ -344,18 +344,18 @@ { //fprintf(stderr,"coding type: fixed\n"); if (decode_subframe_fixed(s, decoded, type & ~0x8) < 0) - return -1; + return -10; } else if (type >= 32) { //fprintf(stderr,"coding type: lpc\n"); if (decode_subframe_lpc(s, decoded, (type & ~0x20)+1) < 0) - return -1; + return -11; } else { //fprintf(stderr,"Unknown coding type: %d\n",type); - return -1; + return -12; } if (wasted) @@ -375,6 +375,7 @@ { int blocksize_code, sample_rate_code, sample_size_code, assignment, crc8; int decorrelation, bps, blocksize, samplerate; + int res; blocksize_code = get_bits(&s->gb, 4); @@ -387,7 +388,7 @@ decorrelation = LEFT_SIDE + assignment - 8; else { - return -1; + return -13; } sample_size_code = get_bits(&s->gb, 3); @@ -397,12 +398,12 @@ bps = sample_size_table[sample_size_code]; else { - return -1; + return -14; } if (get_bits1(&s->gb)) { - return -1; + return -15; } /* Get the samplenumber of the first sample in this block */ @@ -421,7 +422,7 @@ }else{ } #endif - + if (blocksize_code == 0) blocksize = s->min_blocksize; else if (blocksize_code == 6) @@ -432,7 +433,7 @@ blocksize = blocksize_table[blocksize_code]; if(blocksize > s->max_blocksize){ - return -1; + return -16; } if (sample_rate_code == 0){ @@ -446,13 +447,13 @@ else if (sample_rate_code == 14) samplerate = get_bits(&s->gb, 16) * 10; else{ - return -1; + return -17; } skip_bits(&s->gb, 8); crc8= get_crc8(s->gb.buffer, get_bits_count(&s->gb)/8); if(crc8){ - return -1; + return -18; } s->blocksize = blocksize; @@ -462,14 +463,14 @@ yield(); /* subframes */ - if (decode_subframe(s, 0, decoded0) < 0) - return -1; + if ((res=decode_subframe(s, 0, decoded0)) < 0) + return res-100; yield(); if (s->channels==2) { - if (decode_subframe(s, 1, decoded1) < 0) - return -1; + if ((res=decode_subframe(s, 1, decoded1)) < 0) + return res-200; } yield(); @@ -487,25 +488,22 @@ uint8_t *buf, int buf_size, void (*yield)(void)) { - int tmp = 0, i, input_buf_size = 0; + int tmp; + int i; int framesize; int scale; init_get_bits(&s->gb, buf, buf_size*8); - tmp = show_bits(&s->gb, 16); + tmp = get_bits(&s->gb, 16); if(tmp != 0xFFF8){ - //fprintf(stderr,"FRAME HEADER not here\n"); - while(get_bits_count(&s->gb)/8+2 < buf_size && show_bits(&s->gb, 16) != 0xFFF8) - skip_bits(&s->gb, 8); - goto end; // we may not have enough bits left to decode a frame, so try next time + return -41; } - skip_bits(&s->gb, 16); if ((framesize=decode_frame(s,decoded0,decoded1,yield)) < 0){ s->bitstream_size=0; s->bitstream_index=0; - return -1; + return framesize; } yield(); @@ -567,18 +565,5 @@ break; } -end: - i= (get_bits_count(&s->gb)+7)/8;; - if(i > buf_size){ - s->bitstream_size=0; - s->bitstream_index=0; - return -1; - } - - if(s->bitstream_size){ - s->bitstream_index += i; - s->bitstream_size -= i; - return input_buf_size; - }else - return i; + return 0; } _______________________________________________ rockbox-cvs mailing list rockbox-cvs@xxxxxxxxxxxx http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs

Previous Message by Thread: click to view message preview

amiconn: firmware usb.c,1.65,1.66

Update of /cvsroot/rockbox/firmware In directory labb:/tmp/cvs-serv14590/firmware Modified Files: usb.c Log Message: USB power mode: Made the code ignore the power button (On for recorder fm/v2, OnOff for Ondio) to make it easier to enter USB power mode at startup. Index: usb.c =================================================================== RCS file: /cvsroot/rockbox/firmware/usb.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- usb.c 22 Aug 2005 13:27:56 -0000 1.65 +++ usb.c 28 Oct 2005 18:47:25 -0000 1.66 @@ -58,8 +58,10 @@ #if CONFIG_KEYPAD == RECORDER_PAD #define USBPOWER_BUTTON BUTTON_F1 +#define USBPOWER_BTN_IGNORE BUTTON_ON #elif CONFIG_KEYPAD == ONDIO_PAD #define USBPOWER_BUTTON BUTTON_MENU +#define USBPOWER_BTN_IGNORE BUTTON_OFF #endif #endif /* HAVE_USB_POWER */ @@ -225,7 +227,7 @@ else #endif #ifdef HAVE_USB_POWER - if(button_status() == USBPOWER_BUTTON) + if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON) { usb_state = USB_POWERED; } _______________________________________________ rockbox-cvs mailing list rockbox-cvs@xxxxxxxxxxxx http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs

Next Message by Thread: click to view message preview

dave: apps/codecs/libffmpegFLAC decoder.c,1.1,1.2

Update of /cvsroot/rockbox/apps/codecs/libffmpegFLAC In directory labb:/tmp/cvs-serv30990/libffmpegFLAC Modified Files: decoder.c Log Message: Add more useful error codes from decoder Index: decoder.c =================================================================== RCS file: /cvsroot/rockbox/apps/codecs/libffmpegFLAC/decoder.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- decoder.c 26 Oct 2005 12:32:41 -0000 1.1 +++ decoder.c 28 Oct 2005 20:09:47 -0000 1.2 @@ -124,7 +124,7 @@ const int tmp = get_bits(gb, 8); if((tmp>>6) != 2) - return -1; + return -2; val<<=6; val|= tmp&0x3F; } @@ -150,7 +150,7 @@ method_type = get_bits(&s->gb, 2); if (method_type != 0){ //fprintf(stderr,"illegal residual coding method %d\n", method_type); - return -1; + return -3; } rice_order = get_bits(&s->gb, 4); @@ -192,7 +192,7 @@ } if (decode_residuals(s, decoded, pred_order) < 0) - return -1; + return -4; switch(pred_order) { @@ -221,7 +221,7 @@ - decoded[i-4]; break; default: - return -1; + return -5; } return 0; @@ -244,13 +244,13 @@ if (coeff_prec == 16) { //fprintf(stderr,"invalid coeff precision\n"); - return -1; + return -6; } qlevel = get_sbits(&s->gb, 5); if (qlevel < 0) { //fprintf(stderr,"qlevel %d not supported, maybe buggy stream\n", qlevel); - return -1; + return -7; } for (i = 0; i < pred_order; i++) @@ -259,7 +259,7 @@ } if (decode_residuals(s, decoded, pred_order) < 0) - return -1; + return -8; if ((s->bps + coeff_prec + av_log2(pred_order)) <= 32) { for (i = pred_order; i < s->blocksize; i++) @@ -298,8 +298,8 @@ if (get_bits1(&s->gb)) { - //av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n"); - return -1; + //fprintf(stderr,"invalid subframe padding\n"); + return -9; } type = get_bits(&s->gb, 6); // wasted = get_bits1(&s->gb); @@ -344,18 +344,18 @@ { //fprintf(stderr,"coding type: fixed\n"); if (decode_subframe_fixed(s, decoded, type & ~0x8) < 0) - return -1; + return -10; } else if (type >= 32) { //fprintf(stderr,"coding type: lpc\n"); if (decode_subframe_lpc(s, decoded, (type & ~0x20)+1) < 0) - return -1; + return -11; } else { //fprintf(stderr,"Unknown coding type: %d\n",type); - return -1; + return -12; } if (wasted) @@ -375,6 +375,7 @@ { int blocksize_code, sample_rate_code, sample_size_code, assignment, crc8; int decorrelation, bps, blocksize, samplerate; + int res; blocksize_code = get_bits(&s->gb, 4); @@ -387,7 +388,7 @@ decorrelation = LEFT_SIDE + assignment - 8; else { - return -1; + return -13; } sample_size_code = get_bits(&s->gb, 3); @@ -397,12 +398,12 @@ bps = sample_size_table[sample_size_code]; else { - return -1; + return -14; } if (get_bits1(&s->gb)) { - return -1; + return -15; } /* Get the samplenumber of the first sample in this block */ @@ -421,7 +422,7 @@ }else{ } #endif - + if (blocksize_code == 0) blocksize = s->min_blocksize; else if (blocksize_code == 6) @@ -432,7 +433,7 @@ blocksize = blocksize_table[blocksize_code]; if(blocksize > s->max_blocksize){ - return -1; + return -16; } if (sample_rate_code == 0){ @@ -446,13 +447,13 @@ else if (sample_rate_code == 14) samplerate = get_bits(&s->gb, 16) * 10; else{ - return -1; + return -17; } skip_bits(&s->gb, 8); crc8= get_crc8(s->gb.buffer, get_bits_count(&s->gb)/8); if(crc8){ - return -1; + return -18; } s->blocksize = blocksize; @@ -462,14 +463,14 @@ yield(); /* subframes */ - if (decode_subframe(s, 0, decoded0) < 0) - return -1; + if ((res=decode_subframe(s, 0, decoded0)) < 0) + return res-100; yield(); if (s->channels==2) { - if (decode_subframe(s, 1, decoded1) < 0) - return -1; + if ((res=decode_subframe(s, 1, decoded1)) < 0) + return res-200; } yield(); @@ -487,25 +488,22 @@ uint8_t *buf, int buf_size, void (*yield)(void)) { - int tmp = 0, i, input_buf_size = 0; + int tmp; + int i; int framesize; int scale; init_get_bits(&s->gb, buf, buf_size*8); - tmp = show_bits(&s->gb, 16); + tmp = get_bits(&s->gb, 16); if(tmp != 0xFFF8){ - //fprintf(stderr,"FRAME HEADER not here\n"); - while(get_bits_count(&s->gb)/8+2 < buf_size && show_bits(&s->gb, 16) != 0xFFF8) - skip_bits(&s->gb, 8); - goto end; // we may not have enough bits left to decode a frame, so try next time + return -41; } - skip_bits(&s->gb, 16); if ((framesize=decode_frame(s,decoded0,decoded1,yield)) < 0){ s->bitstream_size=0; s->bitstream_index=0; - return -1; + return framesize; } yield(); @@ -567,18 +565,5 @@ break; } -end: - i= (get_bits_count(&s->gb)+7)/8;; - if(i > buf_size){ - s->bitstream_size=0; - s->bitstream_index=0; - return -1; - } - - if(s->bitstream_size){ - s->bitstream_index += i; - s->bitstream_size -= i; - return input_buf_size; - }else - return i; + return 0; } _______________________________________________ rockbox-cvs mailing list rockbox-cvs@xxxxxxxxxxxx http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by