[patch] bugfix: subtitles configuration is not used (2 Viewers)

cpp2005

Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    This patch will fix the following problems:
    - subtitles configuration (size, font, etc) is not used by mediaportal, along with "use subtitles" checkbox.
    - subtitles cannot be turned off for avi files as I reported here

    The problem is the following:
    VideoPlayerVMR9.cs (and VideoPlayerVMR7.cs) has the following in method GetInterfaces:

    Code:
            if (vob != null)
            {
              Marshal.ReleaseComObject(vob);
              vob = null;
              DirectShowUtil.FindFilterByClassID(graphBuilder, classID, out vob);
            }

    as vob is initially null it never get assigned. Last command need to be out of 'if':
    Code:
            if (vob != null)
            {
              Marshal.ReleaseComObject(vob);
              vob = null;
            }
            DirectShowUtil.FindFilterByClassID(graphBuilder, classID, out vob);

    Thanks.
     

    cpp2005

    Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    My sources updated with other patches that are not in svn, that's why I posted it here, sorry.
     

    cpp2005

    Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    I submitted a new patch on SourceForge that fixes subtitles handling for avi files with external subtitles and mkv files with built-in subtitles, so that the following features will work for both media types:
    1) ACTION_NEXT_SUBTITLE goes correctly over all subtitles, including
    "Subtitles off" option.
    2) ACTION_SHOW_SUBTITLE turns subtitles on/off
    3) use subtitles settings as specified in configuration->movies->subtitles
    dialog
    4) fixed auto selecting default language subtitle.

    Patch explanation for 1 & 2:
    many subtitles oriented methods in mp look like that:
    Code:
           if (this.vobSub != null)
            {
               //do subtitles work with vobsub
            }
            else {
               //do subtitles work with streams as reported by haali media splitter
            }

    This is not good because for mkv files, vobsub does not know about built-in subtitles, it only "sees" current subtitle (vobSub.get_LanguageCount is wrong, leading to incorrect behaivior). So I changed subtitle related functions to give priority to streams, and only if there are no subtitle streams, check for vobsub. Thus both avi and mkv files will work correctly.

    Patch explanation for 3: first message in this thread.

    Patch explanation for 4:
    currently default language is set in GetInterfaces() method, while subtitles streams are retrieved in AnalyseStreams() that is called after that. So I moved it to Play method of VideoPlayerVMR7, after AnalyseStreams call.

    I only tested this patch with avi and mkv files, so if someone is using subtitles with other formats please post your results as well. I assume the following is installed:
    - direct vob sub
    - haali media splitter. You may need to set "Autoload vsfilter" in haali options.
     

    cpp2005

    Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    Hi maysider,
    if you don't know how to compile mediaportal, look at this thread. I posted a binary patch there that should work with 0.2.3.0 RC1.
     

    babylonx

    New Member
    June 30, 2007
    3
    0
    38
    Home Country
    Greece Greece
    Will this patch work with 0.2.2 version?

    Thank you!

    EDIT: I have tried it with 0.2.3 and it didn't work! Vodsub and ffdshow will not use their configuration again... :(
     

    cpp2005

    Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    babylonx, what do you mean by
    Vodsub and ffdshow will not use their configuration again
     

    babylonx

    New Member
    June 30, 2007
    3
    0
    38
    Home Country
    Greece Greece
    I mean that I close MP, I run "DirectVobSub Configure", I change the font size, I run MP and the font size is again the old one. The general configuration is not used. And all this after I have replaced the core.dll with the fixed one you posted above.
     

    Users who are viewing this thread

    Top Bottom