diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 442 |
1 files changed, 127 insertions, 315 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index be2e84297..5bf6a7e26 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -541,150 +541,6 @@ AV_Stop(av7110_t *av7110, int av) } } -/**************************************************************************** - * Buffer handling - ****************************************************************************/ - -static inline void -ring_buffer_flush(ring_buffer_t *rbuf) -{ - spin_lock_irq(&rbuf->lock); - rbuf->pwrite=rbuf->pread; - spin_unlock_irq(&rbuf->lock); - wake_up(&rbuf->queue); -} - -static inline void -ring_buffer_init(ring_buffer_t *rbuf, u8 *data, int len) -{ - rbuf->pread=rbuf->pwrite=0; - rbuf->data=data; - rbuf->size=len; - init_waitqueue_head(&rbuf->queue); - spin_lock_init(&(rbuf->lock)); - rbuf->lock=SPIN_LOCK_UNLOCKED; - sema_init(&(rbuf->sema), 1); -} - -static inline -int ring_buffer_empty(ring_buffer_t *rbuf) -{ - return (rbuf->pread==rbuf->pwrite); -} - -static inline -int ring_buffer_free(ring_buffer_t *rbuf) -{ - int free; - - free=rbuf->pread - rbuf->pwrite; - if (free<=0) - free+=rbuf->size; - return free; -} - -static inline -int ring_buffer_avail(ring_buffer_t *rbuf) -{ - int avail; - - avail=rbuf->pwrite - rbuf->pread; - if (avail<0) - avail+=rbuf->size; - return avail; -} - -#if 0 -static void -ring_buffer_block(ring_buffer_t *rbuf, unsigned long count) -{ - if (ring_buffer_free(rbuf)>=count) - return; - while (!wait_event_interruptible(rbuf->queue, - (ring_buffer_free(rbuf)>=count))); -} -#endif - -static long -ring_buffer_write(ring_buffer_t *rbuf, - const char *buf, unsigned long count, - int nonblock, int usermem) -{ - unsigned long todo = count; - int free, split; - - while (todo > 0) { - if (ring_buffer_free(rbuf)<=2048) { - if (nonblock) - return count-todo; - if (wait_event_interruptible(rbuf->queue, - (ring_buffer_free(rbuf)>2048))) - return count-todo; - } - DEB_S(("pread=%08x, pwrite=%08x\n",rbuf->pread, rbuf->pwrite)); - //mdelay(2); - free = rbuf->pread - rbuf->pwrite; - split=rbuf->size; - if (free<=0) { - free+=rbuf->size; - split-=rbuf->pwrite; - } - if (free > todo) - free = todo; - - if (split < free) { - if (!usermem) - memcpy(rbuf->data+rbuf->pwrite, buf, split); - else - if (copy_from_user(rbuf->data+rbuf->pwrite, - buf, split)) - return -EFAULT; - buf += split; - todo -= split; - free -= split; - rbuf->pwrite = 0; - } - if (!usermem) - memcpy(rbuf->data+rbuf->pwrite, buf, free); - else - if (copy_from_user(rbuf->data+rbuf->pwrite, buf, free)) - return -EFAULT; - rbuf->pwrite = (rbuf->pwrite + free)%rbuf->size; - todo -= free; - buf += free; - } - - return count-todo; -} - -#if 0 -static void -ring_buffer_put(ring_buffer_t *db, u8 *buf, int len) -{ - int split, fsize; - - fsize=db->pread - db->pwrite; - if (fsize <= 0) { - fsize+=db->size; - split=db->size-db->pwrite; - } else - split=0; - if (len>=fsize) { - DEB_S(("buffer overflow, len:%d, size:%d\n",len,size)); - return; - } - if (split>=len) - split=0; - if (split) { - memcpy(db->data + db->pwrite, buf, split); - len-=split; - db->pwrite=0; - } - memcpy(db->data + db->pwrite, split + buf, len); - db->pwrite=(db->pwrite+len)%db->size; -} -#endif - /** * Hack! we save the last av7110 ptr. This should be ok, since * you rarely will use more then one IR control. @@ -845,28 +701,16 @@ print_time(char *s) } static void -ci_get_data(ring_buffer_t *cibuf, u8 *data, int len) +ci_get_data(dvb_ringbuffer_t *cibuf, u8 *data, int len) { - int free, split=0, pread=cibuf->pread; - - free=pread-cibuf->pwrite; - if (free<=0) - free+=cibuf->size; - if (free<=len+2) + if (dvb_ringbuffer_free(cibuf) < len+2) return; - cibuf->data[cibuf->pwrite]=(len>>8); - cibuf->data[(cibuf->pwrite+1)%cibuf->size]=(len&0xff); - cibuf->pwrite=(cibuf->pwrite+2)%cibuf->size; - - if (pread<=cibuf->pwrite) - split=cibuf->size-cibuf->pwrite; - if (split && split<len) { - memcpy(cibuf->data + cibuf->pwrite, data, split); - memcpy(cibuf->data, data+split, len-split); - } else - memcpy(cibuf->data + cibuf->pwrite, data, len); - cibuf->pwrite=(cibuf->pwrite+len)%cibuf->size; - + + DVB_RINGBUFFER_WRITE_BYTE(cibuf,len>>8); + DVB_RINGBUFFER_WRITE_BYTE(cibuf,len&0xff); + + dvb_ringbuffer_write(cibuf,data,len,0); + wake_up_interruptible(&cibuf->queue); } @@ -1000,59 +844,44 @@ void debiirq (unsigned long data) } static int -pes_play(void *dest, ring_buffer_t *buf, int dlen) +pes_play(void *dest, dvb_ringbuffer_t *buf, int dlen) { - int len, split=0; + int len; u32 sync; u16 blen; - DEB_EE(("ring_buffer_t: %p\n",buf)); + DEB_EE(("dvb_ring_buffer_t: %p\n",buf)); if (!dlen) { wake_up(&buf->queue); return -1; } while (1) { - if ((len=ring_buffer_avail(buf)) < 6) + if ((len=dvb_ringbuffer_avail(buf)) < 6) return -1; - sync=(buf->data[buf->pread])<<24; - sync|=(buf->data[(buf->pread+1)%buf->size]<<16); - sync|=(buf->data[(buf->pread+2)%buf->size]<<8); - sync|=buf->data[(buf->pread+3)%buf->size]; + sync= DVB_RINGBUFFER_PEEK(buf,0)<<24; + sync|=DVB_RINGBUFFER_PEEK(buf,1)<<16; + sync|=DVB_RINGBUFFER_PEEK(buf,2)<<8; + sync|=DVB_RINGBUFFER_PEEK(buf,3); if (((sync&~0x1f)==0x000001e0) || ((sync&~0x1f)==0x000001c0) || (sync==0x000001bd)) break; printk("resync\n"); - buf->pread=(buf->pread+1)%buf->size; + DVB_RINGBUFFER_SKIP(buf,1); } - blen=(buf->data[(buf->pread+4)%buf->size]<<8); - blen|=buf->data[(buf->pread+5)%buf->size]; + blen= DVB_RINGBUFFER_PEEK(buf,4)<<8; + blen|=DVB_RINGBUFFER_PEEK(buf,5); blen+=6; - if (len<blen || blen > dlen) { - printk("buffer empty\n"); + if (len<blen || blen>dlen) { + printk("buffer empty - avail %d blen %u dlen %d\n",len,blen,dlen); wake_up(&buf->queue); return -1; } -/* if (blen>2048) { - buf->pread=(buf->pread+blen)%buf->size; - printk("packet too large\n"); - return -1; - } -*/ - len=blen; - if (buf->pread + len > buf->size) - split=buf->size-buf->pread; - if (split>0) { - memcpy(dest, buf->data+buf->pread, split); - buf->pread=0; - len-=split; - } - memcpy(split + dest, - buf->data + buf->pread, len); - buf->pread = (buf->pread +len)%buf->size; - + + (void)dvb_ringbuffer_read(buf,dest,(size_t)blen,0); + DEB_S(("pread=%08x, pwrite=%08x\n",buf->pread, buf->pwrite)); wake_up(&buf->queue); return blen; @@ -1098,38 +927,28 @@ void gpioirq (unsigned long data) case DATA_CI_PUT: { - int avail, split=0, pwrite; - ring_buffer_t *cibuf=&av7110->ci_wbuffer; + int avail; + dvb_ringbuffer_t *cibuf=&av7110->ci_wbuffer; - pwrite=cibuf->pwrite; - avail=pwrite-cibuf->pread; - if (avail<0) - avail+=cibuf->size; + avail=dvb_ringbuffer_avail(cibuf); if (avail<=2) { iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_LEN, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2); break; } - len=(cibuf->data[cibuf->pread]<<8); - len|=cibuf->data[(cibuf->pread+1)%cibuf->size]; + len= DVB_RINGBUFFER_PEEK(cibuf,0)<<8; + len|=DVB_RINGBUFFER_PEEK(cibuf,1); if (avail<len+2) { iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_LEN, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2); break; } - cibuf->pread=(cibuf->pread+2)%cibuf->size; - - if (pwrite<cibuf->pread) - split=cibuf->size-cibuf->pread; - if (split && split<len) { - int todo=len-split; - memcpy(av7110->debi_virt, cibuf->data+cibuf->pread, split); - memcpy(av7110->debi_virt+split, cibuf->data, todo); - } else - memcpy(av7110->debi_virt, cibuf->data+cibuf->pread, len); - cibuf->pread=(cibuf->pread+len)%cibuf->size; + DVB_RINGBUFFER_SKIP(cibuf,2); + + dvb_ringbuffer_read(cibuf,av7110->debi_virt,len,0); + wake_up(&cibuf->queue); iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2); iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2); @@ -2411,6 +2230,29 @@ get_video_format(av7110_t *av7110, u8 *buf, int count) } } +static inline long +aux_ring_buffer_write(dvb_ringbuffer_t *rbuf, const char *buf, unsigned long count) +{ + unsigned long todo = count; + int free; + + while (todo > 0) { + if (dvb_ringbuffer_free(rbuf)<2048) { + if (wait_event_interruptible(rbuf->queue, + (dvb_ringbuffer_free(rbuf)>=2048))) + return count-todo; + } + free = dvb_ringbuffer_free(rbuf); + if (free > todo) + free = todo; + (void)dvb_ringbuffer_write(rbuf,buf,free,0); + todo -= free; + buf += free; + } + + return count-todo; +} + static void play_video_cb(u8 *buf, int count, void *priv) { @@ -2419,9 +2261,9 @@ play_video_cb(u8 *buf, int count, void *priv) if ((buf[3]&0xe0)==0xe0) { get_video_format(av7110, buf, count); - ring_buffer_write(&av7110->avout, buf, count, 0, 0); + aux_ring_buffer_write(&av7110->avout, buf, count); } else - ring_buffer_write(&av7110->aout, buf, count, 0, 0); + aux_ring_buffer_write(&av7110->aout, buf, count); } static void @@ -2430,10 +2272,10 @@ play_audio_cb(u8 *buf, int count, void *priv) av7110_t *av7110=(av7110_t *) priv; DEB_EE(("av7110: %p\n",av7110)); - ring_buffer_write(&av7110->aout, buf, count, 0, 0); + aux_ring_buffer_write(&av7110->aout, buf, count); } -#define FREE_COND (ring_buffer_free(&av7110->avout)>=20*1024 && ring_buffer_free(&av7110->aout)>=20*1024) +#define FREE_COND (dvb_ringbuffer_free(&av7110->avout)>=20*1024 && dvb_ringbuffer_free(&av7110->aout)>=20*1024) static ssize_t dvb_play(av7110_t *av7110, const u8 *buf, @@ -2483,15 +2325,15 @@ dvb_aplay(av7110_t *av7110, const u8 *buf, if (!av7110->kbuf[type]) return -ENOBUFS; - if (nonblock && ring_buffer_free(&av7110->aout)<20*1024) + if (nonblock && dvb_ringbuffer_free(&av7110->aout)<20*1024) return -EWOULDBLOCK; while (todo>0) { - if (ring_buffer_free(&av7110->aout)<20*1024) { + if (dvb_ringbuffer_free(&av7110->aout)<20*1024) { if (nonblock) return count-todo; if (wait_event_interruptible(av7110->aout.queue, - (ring_buffer_free(&av7110->aout)>= + (dvb_ringbuffer_free(&av7110->aout)>= 20*1024))) return count-todo; } @@ -2804,7 +2646,7 @@ unsigned int dvb_audio_poll(struct file *file, poll_table *wait) if (av7110->playing) { poll_wait(file, &av7110->aout.queue, wait); - if (ring_buffer_free(&av7110->aout)>20*1024) + if (dvb_ringbuffer_free(&av7110->aout)>20*1024) mask |= (POLLOUT | POLLWRNORM); } else /* if not playing: may play if asked for */ mask = (POLLOUT | POLLWRNORM); @@ -3045,8 +2887,8 @@ av7110_start_feed(struct dvb_demux_feed *feed) if (feed->pes_type < 2 && !(demux->pids[0] & 0x8000) && !(demux->pids[1] & 0x8000)) { - ring_buffer_flush(&av7110->avout); - ring_buffer_flush(&av7110->aout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout); AV_StartPlay(av7110,RP_AV); demux->playing = 1; } @@ -3194,20 +3036,20 @@ int av7110_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) * CI link layer file ops (FIXME: move this to separate module later) ******************************************************************************/ -int ci_ll_init(ring_buffer_t *cirbuf, ring_buffer_t *ciwbuf, int size) +int ci_ll_init(dvb_ringbuffer_t *cirbuf, dvb_ringbuffer_t *ciwbuf, int size) { - ring_buffer_init(cirbuf, vmalloc(size), size); - ring_buffer_init(ciwbuf, vmalloc(size), size); + dvb_ringbuffer_init(cirbuf, vmalloc(size), size); + dvb_ringbuffer_init(ciwbuf, vmalloc(size), size); return 0; } -void ci_ll_flush(ring_buffer_t *cirbuf, ring_buffer_t *ciwbuf) +void ci_ll_flush(dvb_ringbuffer_t *cirbuf, dvb_ringbuffer_t *ciwbuf) { - ring_buffer_flush(cirbuf); - ring_buffer_flush(ciwbuf); + dvb_ringbuffer_flush_spinlock_wakeup(cirbuf); + dvb_ringbuffer_flush_spinlock_wakeup(ciwbuf); } -void ci_ll_release(ring_buffer_t *cirbuf, ring_buffer_t *ciwbuf) +void ci_ll_release(dvb_ringbuffer_t *cirbuf, dvb_ringbuffer_t *ciwbuf) { vfree(cirbuf->data); cirbuf->data=0; @@ -3216,109 +3058,79 @@ void ci_ll_release(ring_buffer_t *cirbuf, ring_buffer_t *ciwbuf) } -int ci_ll_reset(ring_buffer_t *cibuf, struct file *file, +int ci_ll_reset(dvb_ringbuffer_t *cibuf, struct file *file, int slots, ca_slot_info_t *slot) { int i; + int len=0; + u8 msg[8]={0x00,0x06,0,0x00,0xff,0x02,0x00,0x00}; - if (ring_buffer_free(cibuf)<=8) - return -EBUSY; + for (i=0; i<2; i++) { + if (slots & (1<<i)) + len+=8; + } + + if (dvb_ringbuffer_free(cibuf) < len) + return -EBUSY; for (i=0; i<2; i++) { - if (slots&(1<<i)) { - cibuf->data[cibuf->pwrite]=0x00; - cibuf->data[(cibuf->pwrite+1)%cibuf->size]=0x06; - cibuf->data[(cibuf->pwrite+2)%cibuf->size]=i; - cibuf->data[(cibuf->pwrite+3)%cibuf->size]=0x00; - cibuf->data[(cibuf->pwrite+4)%cibuf->size]=0xff; - cibuf->data[(cibuf->pwrite+5)%cibuf->size]=0x02; - cibuf->data[(cibuf->pwrite+6)%cibuf->size]=0x00; - cibuf->data[(cibuf->pwrite+7)%cibuf->size]=0x00; - cibuf->pwrite=(cibuf->pwrite+8)%cibuf->size; - slot[i].flags=0; - } + if (slots & (1<<i)) { + msg[2]=i; + dvb_ringbuffer_write(cibuf,msg,8,0); + slot[i].flags=0; + } } return 0; } static ssize_t -ci_ll_write(ring_buffer_t *cibuf, struct file *file, const char *buf, size_t count, loff_t *ppos) +ci_ll_write(dvb_ringbuffer_t *cibuf, struct file *file, const char *buf, size_t count, loff_t *ppos) { - int free, split; - int32_t pread; + int free; int non_blocking=file->f_flags&O_NONBLOCK; - + if (count>2048) return -EINVAL; - pread=cibuf->pread; - free=pread-cibuf->pwrite; - if (free<=0) - free+=cibuf->size; - if (count+2>=free) { + free=dvb_ringbuffer_free(cibuf); + if (count+2>free) { if (non_blocking) return -EWOULDBLOCK; if (wait_event_interruptible(cibuf->queue, - (ring_buffer_free(cibuf)>count+2))) + (dvb_ringbuffer_free(cibuf)>=count+2))) return 0; } - cibuf->data[cibuf->pwrite]=(count>>8); - cibuf->data[(cibuf->pwrite+1)%cibuf->size]=(count&0xff); - cibuf->pwrite=(cibuf->pwrite+2)%cibuf->size; - if (pread>cibuf->pwrite) - split=0; - else - split=cibuf->size-cibuf->pwrite; - if (split && split<count) { - if (copy_from_user(cibuf->data + cibuf->pwrite, buf, split)) - return -EFAULT; - if (copy_from_user(cibuf->data, buf+split, count-split)) - return -EFAULT; - } else - if (copy_from_user(cibuf->data + cibuf->pwrite, buf, count)) - return -EFAULT; - cibuf->pwrite=(cibuf->pwrite+count)%cibuf->size; - return count; + DVB_RINGBUFFER_WRITE_BYTE(cibuf,count>>8); + DVB_RINGBUFFER_WRITE_BYTE(cibuf,count&0xff); + + return dvb_ringbuffer_write(cibuf,buf,count,1); } static ssize_t -ci_ll_read(ring_buffer_t *cibuf, struct file *file, char *buf, size_t count, loff_t *ppos) +ci_ll_read(dvb_ringbuffer_t *cibuf, struct file *file, char *buf, size_t count, loff_t *ppos) { - int split=0, avail, pwrite; - int non_blocking=file->f_flags&O_NONBLOCK; - + int avail; + int non_blocking=file->f_flags&O_NONBLOCK; + ssize_t len; + if (!cibuf->data || !count) return 0; - if (non_blocking && (ring_buffer_empty(cibuf))) + if (non_blocking && (dvb_ringbuffer_empty(cibuf))) return -EWOULDBLOCK; - if (wait_event_interruptible(cibuf->queue, - !ring_buffer_empty(cibuf))) + if (wait_event_interruptible(cibuf->queue, + !dvb_ringbuffer_empty(cibuf))) return 0; - pwrite=cibuf->pwrite; - avail=pwrite - cibuf->pread; - if (avail<0) - avail+=cibuf->size; + avail=dvb_ringbuffer_avail(cibuf); if (avail<4) - return 0; - count=(cibuf->data[cibuf->pread]<<8); - count|=cibuf->data[(cibuf->pread+1)%cibuf->size]; - if (avail<count+2) - return -EINVAL; - cibuf->pread=(cibuf->pread+2)%cibuf->size; - - if (pwrite<cibuf->pread) - split=cibuf->size-cibuf->pread; - if (split && split<count) { - if (copy_to_user(buf, cibuf->data+cibuf->pread, split)) - return -EFAULT; - if (copy_to_user(buf+split, cibuf->data, count-split)) - return -EFAULT; - } else - if (copy_to_user(buf, cibuf->data+cibuf->pread, count)) - return -EFAULT; - cibuf->pread=(cibuf->pread + count)%cibuf->size; - return count; + return 0; + len= DVB_RINGBUFFER_PEEK(cibuf,0)<<8; + len|=DVB_RINGBUFFER_PEEK(cibuf,1); + if (avail<len+2 || count<len) + return -EINVAL; + DVB_RINGBUFFER_SKIP(cibuf,2); + + return dvb_ringbuffer_read(cibuf,buf,len,1); } static int @@ -3343,17 +3155,17 @@ unsigned int dvb_ca_poll (struct file *file, poll_table *wait) av7110_t *av7110 = (av7110_t *) dvbdev->priv; unsigned int mask = 0; - ring_buffer_t *rbuf = &av7110->ci_rbuffer; - ring_buffer_t *wbuf = &av7110->ci_wbuffer; + dvb_ringbuffer_t *rbuf = &av7110->ci_rbuffer; + dvb_ringbuffer_t *wbuf = &av7110->ci_wbuffer; DEB_EE(("av7110: %p\n",av7110)); poll_wait (file, &rbuf->queue, wait); - if (!ring_buffer_empty(rbuf)) + if (!dvb_ringbuffer_empty(rbuf)) mask |= POLLIN; - if (ring_buffer_avail(wbuf)>1024) + if (dvb_ringbuffer_avail(wbuf)>1024) mask |= POLLOUT; return mask; @@ -3674,7 +3486,7 @@ dvb_video_ioctl(struct inode *inode, struct file *file, { struct video_still_picture *pic= (struct video_still_picture *) parg; - ring_buffer_flush(&av7110->avout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout); play_iframe(av7110, pic->iFrame, pic->size, file->f_flags&O_NONBLOCK); break; @@ -3712,7 +3524,7 @@ dvb_video_ioctl(struct inode *inode, struct file *file, break; case VIDEO_CLEAR_BUFFER: - ring_buffer_flush(&av7110->avout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout); av7110_ipack_reset(&av7110->ipack[1]); if (av7110->playing==RP_AV) { @@ -3837,7 +3649,7 @@ dvb_audio_ioctl(struct inode *inode, struct file *file, break; case AUDIO_CLEAR_BUFFER: - ring_buffer_flush(&av7110->aout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout); av7110_ipack_reset(&av7110->ipack[0]); if (av7110->playing==RP_AV) outcom(av7110, COMTYPE_REC_PLAY, @@ -3873,8 +3685,8 @@ static int dvb_video_open(struct inode *inode, struct file *file) if ((err=dvb_generic_open(inode, file))<0) return err; - ring_buffer_flush(&av7110->aout); - ring_buffer_flush(&av7110->avout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout); av7110->video_blank=1; av7110->audiostate.AV_sync_state=1; av7110->videostate.stream_source=VIDEO_SOURCE_DEMUX; @@ -3902,7 +3714,7 @@ static int dvb_audio_open(struct inode *inode, struct file *file) if (err<0) return err; - ring_buffer_flush(&av7110->aout); + dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout); av7110->audiostate.stream_source=AUDIO_SOURCE_DEMUX; return 0; } @@ -4280,8 +4092,8 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *p goto err; } - ring_buffer_init(&av7110->avout, av7110->iobuf, AVOUTLEN); - ring_buffer_init(&av7110->aout, av7110->iobuf+AVOUTLEN, AOUTLEN); + dvb_ringbuffer_init(&av7110->avout, av7110->iobuf, AVOUTLEN); + dvb_ringbuffer_init(&av7110->aout, av7110->iobuf+AVOUTLEN, AOUTLEN); /* init BMP buffer */ av7110->bmpbuf=av7110->iobuf+AVOUTLEN+AOUTLEN; |