adamsutton/xbmc-pvr-addons — pull request #31 by Jalle19 (2014-04-20 09:08:18+00:00)
Title: Refactored subscription handling (fixes two bugs)

This is what I talked about on IRC. I decided it would be better to wrap a subscription as a class (could be a struct too but I thought I'd change it to a class since it has a constructor) so we could get rid of the various member variables that were only used once or twice.

Two bugs are fixed
* the "demux subscribe to" and "demux unsubscribe to" used different values (subscription ID and channel ID)
* a subscription is now marked as inactive immediately in SendSubscribe, this way the client won't restart it it gets disconnected while sending the unsubscribe message (which would lead to two subscriptions being sent to the client, one of which's packets would be dropped all the time).

I haven't tested this yet, just checked that it builds.