Em Qui 04 Out 2007, Tom Patzig escreveu:
> Matt Rogers schrieb:
> > On Monday 01 October 2007 09:55:33 am Tom Patzig wrote:
> >> Hi all,
> >>
> >> JFYI, i commented out some redundant code in videodevicepool.cpp (3.5
> >> branch).
> >> The needless block cause crashes, when searching for video devices,
> >> because m_current_device is left uninitialized.
> >>
> >> Tom
> >
> > This commit caused crashes for other people though. Why can't you just
> > initialize m_current_device?
> > --
> > Matt
>
> The code block isn't not only redundant, it is also wrong. Because it
> ever returns EXIT_FAILURE, although the device may be succesfully
> opened. The case, that there is no valid device found is handled above
> and returns EXIT_FAILURE.
> We have had a bug report on this issue and the the reporter mentioned
> that it workes now (without that code block).
> Cláudio, any comments?
>
> Regards,
> Tom

Some clarification about the VideoDevicePool::scanDevices(), based on revision 
716800:

This method is tricky to understand.
Some distros have video character devices in /dev/v4l, some other in /dev 
directly, some have symbolic links in /dev pointing to /dev/v4l/. 
VideoDevicePool::scanDevices tries to sort it out ignoring symbolic links 
(QDir::NoSymLinks) and doing two scans: the 1st in /dev/v4l (devined in line 
655) and the second in /dev (defined in line 674)

Each scan has two steps:
1. Finding character devices
2. Trying to open them as video devices.

The 1st scan:
1st step: Lines 654 - 669
2nd step: Lines 717 - 736

If it finds devies in /dev/v4l, it avoids doing the 2nd scan cause it's 
assumed that if there are any /dev/video* files they are symbolic links 
to /dev/v4l/video* or the duplicate character files pointing to the same 
physical device.
If no suitable devices are found in /dev/v4l (line 670), then perform the 2nd 
scan.

The 2nd scan:
1st step: Lines 673 - 685
2nd step: Lines 692 - 711

If no suitable devices are found in /dev (line 686) then bail out.

Commenting the aforementioned block, as proposed in revision 704366, would 
make people who have video character devices in /dev be unable to use their 
devices (Kubuntu users are examples).

But a proper fix to a valid issue was made with commit 721162, that fixes the 
return code when the 2nd pass is successful.

Please test it and report back any problems.


Best regards,


Cláudio
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to