If you setup ivtv to capture and passthrough CC or WSS data (ivtvctl -w wss -b 
wss -x 1), then the passthrough (i.e. the captured CC or WSS data is passed 
on to the TV-out signal) fails after a skip forward or backward.

I finally had the time to setup MythTV and to do tests. It turns out that the 
MPEG decoder expects that the MPEG data arrives nicely aligned at four bytes. 
MythTV however will jump to a file position that's not four byte aligned. I 
see no effect on video or audio, but the VBI reinsertion is seriously messed 
up.

The attached patch for MythTV-0.18.1 makes sure that the seeks are always to a 
4-byte aligned position. With this patch I can no longer make the VBI 
reinsertion fail. However, fast forward or backward (i.e. not skipping but 
just faster playback) can still give problems. But this is unstable for me 
anyway: in most cases I get no good output at all.

Please test this patch and see if this fixes the problem! In the meantime I'll 
see if something can be done with the VBI reinsertion to fix it there rather 
then in MythTV. It's a bit stupid that video and audio are OK, but VBI isn't.

        Hans
diff -ru mythtv/libs/libmythtv/decoderbase.cpp mythtv-0.18.1/libs/libmythtv/decoderbase.cpp
--- mythtv/libs/libmythtv/decoderbase.cpp	2005-03-28 07:01:39.000000000 +0200
+++ mythtv-0.18.1/libs/libmythtv/decoderbase.cpp	2005-09-10 00:21:19.000000000 +0200
@@ -488,6 +488,7 @@
     {
         long long diff = keyPos - ringBuffer->GetTotalReadPosition();
 
+        diff = diff & ~3LL;
         ringBuffer->Seek(diff, SEEK_CUR);
         needflush = true;
     
diff -ru mythtv/libs/libmythtv/ivtvdecoder.cpp mythtv-0.18.1/libs/libmythtv/ivtvdecoder.cpp
--- mythtv/libs/libmythtv/ivtvdecoder.cpp	2005-02-26 23:20:55.000000000 +0100
+++ mythtv-0.18.1/libs/libmythtv/ivtvdecoder.cpp	2005-09-10 00:21:35.000000000 +0200
@@ -260,7 +260,8 @@
             if (mpeg_state >= SLICE_MIN && mpeg_state <= SLICE_MAX)
                 continue;
 
-            if (mpeg_state >= VID_START && mpeg_state <= VID_END)
+            //if (mpeg_state >= VID_START && mpeg_state <= VID_END)
+            if (mpeg_state == 0x000001ba)
             {
                 laststartpos = (bufptr - buf) + startpos - 4;
                 continue;
diff -ru mythtv/libs/libmythtv/mpegrecorder.cpp mythtv-0.18.1/libs/libmythtv/mpegrecorder.cpp
--- mythtv/libs/libmythtv/mpegrecorder.cpp	2005-02-23 06:04:36.000000000 +0100
+++ mythtv-0.18.1/libs/libmythtv/mpegrecorder.cpp	2005-09-09 23:55:25.000000000 +0200
@@ -634,6 +634,7 @@
 
                 long long startpos = ringBuffer->GetFileWritePosition();
                 startpos += pkt.startpos;
+                startpos = startpos & ~3LL;
 
                 long long keyCount = frameNum / keyframedist;
 

Reply via email to