-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow player to retry read in case of read errors #5537
Conversation
…o give player a chance to retry read.
…d()" return values; some fixes for new types in "Read()"; update types in code to match 'ssize_t' returned by 'Read()'; some usage of negative return values for Read()
This looks good to me, should make InputStreamFile work with the IFile changes. |
if (!g_PVRManager.IsStarted()) | ||
return -1; | ||
|
||
// TODO: Fix overflow in case of sizeof(int) != sizeof(size_t) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@FernetMenta Will this PR fix a problem with PVR and player? |
After some discussion on IRC, nope We need to do if (ret == 0) m_eof = false; That should work if all VFS have used the same trick for negative numbers. |
@topfs2 That's what this PR do. With additionally explicitly maps all negative values to "-1". |
m_eof = true I mean |
Yeah, just a bit unsure if we should map all negative to -1 |
i think so though have not tried. i would expand this to the other file implementations as well. |
@FernetMenta I wouldn't do that because '-1' can be returned in case that file was closed or was not opened. Or in other cases when we should not attempt to retry. We need more precise mechanism. |
how about file->GetErrorNumber() or something like this? this would be a reuse of something we have here: https://github.com/opdenkamp/xbmc-pvr-addons/blob/master/lib/platform/sockets/socket.h#L61 |
@FernetMenta It's good idea, but, as discussed on IRC, we decided to postpone function |
@FernetMenta Your "OK" is required before @topfs2 will approve this. jenkins build this please |
I don't agree here because I invested hours of work when I was doing AE and paplayer to get things working. pulling the network cable must not result in termination of playback. I was actually on my way to test this but then I hit this "exception". this is btw how most applications and browsers do behave as well. |
This fix will return old behavior with indefinitely waiting player for new data. Just a hint: when implementing something not very obvious, describe it in doxy, or at least in comments. Better use both. This will help reviewer to suggest correction if needed and will help other to use and update your code. |
I would like to test this but master is broken for me testing on Windows. I can't start kodi. does it work for you? |
Did you re-run DownloadBuildDeps.bat, DownloadMingwBuildEnv.bat and make-mingwlibs.bat ? |
yes I did. have you tried current master? |
Rebuilding mingw libs currently. |
Looks like master is currently broken for win32. |
rebrand fallout? |
@Memphiz Seems to be so. |
@Karlson2k bool CApplication::InitDirectoriesWin32() in Application.cpp has XBMC_HOME set instead of APP_HOME |
but that matches the VS2010Express/XBMC.defaults.props |
Setting APP_HOME instead of XBMC_HOME in my VS debugging configuration allows me to start XBMC again. |
See #5542 for a possible fix. |
I think this pr is fine though there are still some issues left. I did the test I described above: play some music from a smb share, pulling the network cable, and plugging it in again. This worked for approximately 50% of my attempts, means it continued playback from the last position. The other 50% I got eof and player moved to the next item. I don't know if this has ever worked reliable but some day it should. |
@FernetMenta I suspect same was before all VFS changes. :) |
@FernetMenta you are onto something here. I remember alot of debug logs where playback of dvdplayer was stopped because of premature eof. I think this behavior was there before for some VFS implementations and the fact that you are seeing this now too doesn't mean that it is related to the VFS changes. It looks more like this was never working in 100% of the use cases. |
Looking at the smb code there is a retry logic and if it fails it return 0.
|
talk is about the read function. I don't see a read function in Win32SMBFile.cpp |
I was thinking about the one used on the other platforms https://github.com/xbmc/xbmc/blob/master/xbmc/filesystem/SMBFile.cpp#L533 (man I really dislike that windows has its own implementation :P) |
Hmm, Which before returned 0 on the final If but I think thats changed too with the PR |
ah, that explains it. I configured a smb share on Windows and the method called was CWin32File::Read |
Allow player to retry read in case of read errors
As discussed here: 5c7a19a#commitcomment-8220173
@topfs2 @FernetMenta for review