summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-10 02:19:43 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-10 02:19:43 +0000
commit6c4c3576b74066e3f3df0d3ddbf1287f20a067d6 (patch)
treec995e57b86e6587adfe6ecb1022b89833252caa8 /libmpcodecs
parent93bb3340839063e8edb672a4235e8b8c38c60473 (diff)
downloadmpv-6c4c3576b74066e3f3df0d3ddbf1287f20a067d6.tar.bz2
mpv-6c4c3576b74066e3f3df0d3ddbf1287f20a067d6.tar.xz
yeah, it worx! but needs a big cleanup and removal of hardcoded stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6369 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_real.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/libmpcodecs/ad_real.c b/libmpcodecs/ad_real.c
index 82b50ca252..592e34717e 100644
--- a/libmpcodecs/ad_real.c
+++ b/libmpcodecs/ad_real.c
@@ -112,7 +112,7 @@ static int preinit(sh_audio_t *sh){
}
sh->audio_out_minsize=128000; //sh->samplerate*sh->samplesize*sh->channels;
- sh->audio_in_minsize=2*sh->wf->nBlockAlign;
+ sh->audio_in_minsize=10*sh->wf->nBlockAlign;
// sh->samplesize=2;
// sh->channels=2;
// sh->samplerate=44100;
@@ -141,12 +141,23 @@ static void uninit(sh_audio_t *sh){
static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){
int result;
int len=-1;
+
+ if(sh->a_in_buffer_len<=0){
+ // fill the buffer!
+ int x,y;
+ for(y=0;y<10;y++)
+ for(x=0;x<10;x++){
+ demux_read_data(sh->ds, sh->a_in_buffer+10*60*x+60*5*(y&1)+60*(y>>1), 60);
+ }
+ sh->a_in_buffer_len=10*10*60;
+ }
- demux_read_data(sh->ds, sh->a_in_buffer, 60);
+// demux_read_data(sh->ds, sh->a_in_buffer, 600);
- result=raDecode(sh->context, sh->a_in_buffer, sh->wf->nBlockAlign,
+ result=raDecode(sh->context, sh->a_in_buffer+10*10*60-sh->a_in_buffer_len, sh->wf->nBlockAlign,
buf, &len, -1);
-
+ sh->a_in_buffer_len-=sh->wf->nBlockAlign;
+
printf("radecode: %d bytes, res=0x%X \n",len,result);
// audio decoding. the most important thing :)
@@ -168,7 +179,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen)
// ds_get_packet(sh->ds, &buffer) - set ptr buffer to next data packet
// (both func return number of bytes or 0 for error)
- return len/8; // return value: number of _bytes_ written to output buffer,
+ return len; // return value: number of _bytes_ written to output buffer,
// or -1 for EOF (or uncorrectable error)
}