-
Notifications
You must be signed in to change notification settings - Fork 115
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
misbehavior of function VFSFile::fread(...) #646
Comments
Original Redmine Comment I don't understand this bug report at all. There is no file named newplugin.cc in Audacious or Audacious Plugins; what code are you changing? And how does adding retry logic have anything to do with a "No such file or directory" error? |
Original Redmine Comment Hi John, Yesterday I have ported the old code to new version of Audacious. And a strange behavior of the Monkey's Audio plugin was found. Please, take a look at the code on https://github.com/wknightbor/Additional-plugins-for-Audacious-3.6 mac.cc line 147 (retry logic) Please, find attached log. If you suppose it isn't a fread function problem, Please, help me to fix it. Thanks in advance |
Original Redmine Comment Okay, the part about the retry logic makes sense now. I expect we need to implement a loop around g_input_stream_read() in the GIO plugin. I assumed that g_input_stream_read() would behave like POSIX fread() and read as many bytes as requested, but it appears that this is not the case. I still don't understand the part about the "No such file or directory" error. Are you thinking this error is due to a problem in Audacious, or was it just mentioned because it happened to be in the log? |
Original Redmine Comment Hi John
Now I know there was two issues. The second was not because of player. |
Original Redmine Comment Fixed in Git. |
Author Name: Andrey Karpenko
Original Redmine Issue: https://redmine.audacious-media-player.org/issues/511
Original Date: 2015-02-27
System: 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
and 3.13.0-46-generic #75-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Description: misbehavior of function VFSFile::fread(...) in case of read from smb:// file server
Log message:
ERROR vfs_local.cc:116 [vfs_local_fopen]: smb://192.168.2.148/share/Music/Sandra.The.Platinum.Collection.(3CD).2009.Ape.Cue.Lossless/CD2/Sandra - Platinum Collection.ape: No such file or directory
Workaround: Use symlink to gvfs folder to access network files or use retry logic in the code
int XXX::Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead)
{
if(vfs!=0)
{
int64_t cur = vfs-> ftell();
*pBytesRead = (unsigned int)vfs->fread(pBuffer, 1, nBytesToRead);
if(nBytesToRead > *pBytesRead)
{
if(!vfs ->feof())
{
AUDERR("Requested %d bytes, actually read %d bytes\n", nBytesToRead, *pBytesRead);
AUDERR("Trying to retry from the same place\n");
if(!vfs -> fseek(cur, VFSSeekType::VFS_SEEK_SET))
{
*pBytesRead = (unsigned int)vfs->fread(pBuffer, 1, nBytesToRead);
AUDERR("After second attempt read %d bytes\n", *pBytesRead);
}
}
}
return 0;
}
return 1;
}
In case of workaround use the log looks like:
ERROR newplugin.cc:156 [Read]: Requested 16320 bytes, actually read 64 bytes
ERROR newplugin.cc:158 [Read]: Trying to retry from the last place
ERROR newplugin.cc:162 [Read]: After second attempt read 16256 bytes
Note: It is possible to play files from the same server without any issues with different names
Thanks in advance
The text was updated successfully, but these errors were encountered: