Exemple #1
0
 public void Uninitialize()
 {
     try
     {
         ExtenderDVDPlayer.Uninitialize();
     }
     catch (Exception err)
     {
         DebugLine("Unhandled Exception: {0}", err);
     }
     finally
     {
         // close the db connections
         TitleCollectionManager.CloseDBConnection();
     }
 }
Exemple #2
0
        // keep all the Playing logic here
        static bool IsExtenderDVD_NoTranscoding(MediaSource source)
        {
            if (OMLApplication.Current.IsExtender == false || source.Format != VideoFormat.DVD ||
                FileScanner.IsDVD(source.MediaPath) == false || ExtenderDVDPlayer.CanPlay(source) == false)
            {
                return(false);
            }

            // non-default audio/subtitle/chapter start: needs transcoding
            if (source.AudioStream != null || source.Subtitle != null || source.StartChapter != null)
            {
                Utilities.DebugLine("Source has custom audio/subtitle/startchapter: {0}", source);
                return(false);
            }
            if (source.DVDDiskInfo == null)
            {
                Utilities.DebugLine("Source has no DVDDiskInfo: {0}", source);
                return(true);
            }

            string   languageCode = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
            DVDTitle title        = source.Title != null ? source.DVDDiskInfo.Titles[source.Title.Value] : source.DVDDiskInfo.GetMainTitle();

            if (title.AudioTracks.Count != 0 && string.Compare(title.AudioTracks[0].LanguageID, languageCode, true) != 0)
            {
                DVDSubtitle st = title.Subtitles.Count != 0 ? title.FindSubTitle(languageCode) : null;
                if (st != null)
                {
                    source.Subtitle = new SubtitleStream(st);
                    Utilities.DebugLine("Autoselect subtitle, since default audio stream is not native: {0}", source);
                    return(false);
                }
            }

            return(true);
        }