[MPlayer-dev-eng] [PATCH] ao_dart: use libavutil fifo

KO Myung-Hun komh at chollian.net
Sat Aug 8 09:24:36 CEST 2009


Hi/2.

Reimar Do"ffinger wrote:
>  static int read_buffer(unsigned char *data, int len)
>  {
> -    int nFirstLen = m_nBufSize - m_iBufReadPos;
> -    int nBuffered = buf_used();
> +    int nBuffered = av_fifo_size(m_audioBuf);
>  
>      if (len > nBuffered)
>          len = nBuffered;
>  
> -    if (nFirstLen > len)
> -        nFirstLen = len;
> -
> -    // till end of buffer
> -    fast_memcpy(data, m_audioBuf + m_iBufReadPos, nFirstLen);
> -    if (len > nFirstLen) { // we have to wrap around
> -        // remaining part from beginning of buffer
> -        fast_memcpy(data + nFirstLen, m_audioBuf, len - nFirstLen);
> -    }
> -
> -    m_iBufReadPos = (m_iBufReadPos + len) % m_nBufSize;
> -
> -    return len;
> +    return av_fifo_generic_read(m_audioBuf, data, len, NULL);
>  }
>  

av_fifo_generic_read() always returns 0. So, you should return 'len'.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.16
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr





More information about the MPlayer-dev-eng mailing list