[patch] Two fixes: AudioPlayerWMP9.cs for trailers/streams (1 Viewer)

scoop

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

    The following patch at sourceforge is a fix for the following two bugs:

    • 1 My Trailers plugin won't play another trailer after
      the first trailer has been played. The same
      goes for internet radio/video streams.

      2 My Trailers plugin shows a black screen after a
      trailer is finished playing. Although you hear the
      navigation sounds (and you can see the window title
      changing), the screen stays black.
    Bug 1 discussion:
    The source of the problem lies with the IsRadio property from AudioPlayerWMP9.cs and appears g_Player.cs in public static bool Play(string strFile). The first thing this method does, is check if the player is playing radio. if so, then playback of radio is stopped (by sending GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO). Now look at the code for the IsRadio property in AudioPlayerWMP9.cs. The first time a stream is played, the _currentFile doesn't contain a URL to a stream. Any subsequent calls to IsRadio will result in true being returned, and g_Player.Play(strFile) to send the earlier mentioned message to stop playback. IMO the solution is to remove the IsRadio override altogether, since AudioPlayerWMP9.cs will never be playing radio.

    Bug 2 discussion:
    After playback of a trailer/video stream has ended, void SongEnded(bool bManualStop) is (eventually) called. Here the call to GUIGraphicsContext.IsFullScreenVideo=false; is commented out. This is probably so, that if one's playing music, the fullscreen visualization isn't switched back to windowed mode. The OnVideoWindowChanged() handler in g_Player is only effective when the player is still playing and still has an active video window (HasVideo property). So, the (conditional) switch to windowed video should be made in AudioPlayerWMP9.SongEnded(bool bManualStop) before playback is actually stopped. The solution to the problem is to to add the following code in top of this method:
    Code:
      if (!Utils.IsAudio(_currentFile))
        GUIGraphicsContext.IsFullScreenVideo = false;
    This addition only switches from fullscreen to windowed mode once playback has ended if the AudioPlayerWMP9 is _not_ playing regular audio.


    The above changes are tested for playback of music, internet radio streams, video streams and the my trailers plugin.

    Kind regards,
    Michel
     

    BoelShit

    Portal Pro
    November 6, 2005
    235
    8
    42
    Home Country
    Netherlands Netherlands
    After this patch it seems that the GUI isnt good any more at "Radio"... It shows the filename instead of the name of the radio played and the logo doesnt show anymore (only visualization)...

    But the speed of loading streams and switching between them works superb!
     

    scoop

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

    Honestly I can't think of any reason why this patch would affect the display of the station name or the way logos are displayed. Those are more GUI properties than audio player properties. I could be wrong though.

    If you want to see the differences the patch has introduced, see here.

    Kind regards,
    Michel
     

    BoelShit

    Portal Pro
    November 6, 2005
    235
    8
    42
    Home Country
    Netherlands Netherlands
    looks like the patch doesnt influence it, perhaps another patch/code change has caused this. Don't know what has changed since..
     

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,
    BoelShit said:
    looks like the patch doesnt influence it, perhaps another patch/code change has caused this. Don't know what has changed since..
    Quite some work has been done in the playlist area recently and the Radio GUI as well. Yesterday there have been some fixes regarding both, so maybe it's fixed already. ;-)

    Kind regards,
    Michel
     

    BoelShit

    Portal Pro
    November 6, 2005
    235
    8
    42
    Home Country
    Netherlands Netherlands
    BoelShit said:
    Yeah, I did see it... I'm gonna try it tonight.. Thanks for your help.

    Still same problem exists..... maybe gonna try reinstall + latest CVS, that doesn't work then also a delete on the mediaportal directory and delete all databases etc...
     

    BoelShit

    Portal Pro
    November 6, 2005
    235
    8
    42
    Home Country
    Netherlands Netherlands
    I tried a reinstall... I've found out that MediaPortal gets the status PlayingVideo when Radio is played after this patch got into CVS. This way it doesn't use the musicoverlay anymore. I'm looking into the code now but its hocuspocus for me :lol:

    You also said the audioplayerWMP9.cs will never play radio, but what about those internet streams? How are they played then?

    Hope you can help and clarify some for me.
     

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,
    BoelShit said:
    I tried a reinstall... I've found out that MediaPortal gets the status PlayingVideo when Radio is played after this patch got into CVS. This way it doesn't use the musicoverlay anymore. I'm looking into the code now but its hocuspocus for me :lol:

    You also said the audioplayerWMP9.cs will never play radio, but what about those internet streams? How are they played then?

    Hope you can help and clarify some for me.
    IMHO Internet streams aren't radio. Radio (from a capture card that is) is played by RadioTuner.cs. For me, playing radio (not streamed via internet) never shows any visualization window (AFAIK because RadioTuner.cs doesn't have/need a video window). When I play internet radio streams logos are still displayed (when I configured them in the .ASX file of course)

    I'm really stuck at what exactly your problem is? Maybe I'm missing something obvious here, so could you please describe in steps how to reproduce it? Preferrably a dummies-guide ;)

    I will definitely not exclude the possibility that I screwed up here. 99% of the time when I'm looking @ the code, I'm trying to figure out how stuff works as well. Maybe it's easier to take this into IRC and discuss it there? You can query me (nick micheloe in #mediaportal @ efnet). Please be aware that, while I'm online 24/7 there, I'm not always behind the PC.

    Then we can discuss this in dutch, too. ;)

    Kind regards,
    Michel
     

    scoop

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

    OK a little talk on IRC can sometimes shed more light on a problem than several forum posts can do. :wink: It turns out this patch indeed alters the way radio streams are played when they're configured in the radio database:

    - If a user has put a logo for the radio stream in \thumbs\radio it isn't shown anymore
    - The "filename" is shown instead of the radio station name

    AFAIK the only way to work around this is to make g_Player aware of when it's playing an audiostream or a videostream. Since you can't determine this by file or URL type, the only way to do this is to specify this as soon as a stream is played back; i.e.:

    - when My Trailers starts playing a stream, indicate it's a video stream
    - when My Radio starts playing a stream, indicate it's an audio stream

    Since maybe people (mis|ab)use My Radio to stream video, the second statement is debatable.

    I already am playing with the player code to actually "support" radio/video streams and make it aware of what it is playing, but I really could use some input/guidance here...

    Kind regards,
    Michel
     

    Users who are viewing this thread

    Top Bottom