g_Player.IsRadio returns false when playing internet radio (2 Viewers)

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
I'm using MP 0.2 SVN 14/4/2006 and I've realised that when I'm playing internet radio streams, g_Player.IsRadio is not returning true. It is returning false.

As a result, PowerScheduler still shuts the computer down when internet radio is playing on the home screen even though it checks for it in its code.

I've had a look at the code, but I'm not too sure as to how it works, so I can't post a patch.

Can one of the devs take a look at it, or can someone confirm that if they're playing internet radio whilst on the home screen, after the shutdown delay, PowerScheduler will still shut the computer down?

Sam
 

scoop

Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    Since I'm responsible for changing this, I better reply... ;-)
    The AudioPlayerWMP9 (which plays back internet streams) had the IsRadio property returning true for every "file" which started with "http://" or "rtsp://" etc. This caused a problem for some people with the my trailers plugin. i.e. after the first trailer was played back, the AudioPlayerWMP9 started to return true for the IsRadio property. This eventually lead to a GUI_MSG_STOP_RADIO being sent - I know it sounds silly but it did - which in return caused the playback of subsequent trailers to stop immediately.

    I think the suggestion of samuel337 in https://forum.team-mediaportal.com/viewtopic.php?t=14698 is a good thing to do and would fix this side-effect as well.

    Kind regards,
    Michel
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    scoop said:
    Hi,

    Since I'm responsible for changing this, I better reply... ;-)
    The AudioPlayerWMP9 (which plays back internet streams) had the IsRadio property returning true for every "file" which started with "http://" or "rtsp://" etc. This caused a problem for some people with the my trailers plugin. i.e. after the first trailer was played back, the AudioPlayerWMP9 started to return true for the IsRadio property. This eventually lead to a GUI_MSG_STOP_RADIO being sent - I know it sounds silly but it did - which in return caused the playback of subsequent trailers to stop immediately.

    I think the suggestion of samuel337 in https://forum.team-mediaportal.com/viewtopic.php?t=14698 is a good thing to do and would fix this side-effect as well.

    Kind regards,
    Michel

    Yes the suggestion I suggested in the above thread would fix this problem, but for consistency's sake, IsRadio should always return true if it is a radio stream. After all, if it doesn't, then what's the point of the property in the first place?

    The underlying bug is the problem and it should be fixed instead of patching it up and hiding it.

    BTW, audio streams can also start if the URL starts with mms:// and file:// (I store a central collection of asx files for my local radio stations so I can used them from every computer). I think there is something in the WMP API that allows you to determine whether something is an audiostream or not.

    If I get some time this weekend, I'll see if I can figure it out.

    Sam
     

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    This depends on how you look at it, I guess. I personally think it makes more sense to make the g_Player aware of audio/video streams (and add properties for that) instead of patching up one of the players to return true for the IsRadio property while no tvcard is being used to playback radio. But that's just IMHO.

    Kind regards,
    Michel
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    scoop said:
    Hi,

    This depends on how you look at it, I guess. I personally think it makes more sense to make the g_Player aware of audio/video streams (and add properties for that) instead of patching up one of the players to return true for the IsRadio property while no tvcard is being used to playback radio. But that's just IMHO.

    Kind regards,
    Michel

    Ok, I see what you mean now. So the IsRadio property is supposed to refer to analog/digital radio? If that's so, then I agree with you, there should be a new property introduced called IsInternetAudioStream, and IsInternetVideoStream, or something like that.

    Sam
     

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    At least that's what I made up of it by looking at the code, yes. Specifically when looking at TVCapture\CommandProcessor\Commands\StopRadioCommand.cs.
    BTW, I've glanced at the WMP API, but I was unable to find a property somewhere indicating whether we're playing an audio or video stream.

    Kind regards,
    Michel
     

    Users who are viewing this thread

    Top Bottom