Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: vbv delay/buffer overflows on VBR statmux



Oliver Endriss wrote:
> Klaus Schmidinger wrote:
> > Oliver Endriss wrote:
> > > ...
> > > It simply patches the bit_rate in the sequence header to 15 MBit.
> > > Works fine here.
> >
> > I just tried this with a recording of today's "Quarks & Co" and I'm
> > afraid this patch somehow causes video glitches. There is at least
> > one place where I have picture distortions with the patch that are
> > not there without it.
>
> I really *hate* these kind of patches, especially as it requires
> scanning the buffer for sequence headers.
> But apparently we have no choice at the moment. ;-(

Next try. I added some code to skip the pes header extension.

--- /home/endriss/cvs-work/DVB/driver/av7110/av7110.c	Sat May 17 05:12:30 2003
+++ av7110.c	Wed May 21 01:44:30 2003
@@ -1116,6 +1116,8 @@ pes_play(void *dest, ring_buffer_t *buf,
         int len, split=0;
         u32 sync;
         u16 blen;
+        int i;
+        unsigned char *p;
 
         dprintk ("function : %s\n", __FUNCTION__);
         if (!dlen) {
@@ -1165,6 +1167,27 @@ pes_play(void *dest, ring_buffer_t *buf,
         
         dprintk ("function: %s pread=%08x pwrite=%08x\n", __FUNCTION__,
                 buf->pread, buf->pwrite);
+
+	if ((sync&~0x0f) == 0x000001e0) { // process video packets only
+		p = dest;
+		if ((p[6] & 0xc0) == 0x80)
+			i = 9 + p[8]; // skip pes header extension
+		else
+			i = 6;
+
+		for (; i < ((int)blen)-10; i++) {
+			if (p[i] || p[i+1] || p[i+2] != 1)
+				continue;
+
+			if (p[i+3] == 0xb3) { // sequence header
+				//printk ("seq(%d): bit_rate %.2x %.2x %.2x\n", i, p[i+8], p[i+9], p[i+10]);
+				p[i+8] = 0x24; // 15 MBit/s
+				p[i+9] = 0x9f;
+				i += 11;
+			}
+		}
+	}
+
         wake_up(&buf->queue);
         return blen;
 }


Oliver



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index