2008-04-08, 06:07
Currently the dvd detection code treats a media center where there is no DVD Drive as one that has one and is just currently unvaliable.
Once the DRIVE_NOT_READY is returned to CDetectDVDMedia::UpdateDvdrom() it then sends a message:
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
which causes it to update all the sources.
This was causing a video slow down but a bit of code was added to ensure that source updates only happened while the library was active was added. This fixed the video slow down.
There are 3 remaining issues with this that I'm aware of. The DVD Polling stuff happens about 2-3 times a second causing sources to update 2-3 times a second.
1. If you have debug logging on your log is constantly spammed with the Update Sources code while the library is active.
2. Some skins have what seems to be certain animation elements which are replayed every time the view is updated do to UPDATE_SOURCES. This is highly annoying.. it looks like a bit of flashing of certain elements is the best way i can describe it.
3. You can not select the Parent Directory "..' element in any view as sources upate causing the view to redraw and putting you on the first element in a directory if you have .. selected.
I am sure those 3 issues are cause by this behavior as if you comment out the lines which send the GUI_MSG_UPDATE_SOURCES (lines 138 and 139 in DetectDVDType.cpp) Then all those problems go away. These lines:
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
m_gWindowManager.SendThreadMessage( msg );
I'm not sure exactly why you would want to update sources if the drive is not ready. I can't see any real value in Updating Sources 3 times a second even if there is a drive in the machine that is busy. I don't know if there would be any more implications to not updating while a drive is busy though.
Thoughts?
Also as a side note - the fix I applied above has significantly improved responsiveness of the library mode. I guess since it's not hitting the DB 2-3 times a second.
Once the DRIVE_NOT_READY is returned to CDetectDVDMedia::UpdateDvdrom() it then sends a message:
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
which causes it to update all the sources.
This was causing a video slow down but a bit of code was added to ensure that source updates only happened while the library was active was added. This fixed the video slow down.
There are 3 remaining issues with this that I'm aware of. The DVD Polling stuff happens about 2-3 times a second causing sources to update 2-3 times a second.
1. If you have debug logging on your log is constantly spammed with the Update Sources code while the library is active.
2. Some skins have what seems to be certain animation elements which are replayed every time the view is updated do to UPDATE_SOURCES. This is highly annoying.. it looks like a bit of flashing of certain elements is the best way i can describe it.
3. You can not select the Parent Directory "..' element in any view as sources upate causing the view to redraw and putting you on the first element in a directory if you have .. selected.
I am sure those 3 issues are cause by this behavior as if you comment out the lines which send the GUI_MSG_UPDATE_SOURCES (lines 138 and 139 in DetectDVDType.cpp) Then all those problems go away. These lines:
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
m_gWindowManager.SendThreadMessage( msg );
I'm not sure exactly why you would want to update sources if the drive is not ready. I can't see any real value in Updating Sources 3 times a second even if there is a drive in the machine that is busy. I don't know if there would be any more implications to not updating while a drive is busy though.
Thoughts?
Also as a side note - the fix I applied above has significantly improved responsiveness of the library mode. I guess since it's not hitting the DB 2-3 times a second.