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
Update to PVR API 5.6.0 #56
Conversation
Please be aware that 5.6.0 API is still work in progress. It might be the case that you need to adapt your PR to the final 5.6.0 API. |
Well aware. Happy to leave this open whilst you guys finalise it all. Figured id try and stay on top of the changes whilst i have time available. |
👍 |
src/client.cpp
Outdated
if (strUrl.size() < (*urlLen)) { | ||
*urlLen = strUrl.size(); | ||
} | ||
memcpy(url, strUrl.c_str(), *urlLen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to include the 0 string termination? This code does not copy the trailing zero into url. I will double check the xbmc pvr later today.
My preference would be to include the zero termination just to be safe :)
Updated to latest WIP API update. the memcpy is no longer needed with the new API. |
src/client.cpp
Outdated
return PVR_ERROR_FAILED; | ||
} | ||
strncpy(properties[0].strName, PVR_STREAM_PROPERTY_STREAMURL, sizeof(properties[0].strName)); | ||
strncpy(properties[0].strValue, strUrl.c_str(), sizeof(properties[0].strValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid memory corruption, third param needs to read sizeof(properties[0].strValue) - 1
. Same for one line above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, cheers.
Replaced GetLiveStreamURL with new API GetChannelStreamProperties Stubbed out GetRecordingStreamProperties() as not implemented Updated Version and PVR Dependency to 5.6.0 Update _GetCHannelStreamURL Fix Channel Change issue caused by static assignment
Fix strncopy length argument to prevent potential memory corruption as pointed out by @ksoo
Rebased to clean up the WIP commits. Hope thats ok. |
Update to PVR API 5.6.0 as per the following commit
xbmc/xbmc#12660
May want to hold off on merge until the above commit is finalised. Have run time tested on MacOS