sunnuntai 5. lokakuuta 2008

Xineliboutput patch revisited

There was a new release of xineliboutput, 1.0.2 which fixes some problems so I updated to it, but there was still problems with the DVD subtitles, so I patched it again. Here's the full patch:

diff -ruN xineliboutput-1.0.2/config.c xineliboutput-1.0.2-patched/config.c
--- xineliboutput-1.0.2/config.c 2008-09-26 22:15:48.000000000 +0300
+++ xineliboutput-1.0.2-patched/config.c 2008-10-05 18:59:57.000000000 +0300
@@ -67,7 +67,7 @@
 
 
 const char * const config_t::s_deinterlaceMethods[ DEINTERLACE_count+1 ] = {
-  "none",
+  tr("none"),
   "bob",
   "weave",
   "greedy",
@@ -97,7 +97,7 @@
 };
 
 const char * const config_t::s_audioDrivers[ AUDIO_DRIVER_count+1 ] = { 
-  "auto", "alsa", "oss", "none", "esd", "jack",
+  "auto", "alsa", "oss", tr("none"), "esd", "jack",
   NULL
 };
 
@@ -112,7 +112,7 @@
 };
 
 const char * const config_t::s_videoDriversX11[ X11_DRIVER_count+1 ] =  {
-  "auto", "xshm", "xv", "xvmc", "xxmc", "vidix", "XDirectFB", "opengl", "sdl", "none",
+  "auto", "xshm", "xv", "xvmc", "xxmc", "vidix", "XDirectFB", "opengl", "sdl", tr("none"),
   NULL
 };
 
@@ -131,7 +131,7 @@
 };
 
 const char * const config_t::s_videoDriversFB[ FB_DRIVER_count+1 ] = {
-  "auto", "fb", "DirectFB", "sdl", "vidixfb", "aadxr3", "none",
+  "auto", "fb", "DirectFB", "sdl", "vidixfb", "aadxr3", tr("none"),
   NULL 
 };
 
@@ -147,7 +147,7 @@
 };
 
 const char * const config_t::s_frontends[ FRONTEND_count+1 ] = {
-  "sxfe", "fbfe", "none",
+  "sxfe", "fbfe", tr("none"),
   NULL
 };
 
@@ -173,7 +173,7 @@
 };
 
 const char * const config_t::s_audioVisualizations[ AUDIO_VIS_count+1 ] = {
-  "none", "goom", "oscope", "fftscope", "fftgraph",
+  tr("none"), "goom", "oscope", "fftscope", "fftgraph",
   NULL
 };
 
diff -ruN xineliboutput-1.0.2/frontend.c xineliboutput-1.0.2-patched/frontend.c
--- xineliboutput-1.0.2/frontend.c 2008-09-26 16:46:49.000000000 +0300
+++ xineliboutput-1.0.2-patched/frontend.c 2008-10-05 18:43:39.000000000 +0300
@@ -110,6 +110,12 @@
 #if VDRVERSNUM <>
     cXinelibDevice::Instance().ClrAvailableDvdSpuTracks(false);
 #endif
