[pvrusb2] MPEG PTSs drifting away

Hans Verkuil hverkuil at xs4all.nl
Sat Jul 26 14:23:39 CDT 2008


On Saturday 26 July 2008 21:14:13 Boris Dores wrote:
> 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 :) ).

Hmm, it's about time I update that comment. In the file 
Documentation/video4linux/cx2341x/fw-encoder-api.txt (part of the 
kernel and the v4l-dvb repository) there is some documentation on these 
settings. This one says:

4=generate DVD compatible PTS timestamps

Makes sense :-)

Regards,

	Hans

>   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 !




More information about the pvrusb2 mailing list