[pvrusb2] MPEG PTSs drifting away

Boris Dores babal at via.ecp.fr
Sat Jul 26 14:14:13 CDT 2008


On Fri, Jul 25, 2008 at 07:28:39PM (GMT-0500), Mike Isely wrote:
> The code in question will be found in pvrusb2-encoder.c.  Look at 
> pvr2_encoder_configure().

  I found the solution ! Thank you so much for pointing me in the right
direction !

  I imported all the raw commands from the corresponding ivtv function
(ivtv_start_v4l2_encode_stream in ivtv-streams.c) and proceeded by
dichotomy. In the end, adding only one command is needed to correct the
PTSs: it's one of the lines under the comment "Stuff from Windows, we
don't know what it is" (if Hans is reading this, I guess we can say we
just got some clues :) ).

  The corresponding patch follows (didn't bother to attach it instead of
pasting it inline, as it is clearly trivial):

--- pvrusb2-encoder.c.orig      2008-07-26 20:30:17.000000000 +0200
+++ pvrusb2-encoder.c   2008-07-26 20:35:36.000000000 +0200
@@ -545,6 +545,10 @@

        ret |= pvr2_encoder_prep_config(hdw);

+       /* prevent the PTSs from slowly drifting away in the generated MPEG
+          stream */
+       ret |= pvr2_encoder_vcmd( hdw, CX2341X_ENC_MISC, 2, 4, 1 );
+
        /* saa7115: 0xf0 */
        val = 0xf0;
        if (hdw->hdw_desc->flag_has_cx25840) {


  Thanks !

-- 
Boris Dorès


More information about the pvrusb2 mailing list