[Rejected] Integration with FFDShow (1 Viewer)

chemelli

Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    I think there still is a small glitch: when you enable and disable some ffdshow components while MP is active, but as this is not a normal user case I don't think we should worry about it too much...

    With the help of Sebastii (yes again him :p ) we identified the guilty code and I fixed it.

    Code:
        public static ISubEngine GetInstance([B][COLOR="red"]bool forceinitialize[/COLOR][/B])
        {
          if (engine == null [COLOR="Red"][B]|| forceinitialize[/B][/COLOR])
          {

    Then to make all old calls compatible I added a overlay:

    Code:
        public static ISubEngine GetInstance()
        {
          return GetInstance(false);
        }

    so in the Play() function of VideoPlayerVMR7.cs we just need to change the init of the engine:

    Code:
            string tmpstr;
            ISubEngine engine = SubEngine.GetInstance([COLOR="red"][B]true[/B][/COLOR]);

    :D again Sebastii for your help.

    Simone
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Hi,

    You're welcome even if you made all job :)
    I have added this to the part of PostProcessing too.
    All seems working good :)

    Code:
    public static IPostProcessingEngine GetInstance([COLOR="Red"]bool forceinitialize[/COLOR])
          {
              if (engine == null [COLOR="Red"]|| forceinitialize[/COLOR])

    And the Overlay too :

    Code:
    public static IPostProcessingEngine GetInstance()
            {
            return GetInstance(false);
            }

    And in VideoPlayerVMR7.cs :

    Code:
    IPostProcessingEngine postengine = PostProcessingEngine.GetInstance([COLOR="Red"]true[/COLOR]);

    :D to you too :)
    Seb.
     

    albain

    Portal Member
    December 19, 2006
    12
    44
    45
    Paris
    Home Country
    France France
    Hi Chemelli & Seb,

    sorry for the delay I was quite busy lately

    Thanks for fixing and improving this stuff.

    I will aggregate all this tomorrow and work on the last issues that Sebastii reported to me

    Thanks again:D
     

    1stdead

    Portal Pro
    February 1, 2008
    1,089
    139
    Copenhagen
    Home Country
    Denmark Denmark
    Ok. Sebastii confirmed the bug I found:
    The patch does not honor default langauge choosen in MP config. Mine is set to Danish, but when playing mkv's with internal sub the first subtitle steam is always shown. I think that's the same for external subtitles, but havn't tried the one yet.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Hi,

    Ok. Sebastii confirmed the bug I found:
    The patch does not honor default langauge choosen in MP config. Mine is set to Danish, but when playing mkv's with internal sub the first subtitle steam is always shown. I think that's the same for external subtitles, but havn't tried the one yet.

    I have find why, and now it works, but i have change on ffdshow code side, i think it will possible to add "dansk equal danish" in MP to make it work without change source of ffdshow but how ?

    On ffdshow side, i change only the detected name dansk by danish :) so MP can honor the default Language.
    Cheers,
    Seb.

    By the way i have change also the display of sub when trackname [Language] is present by Language [trackname]:
    With Rochess, he try to help me with regex but it didn't work, i have take the code part from audio :

    Code:
    public override string SubtitleName(int iStream)
        {
          string streamName = SubEngine.GetInstance().GetSubtitleName(iStream);
          if (streamName == null)
          {
            return Strings.Unknown;
          }
          // remove prefix, which is added by Haali Media Splitter
          streamName = Regex.Replace(streamName, @"^S: ", "");
          // Check if returned string contains both language and trackname info
          // For example Haali Media Splitter returns mkv streams as: "trackname [language]",
          // where "trackname" is stream's "trackname" property muxed in the mkv.
          Regex regex = new Regex(@"\[.+\]");
          Match result = regex.Match(streamName);
          if (result.Success)
          {
            //Cut off and translate the language part
            string language = MediaPortal.Util.Utils.TranslateLanguageString(streamName.Substring(result.Index + 1, result.Length - 2));
    
            //Get the trackname part by removing the language part from the string.
            streamName = regex.Replace(streamName, "").Trim();
    
            //Put things back together
            streamName = language + (streamName == string.Empty ? "" : " [" + streamName + "]");
          }
    
          // mpeg splitter subtitle format
          Match m = Regex.Match(streamName, @"Subtitle\s+-\s+(?<1>.+?),", RegexOptions.IgnoreCase);
          if (m.Success)
          {
              string language = Util.Utils.TranslateLanguageString(m.Groups[1].Value);
              if (language.Length > 0)
              {
                  streamName = language;
              }
          }
    
          return streamName;
        }
     

    albain

    Portal Member
    December 19, 2006
    12
    44
    45
    Paris
    Home Country
    France France
    Hi,

    I will make a new build very soon, just fixing a few bugs

    Also I committed the danish subs issue in ffdshow repository (thank you Seb)

    Damien
     

    mylle

    Portal Pro
    April 14, 2005
    574
    66
    Denmark
    Home Country
    Denmark Denmark
    Hi,

    I will make a new build very soon, just fixing a few bugs

    Also I committed the danish subs issue in ffdshow repository (thank you Seb)

    Damien

    Im very much looking forward to a new build :)
     

    Users who are viewing this thread

    Top Bottom