OV 1.3 crashes MP on playback stop for some videos (1 Viewer)

vpupkin

Portal Pro
March 26, 2011
84
8
Hi, after upgrading to OV1.3 I noticed that some of the videos crash the whole MediaPortal when playback ends naturally. I.e. when I go to Comedy Cental / Daily Show with John Stewart / any video, and let it run (or rewind it to the end), then MediaPortal crashes (see logs attached). The same happens on some other channels (I suppose it has more to do with format than the channel), but not for others - for instance, StarCraft 2 / Day9 channel / any video in MP4 works fine. Even John Stewart doesn't crash if I force-stop (i.e. press stop button), only when stream finishes naturally.

The same channels worked fine in OV1.2.

Here is the message in errorlog:

Code:
2012-08-11 11:03:03.025080 [ERROR][MPMain(1)]: MediaPortal stopped due to an exception Object reference not set to an instance of an object. OnlineVideos.MediaPortal1    at OnlineVideos.MediaPortal1.GUIOnlineVideos.g_Player_PlayBackEnded(MediaType type, String filename)
   at MediaPortal.Player.g_Player.EndedHandler.Invoke(MediaType type, String filename)
   at MediaPortal.Player.g_Player.OnEnded()
   at MediaPortal.Player.g_Player.Process()
   at MediaPortalApp.OnProcess()
   at MediaPortal.D3DApp.Application_Idle(Object sender, EventArgs e)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at MediaPortalApp.Main(String[] args)
 

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    I cannot reproduce this :( The logs tell me what method (g_Player_PlayBackEnded) throws the exception, but I have no clue where the NullReferenceException would occur.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    i cannot too :(
    Maybe you can try to update to 1.2.3 / 1.3.0Alpha to see if you reproduce it again.
     

    vpupkin

    Portal Pro
    March 26, 2011
    84
    8
    Hmm, will try to downgrade / upgrade back OV - don't really want to go to Alpha ;) Or perhaps this is an opportunity to finally compile debug version of MP and then it should be easy to trace.
     

    vpupkin

    Portal Pro
    March 26, 2011
    84
    8
    Yep, it's something in OV1.3 (and/or associated LAVfilters) that broke it for me. I can downgrade to OV1.2, and everything works just fine; upgrade to OV1.3 again, and MP crashes as soon as (some of) the videos finish playing. Don't really have time for in-depth investigation, just rolled back to 1.2 as it works just fine for me.

    By the way, I am using StreamedMP (latest for MP1.2) if that matters.
     

    vpupkin

    Portal Pro
    March 26, 2011
    84
    8
    I cannot reproduce this :( The logs tell me what method (g_Player_PlayBackEnded) throws the exception, but I have no clue where the NullReferenceException would occur.


    Well, as in OV 1.2 YouTube-based sites stopped working, I had to re-visit this issue, and yep, it's still there for me - I can reproduce it on another machine. After re-compiling MP and OV, I traced null reference:

    Code:
            void g_Player_PlayBackEnded(g_Player.MediaType type, string filename)
            {
                try
                {
                    if (currentPlayingItem != null && currentPlayingItem.Util != null)
                    {
                        double percent = g_Player.Duration > 0 ? g_Player.CurrentPosition / g_Player.Duration : 0;
                        currentPlayingItem.Util.OnPlaybackEnded(currentPlayingItem.Video, currentPlayingItem.FileName, percent, false);
                    }
                }
                catch (Exception ex)
                {
                    Log.Instance.Warn("Error on Util.OnPlaybackEnded: {0}", ex);
                }
     
                if (currentPlaylist != null)
                {
                    if (g_Player.Player.GetType().Assembly == typeof(GUIOnlineVideos).Assembly)
                    {
                        ...

    The last if has a problem for me, as at that point in time g_Player.Player is null (deleted too early?). Interestingly, if I remove the check, then playback of the next item in the list works just fine. Again, I am testing it on Comedy Central -> Jon Stewart full episodes that happen to have several segments. After 1st segment is finished, this callback is invoked, and it crashes the whole MP for me.

    Any ideas how this case can be fixed? Thanks.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Hm, Problem is g_Player_PlayBackEnded is an event handler that can also be called when playback ends anywhere in MP (myVideos, ..). So I really have to find out if it is an OnlineVideo that stopped. When I debug here (MP1.3 alpha) Player is still set and not null :( I can add a check for null, but that won'T help you as I do not know if OV video ended or anything other. That's one flaw inside MP's core playback handling.
    I will add another fallback to check the filename when Player is null.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    I just committed a fix for this problem to Onlinevideos svn. Are you able to compile and test that?
     

    vpupkin

    Portal Pro
    March 26, 2011
    84
    8
    I did, and it seems to work - for a couple of clips that I tried it didn't crash (previously, it consistently crashed every single time). Mind you, this is not a clean test as I have started to suspect that one of the culprits in this behavior (strange playback finish) was MyAnime2 (based on a few debug traces that I did). Considering that it is not supported anymore, I updated to MyAnime3, so maybe this helped. In any case, I don't see the crashes anymore - will let you know if the problem resurfaces.

    Now, if only seeking would work better - it is quite inconsistent for me (freezing, audio desync etc). Not a big problem yet (don't do much seeking), but annoying nevertheless...

    Thanks!
     

    Users who are viewing this thread

    Top Bottom