--- margi2/margi.c 2000/12/14 12:17:44 1.3 +++ margi2/margi.c 2001/01/22 05:01:52 1.4 @@ -345,14 +345,11 @@ static int ringDMA (struct cvdv_cards *c u8 data; count = ring_read_rest(&(card->rbuf)); - if (count < 4096) { + if (count < 2048) { card->DMAABusy = 0; wake_up_interruptible(&(card->wqA)); return 0; - } else if ( card->stream.sh.valid ) - DecoderStartDecode(card); - - + } stat = read_lsi_status(card); /* printk(KERN_DEBUG LOGNAME @@ -376,10 +373,18 @@ static int ringDMA (struct cvdv_cards *c if (count>=2048) count &=0xfffff800; count &=0xfffffffc; + if (!size && + !card->DecoderOpen){ + printk(KERN_DEBUG LOGNAME + ": -- PREPARE IT ALREADY\n"); + Prepare(card); + } + + if (count > size) count = size & 0xfffffffc; /* printk(KERN_DEBUG LOGNAME - ": -- stat: %d length: %d size: %d\n", - stat,count,size); + ": -- stat: %d length: %d size: %d startV: %d startA: %d\n", + stat,count,size, card->startingV, card->startingA); */ if (count) { ring_read_direct(&(card->rbuf), @@ -671,6 +676,7 @@ void CardDeInit(struct cvdv_cards *card) MargiFlush(card); MargiFreeBuffers(card); L64014RemoveIntr(card); + card_init(card, 0); }