[mythtv] Bug in Channel::SetFormat?

Andy McMullan andy at andymcm.com
Wed Aug 18 16:07:01 EDT 2004


Hi

I have a problem with the latest CVS where mythbackend fails to switch 
to the composite input on my bt8x8 card at startup. Switching manually 
by pressing 'C' works. Chris Petersen posted a similar problem a couple 
of weeks ago (which Isaac couldn't repro).

I think the problem is in this code at the end of Channel::SetFormat:

struct video_channel vc;
memset(&vc, 0, sizeof(vc));
ioctl(videofd, VIDIOCGCHAN, &vc);
vc.norm = mode;
ioctl(videofd, VIDIOCSCHAN, &vc);

This code seems to assume that channel is an output from VIDIOCGCHAN, 
but it's not, it's an input. So this code always asks for channel info 
for channel 0, and then sets the channel to 0 (after changing the norm 
field).

I think the code should be changed to something like this:

struct video_channel vc;
memset(&vc, 0, sizeof(vc));
==> vc.channel = currentcapchannel;
ioctl(videofd, VIDIOCGCHAN, &vc);
vc.norm = mode;
ioctl(videofd, VIDIOCSCHAN, &vc);

I've tried this fix on my system, and it solves the problem.

Regards

Andy Mc



More information about the mythtv-dev mailing list