[PATCH] was Re: [mythtv] Wrong time of recordings when using PVR 350

Mauricio Piacentini mauricio at tabuleiro.com
Sun Oct 10 02:48:47 UTC 2004


> So i'm assuming then that myth asks the driver if its
> in PAL or NTSC at playback and that you believe the
> driver is getting this wrong in some mode. If so i'll
> try and take a look at this over the next couple of
> days and get a fix to Chris.
>
> I am assuming this check is made somewhere in
> videoout_ivtv.cpp (sorry i'm at work and don't have
> the source code to hand at the moment).

>Yup, that's right, though it's in ivtvdecoder.cpp, not >videoout_ivtv.cpp.
>
>    v4l2_std_id std = V4L2_STD_NTSC;
>    ntsc = true;
>
>    if (ioctl(testfd, VIDIOC_G_STD, &std) < 0)
>        perror("VIDIOC_G_STD");
>    else
>    {
>        if (std & V4L2_STD_625_50)
>            ntsc = false;
>    }

Hi. Be gentle, I am new to the list :)

I am quoting the above discussion because I was seeing what appears to 
be a similar problem with times of recordings being reported wrong in 
the OSD, using a PVR250. In my case the problem is that each program was 
displayed as having roughly 1/6 of the time MORE than what is really 
recorded, so a 30 min prog shows up as  35 min, for example.

After some research I believe my problem is a different one, though,
as I am running in PAL-M (Brazil.) PAL-M has the PAL resolution but
the frame rate is equal to NTSC, 29.97 fps. The IVTV driver I am using
is still version 1.09, and apparently something fails when the backend
starts, as I see this in the log:

VIDIOC_S_STD: Invalid argument

This is probably coming from channels.c, right? My version of the IVTV
driver does not understand the PAL-M setting.

In any event, colors are correct and my recordings are looking great, 
the only drawback is that on playback the duration is apparently being 
calculated taking 25fps as the time base (instead of 30fps.)

I examined the code base and apparently my problem is that the recorder 
object is setting the video_time_base to 25fps incorrectly for PAL-M. 
This is not related to the IVTV driver in my particular case, 
apparently. The following patch to recorderbase.cpp against the file 
shipped in version 0.16  solves the problem for me:

--- recorderbase.0.16.cpp	2004-10-09 23:39:39.000000000 -0300
+++ recorderbase.cpp	2004-10-09 23:22:06.000000000 -0300
@@ -79,6 +79,10 @@
              ntsc = 1;
              video_frame_rate = 29.97;
          }
+	else if (value.lower() == "pal-m")
+	{
+	    video_frame_rate = 29.97;
+	}
          else
          {
              ntsc = 0;

Let me know if there is another place to send this if it is not ok to 
post patches here.

Regards,
Mauricio








More information about the mythtv-dev mailing list