Skip to content
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

Merged
merged 3 commits into from Aug 14, 2017
Merged

Update to PVR API 5.6.0 #56

merged 3 commits into from Aug 14, 2017

Conversation

fuzzard
Copy link
Contributor

@fuzzard fuzzard commented Aug 12, 2017

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

@ksooo
Copy link
Member

ksooo commented Aug 12, 2017

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.

@fuzzard
Copy link
Contributor Author

fuzzard commented Aug 12, 2017

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.

@ksooo
Copy link
Member

ksooo commented Aug 12, 2017

👍

src/client.cpp Outdated
if (strUrl.size() < (*urlLen)) {
*urlLen = strUrl.size();
}
memcpy(url, strUrl.c_str(), *urlLen);
Copy link
Contributor

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 :)

@fuzzard
Copy link
Contributor Author

fuzzard commented Aug 12, 2017

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));
Copy link
Member

@ksooo ksooo Aug 13, 2017

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, cheers.

fuzzard and others added 3 commits August 14, 2017 11:19
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
@fuzzard
Copy link
Contributor Author

fuzzard commented Aug 14, 2017

Rebased to clean up the WIP commits. Hope thats ok.

@zcsizmadia zcsizmadia merged commit b89c2be into kodi-pvr:master Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants