--- margi2/decoder.c 2001/03/29 23:12:01 1.10 +++ margi2/decoder.c 2001/04/06 09:03:54 1.11 @@ -955,7 +955,6 @@ void L64021Intr(struct cvdv_cards *card) int i, a, v, as, vs, ap, vp; u8 intr[5]; u8 layer; - u8 reg; long ISRTime, DeltaSyncTime, Offset; int used = 0; @@ -975,26 +974,35 @@ void L64021Intr(struct cvdv_cards *card) card->fields++; if (card->videoffwd){ - AudioStopDecode(card); - card->videosync = 0; - card->videodelay = 0; - card->videoskip = 0; - reg = DecoderReadByte(card, 0x0EC); - if ((reg & 0x07) == 0x00) { - DecoderWriteByte(card, 0x0EC, - (card->videoffwd& - 0x03) |0x04); - } - } else if ((DecoderReadByte(card, 0x0EC) & 0x07) - && !card->videoskip){ + if (!card->videoffwd_last){ + AudioStopDecode(card); + card->videosync = 0; + card->videoskip = card->videoffwd; + card->videoskip = 0; + card->videoffwd_last = 1; + card->videoskip_last = 0; + } else { + if (card->videoskip_last == -1){ + card->videoskip = + card->videoffwd; + } + + if (!card->videoskip) + card->videoskip_last = -1; + else + card->videoffwd_last = + card->videoffwd; + } + } else if( card->videoffwd_last ){ + card->videoffwd_last = 0; #ifdef DVB if (card->audiostate.AVSyncState) #endif card->videosync = 1; - DecoderWriteByte(card, 0x0EC, 0x00); AudioStartDecode(card); - } - + } + + if (card->videoslow){ if (!card->videoslow_last){ AudioStopDecode(card); @@ -1046,7 +1054,7 @@ void L64021Intr(struct cvdv_cards *card) } else if (card->videoskip > 0) { if ((DecoderReadByte(card, 0x0EC) & 0x03) == 0x00) { - if (DecoderReadWord(card, 0x096) > 5) { + if (DecoderReadWord(card, 0x096) > 5){ // pictures in video ES channel card->videoskip--; if(card->videoskip) { @@ -1074,7 +1082,7 @@ void L64021Intr(struct cvdv_cards *card) vs = card->VideoESSize; if (vs > 0) vp = (100 * v) / vs; else vp = 0; - if (vp > 80) { + if (vp > 40) { printk(KERN_ERR LOGNAME ": Delayed Video Decoder start\n"); card->startingV = 0; @@ -1089,7 +1097,7 @@ void L64021Intr(struct cvdv_cards *card) as = card->AudioESSize; if (as > 0) ap = (100 * a) / as; else ap = 0; - if (ap > 80) { + if (ap > 40) { printk(KERN_ERR LOGNAME ": Delayed Audio Decoder start\n"); AudioSetPlayMode(card, MAUDIO_PLAY); @@ -1212,8 +1220,8 @@ void L64021Intr(struct cvdv_cards *card) if (intr[3] & 0x30) { // Audio/Video ES channel buffer underflow - printk(KERN_ERR LOGNAME - ": Int - ES channel buffer underflow\n"); + //printk(KERN_ERR LOGNAME + // ": Int - ES channel buffer underflow\n"); if (card->closing) { card->closing = 0; CloseCard(card);