[UPnP] fix: use Announcement manager to update UPnPRenderer state vars #1578

Merged
merged 1 commit into from Oct 11, 2012

Conversation

Projects
None yet
3 participants
Contributor

alcoheca commented Oct 9, 2012

This fixes sometime incorrect metadata after changing track, and also reduces the number of lookups.

@ghost ghost assigned alcoheca Oct 9, 2012

xbmc/network/upnp/UPnPRenderer.cpp
+ if (flag == Player) {
+ if (NPT_FAILED(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", avt)))
+ return;
+ if (!strcmp(message, "OnPlay")) {
@Montellese

Montellese Oct 9, 2012

Owner

Could we get

if (strcmp(message, "OnPlay") == 0)

here instead. That "!" confused me for a second as it kinda reads like "if not string compare".

EDIT: Same on the ones further down.

xbmc/network/upnp/UPnPRenderer.cpp
+
+ CStdString buffer;
+
+ buffer.Format("%d", data["volume"].asInteger());
@Montellese

Montellese Oct 9, 2012

Owner

You might wanna cast the return value of asInteger() to (int) because it returns int64_t which doesn't match %d (same further down).

Owner

Montellese commented Oct 9, 2012

Apart from the two things I mentioned and @jmarshallnz's comment it looks good.

[UPnP] fix: use Announcement manager to update metadata and volume st…
…atevariables

rather than every second in Application::ProcessSlow. Also handle play/pause
toggling.
Contributor

alcoheca commented Oct 11, 2012

@elupus happy with this going in?

Member

elupus commented Oct 11, 2012

Yes if the other comments have been resolved.

alcoheca added a commit that referenced this pull request Oct 11, 2012

Merge pull request #1578 from alcoheca/renderer-updates
[UPnP] fix: use Announcement manager to update UPnPRenderer state vars

@alcoheca alcoheca merged commit a039355 into xbmc:master Oct 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment