diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-22 22:14:14 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-22 22:14:14 +0000 |
commit | f87e61e782b65e09f6b8c3caa9e0f55aaf5208cb (patch) | |
tree | 13d6cd882d60bb3fb771ea9b8421ec21d60818de /libmpcodecs | |
parent | 37bab5c5445e1d43f53b7a94382efdfbc3968988 (diff) | |
download | mpv-f87e61e782b65e09f6b8c3caa9e0f55aaf5208cb.tar.bz2 mpv-f87e61e782b65e09f6b8c3caa9e0f55aaf5208cb.tar.xz |
the value returned by decode_audio() must be the amount of _decoded_ bytes (finally it's beginning t work: no more toomanypackets... message)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19162 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_hwmpa.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libmpcodecs/ad_hwmpa.c b/libmpcodecs/ad_hwmpa.c index 1057b0d2e4..b1dfe1a0a8 100644 --- a/libmpcodecs/ad_hwmpa.c +++ b/libmpcodecs/ad_hwmpa.c @@ -59,7 +59,7 @@ static int mpa_sync(sh_audio_t *sh, int no_frames, int *n, int *chans, int *srat static int preinit(sh_audio_t *sh) { - sh->audio_out_minsize = 48;//check + sh->audio_out_minsize = 4608;//check sh->audio_in_minsize = 4608;//check sh->sample_format = AF_FORMAT_MPEG2; return 1; @@ -85,13 +85,14 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) { int len, start, tot; int chans, srate, spf, mpa_layer, br; + int tot2; - tot = 0; + tot = tot2 = 0; - while(tot < minlen) + while(tot2 < maxlen) { start = mpa_sync(sh, 1, &len, &chans, &srate, &spf, &mpa_layer, &br); - if(start < 0 || tot + len > maxlen) + if(start < 0 || tot2 + spf * 2 * chans > maxlen) break; if(start + len > sh->a_in_buffer_len) @@ -110,9 +111,10 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) sh->a_in_buffer_len -= start + len; memmove(sh->a_in_buffer, &(sh->a_in_buffer[start + len]), sh->a_in_buffer_len); + tot2 += spf * 2 * chans; } - return tot; + return tot2; } |