Bug with SubscribeToDataStreams

Jan 23, 2012 at 12:20 PM
Edited Jan 23, 2012 at 12:41 PM

There seems to be a bug in the SMFPlayer.SubscribeToDataStreams(params string[] streamNames) method that causes it to always throw an exception for the following reasons:

This method calls

ActiveAdaptiveMediaPlugin.ModifySegmentSelectedStreams(ActiveAdaptiveMediaPlugin.CurrentSegment, streamsToSelect, null)

But that method calls

streamsToRemove.Cast<MediaStream>().ToList()

where the streamsToRemove is the last parameter in this function. Because this function was called with that parameter as null, it causes an exception (you cannot call Cast<T> on a null reference) and the method aborts.

To fix this, one could ensure that SMFPlayer.SubscribeToDataStreams(params string[] streamNames) actually sends in an empty List<IMediaStream> as the last parameter of ActiveAdaptiveMediaPlugin.ModifySegmentSelectedStreams. And it will also be necessary to the same in SMFPlayer.UnsubscribeToDataStreams(params string[] streamNames), just with with the second parameter in this case.

Mar 30, 2012 at 1:04 PM

Hi,

   Any suggestion to let this method works ? or any alternative approach ?

 

Apr 29, 2012 at 1:00 PM

I was experiencing the same problem. Had to add a null check for streamsToAdd and streamsToRemove on method ModifySegmentSelectedStreams in SmoothStreamingMediaPlugin.cs as either one is null for SubscribeToDataStreams or UnsubscribeToDataStreams.

Coordinator
Jun 2, 2012 at 1:58 AM

Thanks all for reporting this. We're working on a new update and will make sure this is fixed in the new version.

Sorry for the inconvenience,

Tim