+    char buffer[4];
+    char *q = buffer;
+    const char *s = I18nLanguageCode(Setup.SubtitleLanguages[0]);
+    if (s)
+      strncpy(q, s, 3);
+    cXinelibDevice::Instance().SetAvailableTrack(ttSubtitle, 0, 1, q);
     while(*map) {
       bool Current = false;
       while(*map == ' ') map++;
@@ -123,7 +129,7 @@
  }
       }
       if(*map >= '0' && *map <= '9') {
- int id = atoi(map);
+ int id = atoi(map) + 1;
  while(*map && *map != ':') map++;
  if(*map == ':') map++;
  char *lang = map;
@@ -387,11 +393,32 @@
 #else
 void cXinelibThread::SetSubtitleTrack(eTrackType Track)
 {
+  int TempTrack = 0;
+  if (Track == ttNone)
+  {      
+    TempTrack = 0;
+  }
+  else if (Track == ttSubtitleFirst)
+  {
+    TempTrack = 999;
+  }
+  else
+  {
+    TempTrack = Track - 1;
+  }
   TRACEF("cXinelibThread::SetSubtitleTrack");
-  cString buf = cString::sprintf("SPUSTREAM %d%s", 
- Track==ttNone ? ttXSubtitleNone  : (Track - ttSubtitleFirst), 
+  if (TempTrack == 999)
+  {
+    cString buf = cString::sprintf("SPUSTREAM %d%s", ttXSubtitleAuto, " auto");
+    Xine_Control(buf);
+  }
+  else
+  {
+    cString buf = cString::sprintf("SPUSTREAM %d%s", 
+ Track==ttNone ? ttXSubtitleNone  : (TempTrack - ttSubtitleFirst), 
  m_SpuLangAuto ? " auto" : "");
-  Xine_Control(buf);
+    Xine_Control(buf);
+  }
 }
 #endif
 
diff -ruN xineliboutput-1.0.2/media_player.c xineliboutput-1.0.2-patched/media_player.c
--- xineliboutput-1.0.2/media_player.c 2008-09-26 22:37:37.000000000 +0300
+++ xineliboutput-1.0.2-patched/media_player.c 2008-10-05 18:57:30.000000000 +0300
@@ -847,14 +847,14 @@
 
 class cDvdMenu : public cOsdMenu {
  public:
-  cDvdMenu(void) : cOsdMenu("DVD Menu")
+  cDvdMenu(void) : cOsdMenu(tr("DVD Menu"))
   {
-    Add(new cOsdItem("Exit DVD menu",  osUser1));
-    Add(new cOsdItem("DVD Root menu",  osUser2));
-    Add(new cOsdItem("DVD Title menu", osUser3));
-    Add(new cOsdItem("DVD SPU menu",   osUser4));
-    Add(new cOsdItem("DVD Audio menu", osUser5));
-    Add(new cOsdItem("Close menu",     osEnd));
+    Add(new cOsdItem(tr("Exit DVD menu"),  osUser1));
+    Add(new cOsdItem(tr("DVD Root menu"),  osUser2));
+    Add(new cOsdItem(tr("DVD Title menu"), osUser3));
+    Add(new cOsdItem(tr("DVD SPU menu"),   osUser4));
+    Add(new cOsdItem(tr("DVD Audio menu"), osUser5));
+    Add(new cOsdItem(tr("Close menu"),     osEnd));
     Display();
   }
 };
@@ -958,8 +958,8 @@
       // Replay control
       case kUp:    Key = kPlay;    break;
       case kDown:  Key = kPause;   break;
-      case kLeft:  Key = kFastRew; break;
-      case kRight: Key = kFastFwd; break;
+      case kLeft:  Key = kPrev; break;
+      case kRight: Key = kNext; break;
       case kOk:    
    if(m_Player->Speed() != 1) {
      Hide();
@@ -1014,8 +1014,8 @@
     case kUser9:
     case k3:      m_Player->Control("SEEK +20");  break;
 
-    case kStop: 
-    case kBlue:   Hide();
+    case kStop:   Hide();
+//    case kBlue:   Hide();
                   Close();
                   return osEnd;
 
diff -ruN xineliboutput-1.0.2/po/cs_CZ.po xineliboutput-1.0.2-patched/po/cs_CZ.po
--- xineliboutput-1.0.2/po/cs_CZ.po 2008-10-04 09:43:09.000000000 +0300
+++ xineliboutput-1.0.2-patched/po/cs_CZ.po 2008-10-05 19:03:01.000000000 +0300
@@ -6,7 +6,7 @@
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-21 10:36+0300\n"
+"POT-Creation-Date: 2008-10-05 19:03+0300\n"
 "PO-Revision-Date: 2008-03-20 23:57+0100\n"
 "Last-Translator: Maya \n"
 "Language-Team:  \n"
@@ -55,6 +55,10 @@
 msgid "DVB"
 msgstr "DVB"
 
+#, fuzzy
+msgid "none"
+msgstr "ne"
+
 msgid "off"
 msgstr "vypnuto"
 
@@ -187,6 +191,27 @@
 msgid "Normal play"
 msgstr "Normální pøehrávání"
 
+msgid "DVD Menu"
+msgstr ""
+
+msgid "Exit DVD menu"
+msgstr ""
+
+msgid "DVD Root menu"
+msgstr ""
+
+msgid "DVD Title menu"
+msgstr ""
+
+msgid "DVD SPU menu"
+msgstr ""
+
+msgid "DVD Audio menu"
+msgstr ""
+
+msgid "Close menu"
+msgstr ""
+
 msgid "Delete image ?"
 msgstr "Smazat obrázek ?"
 
diff -ruN xineliboutput-1.0.2/po/de_DE.po xineliboutput-1.0.2-patched/po/de_DE.po
--- xineliboutput-1.0.2/po/de_DE.po 2008-10-04 09:43:09.000000000 +0300
+++ xineliboutput-1.0.2-patched/po/de_DE.po 2008-10-05 19:03:01.000000000 +0300
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-23 12:36+0300\n"
+"POT-Creation-Date: 2008-10-05 19:03+0300\n"
 "PO-Revision-Date: 2007-11-23 10:17+0200\n"
 "Last-Translator: Udo Richter\n"
 "Language-Team: \n"
@@ -54,6 +54,9 @@
 msgid "DVB"
 msgstr ""
 
+msgid "none"
+msgstr ""
+
 msgid "off"
 msgstr "Aus"
 
@@ -186,6 +189,27 @@
 msgid "Normal play"
 msgstr "Normale Wiedergabe"
 
+msgid "DVD Menu"
+msgstr ""
+
+msgid "Exit DVD menu"
+msgstr ""
+
+msgid "DVD Root menu"
+msgstr ""
+
+msgid "DVD Title menu"
+msgstr ""
+
+msgid "DVD SPU menu"
+msgstr ""
+
+msgid "DVD Audio menu"
+msgstr ""
+
+msgid "Close menu"
+msgstr ""
+
 msgid "Delete image ?"
 msgstr "Bild löschen?"
 
diff -ruN xineliboutput-1.0.2/po/fi_FI.po xineliboutput-1.0.2-patched/po/fi_FI.po
--- xineliboutput-1.0.2/po/fi_FI.po 2008-10-04 09:43:09.000000000 +0300
+++ xineliboutput-1.0.2-patched/po/fi_FI.po 2008-10-05 19:19:26.000000000 +0300
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-21 10:36+0300\n"
+"POT-Creation-Date: 2008-10-05 19:03+0300\n"
 "PO-Revision-Date: 2007-11-23 10:17+0200\n"
 "Last-Translator: Petri Hintukainen\n"
 "Language-Team: \n"
@@ -55,6 +55,9 @@
 msgid "DVB"
 msgstr ""
 
+msgid "none"
+msgstr "ei mitään"
+
 msgid "off"
 msgstr "ei käytössä"
 
@@ -134,25 +137,25 @@
 msgstr "Laitteistolla"
 
 msgid "no"
-msgstr ""
+msgstr "ei"
 
 msgid "grayscale"
-msgstr ""
+msgstr "harmaasävy"
 
 msgid "transparent"
-msgstr ""
+msgstr "läpinäkyvä"
 
 msgid "transparent grayscale"
-msgstr ""
+msgstr "läpinäkyvä harmaasävy"
 
 msgid "yes"
-msgstr ""
+msgstr "kyllä"
 
 msgid "nearest"
-msgstr ""
+msgstr "lähin"
 
 msgid "bilinear"
-msgstr ""
+msgstr "bilineaarinen"
 
 msgid "Frontend initialization failed"
 msgstr "Näyttölaitteen alustus epäonnistui"
@@ -187,6 +190,27 @@
 msgid "Normal play"
 msgstr "Normaali toisto"
 
+msgid "DVD Menu"
+msgstr "DVD valikko"
+
+msgid "Exit DVD menu"
+msgstr "Palaa DVD valikkoon"
+
+msgid "DVD Root menu"
+msgstr "DVD päävalikko"
+
+msgid "DVD Title menu"
+msgstr "DVD nimikevalikko"
+
+msgid "DVD SPU menu"
+msgstr "DVD tekstitysvalikko"
+
+msgid "DVD Audio menu"
+msgstr "DVD äänivalikko"
+
+msgid "Close menu"
+msgstr "Sulje"
+
 msgid "Delete image ?"
 msgstr "Poistetaanko kuva ?"
 
@@ -254,7 +278,7 @@
 msgstr "Ääniasetukset"
 
 msgid "Headphone audio mode"
-msgstr ""
+msgstr "Kuuloke tila"
 
 msgid "Audio Compression"
 msgstr "Voimista hiljaisia ääniä"
@@ -275,7 +299,7 @@
 msgstr "Videon kuvasuhde"
 
 msgid "On"
-msgstr ""
+msgstr "Päällä"
 
 msgid "Deinterlacing"
 msgstr "Lomituksen poisto"
@@ -287,13 +311,13 @@
 msgstr "Miksaa AC3-ääni surroundiksi"
 
 msgid "Default playlist not found"
-msgstr ""
+msgstr "Oletussoittolistaa ei löydy"
 
 msgid "Default playlist is not symlink"
-msgstr ""
+msgstr "Oletussoittolista ei ole symbolinenlinkki"
 
 msgid "Default playlist not defined"
-msgstr ""
+msgstr "Oletussoittolistaa ei ole määritelty"
 
 msgid "Delay"
 msgstr "Viive"
@@ -315,7 +339,7 @@
 msgstr "Äänenvoimakkuuden säätö"
 
 msgid "Mix to headphones"
-msgstr ""
+msgstr "Miksaa kuulokkeille"
 
 msgid "Visualization"
 msgstr "Visualisointi"
@@ -603,7 +627,7 @@
 msgstr "Bittikartta"
 
 msgid "OSD"
-msgstr ""
+msgstr "Kuvaruutunäyttö"
 
 msgid "Media Player"
 msgstr "Mediasoitin"
diff -ruN xineliboutput-1.0.2/po/it_IT.po xineliboutput-1.0.2-patched/po/it_IT.po
--- xineliboutput-1.0.2/po/it_IT.po 2008-10-04 09:43:09.000000000 +0300
+++ xineliboutput-1.0.2-patched/po/it_IT.po 2008-10-05 19:03:02.000000000 +0300
@@ -6,7 +6,7 @@
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-21 10:36+0300\n"
+"POT-Creation-Date: 2008-10-05 19:03+0300\n"
 "PO-Revision-Date: 2008-01-16 00:27+0100\n"
 "Last-Translator: Gringo \n"
 "Language-Team:  \n"
@@ -53,6 +53,10 @@
 msgid "DVB"
 msgstr ""
 
+#, fuzzy
+msgid "none"
+msgstr "no"
+
 msgid "off"
 msgstr "spento"
 
@@ -185,6 +189,27 @@
 msgid "Normal play"
 msgstr "Riproduzione normale"
 
+msgid "DVD Menu"
+msgstr ""
+
+msgid "Exit DVD menu"
+msgstr ""
+
+msgid "DVD Root menu"
+msgstr ""
+
+msgid "DVD Title menu"
+msgstr ""
+
+msgid "DVD SPU menu"
+msgstr ""
+
+msgid "DVD Audio menu"
+msgstr ""
+
+msgid "Close menu"
+msgstr ""
+
 msgid "Delete image ?"
 msgstr "Cancellare immagine ?"
 
diff -ruN xineliboutput-1.0.2/po/ru_RU.po xineliboutput-1.0.2-patched/po/ru_RU.po
--- xineliboutput-1.0.2/po/ru_RU.po 2008-10-04 09:43:10.000000000 +0300
+++ xineliboutput-1.0.2-patched/po/ru_RU.po 2008-10-05 19:03:02.000000000 +0300
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-21 10:36+0300\n"
+"POT-Creation-Date: 2008-10-05 19:03+0300\n"
 "PO-Revision-Date: 2007-11-23 10:17+0200\n"
 "Last-Translator: Vladimir Monchenko\n"
 "Language-Team: \n"
@@ -54,6 +54,9 @@
 msgid "DVB"
 msgstr ""
 
+msgid "none"
+msgstr ""
+
 msgid "off"
 msgstr "²ëÚÛ."
 
@@ -186,6 +189,27 @@
 msgid "Normal play"
 msgstr ""
 
+msgid "DVD Menu"
+msgstr ""
+
+msgid "Exit DVD menu"
+msgstr ""
+
+msgid "DVD Root menu"
+msgstr ""
+
+msgid "DVD Title menu"
+msgstr ""
+
+msgid "DVD SPU menu"
+msgstr ""
+
+msgid "DVD Audio menu"
+msgstr ""
+
+msgid "Close menu"
+msgstr ""
+
 msgid "Delete image ?"
 msgstr "ÃÔÐÛØâì ÚÐàâØÝÚã ?"