On Saturday 08 October 2005 22:24, Tyler Trafford wrote:
> Hans Verkuil wrote:
> > On Saturday 08 October 2005 21:21, Tyler Trafford wrote:
> >> Can anyone see what's the point of this cx25840 ioctl? Especially it's
> >> usage in ivtv-fileops...
> >
> > Well, it's used by the VIDIOC_G_TUNER ioctl. It is actually never called
> > in ivtv-fileops, that code is only used by the saa7115 boards.
>
> Are you sure you're not thinking of DECODER_GET_STATUS instead of
> DECODER_GET_VIDEO_STATUS?
Darn, you're right. Let's see if I can understand the code:
If ivtv_read cannot read any data for over 6 seconds, then it tries to reset
the digitizer in case there is a sync issue (can this ever happen?).
It first looks if it has to reset the digitizer, which is done by a
DECODER_GET_STATUS call, except for the cx25840-based cards where it assumes
that it always has to reset. This could be a leftover from a time when
DECODER_GET_STATUS wasn't yet implemented in the cx25840 driver.
If it has to reset it calls DECODER_GET_VIDEO_STATUS for the cx25840 which
basically does the same as DECODER_GET_STATUS. The result is checked against
zero (which cannot happen as DECODER_GET_VIDEO_STATUS only returns 1 or 2!).
ivtv_reset_digitizer() assumes 0 means no digitizer sync. Mysteriously it
then only resets if there is a digitizer sync (except for the saa7115 where
it always resets).
Conclusion: drop DECODER_GET_VIDEO_STATUS and use the same code path for both
saa7115 and cx25840. Personally I think the whole code can probably be
removed. If you haven't had data for 6 seconds then I think it's safe to
assume that resetting a digitizer isn't going to make much difference. To me
it looks like a hack from the olden days when men where men and the ivtv
driver didn't work :-)
Perhaps Chris can shed some light on the evolution of this piece of code?
Hans
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel