cvs cd problem

Ed Sweetman <[email protected]>
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Our default is set to soundcard-pmo.so which is not built apparently. 
ALSA is built. so for people who dont have soundcard-pmo.so our player 
defaults to the first pmo in the list, which happens to be the cd pmo 
for most people.  The player does not make any intelligent decisions on 
which pmo to use at this point.  So it uses the cd pmo to try and play 
any file.


I've fixed this problem with a very spiffy patch that also fixes the 
plugin naming problem so we can now make install without stupid 
renaming.  Our plugins should be named .so anyway.

I haven't gotten to the pref issue.  If you start zinf without a pref 
file it will segfault saying something like no plugins found.  But 
restart again and it uses it's generated pref file and everything works 
like normal.  You'll need to do this to generate a pref file with the 
new plugin names, or do that yourself.


This is against the current cvs.
plugin-fix.patch (text/plain, 10.5 KB)
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/include/prefs.def ./zinf/base/include/prefs.def
--- ./zinf_cvs-test/base/include/prefs.def	2003-03-16 03:27:12.000000000 -0500
+++ ./zinf/base/include/prefs.def	2003-03-20 19:08:50.000000000 -0500
@@ -22,7 +22,7 @@
 ZINF_PREF(CloseDLMOnComplete,false)
 ZINF_PREF(ConvertUnderscoresToSpaces,true)
 ZINF_PREF(DecoderThreadPriority,5)
-ZINF_PREF(DownloadManagerUI,"download.ui")
+ZINF_PREF(DownloadManagerUI,"download-ui.so")
 ZINF_PREF(ESOUNDHost, "localhost")
 ZINF_PREF(EnableBitzi,false)
 ZINF_PREF(EnableMusicBrainz,false)
@@ -43,12 +43,12 @@
 ZINF_PREF(MetadataDisplay ,1)
 ZINF_PREF(MusicBrowserHeaderWidths,"-1,-1,-1.-1")
 ZINF_PREF(MusicBrowserPosition,"-1,-1,-1,-1,-1")
-ZINF_PREF(MusicBrowserUI,"musicbrowser.ui")
+ZINF_PREF(MusicBrowserUI,"musicbrowser-ui.so")
 ZINF_PREF(NICAddress,"192.168.1.1")
 ZINF_PREF(NumberOfURLsToRemember,10)
 ZINF_PREF(OpenSaveDir, "")
 ZINF_PREF(OutputBufferSize,160)
-ZINF_PREF(PMO, "soundcard.pmo")
+ZINF_PREF(PMO, "soundcard-pmo.so")
 ZINF_PREF(PerformDBCheck,true)
 ZINF_PREF(PlayImmediately,false)
 ZINF_PREF(PlaylistHeaderColumns,"Title|Artist|Album|Time|Genre")
@@ -68,11 +68,11 @@
 ZINF_PREF(SoftMixer,false)
 ZINF_PREF(StayOnTop, false)
 ZINF_PREF(StreamBufferInterval,3)
-ZINF_PREF(TextUI, "zinfcmd.ui")
+ZINF_PREF(TextUI, "zinfcmd-ui.so")
 ZINF_PREF(Theme,"Zinf.fat")  
 ZINF_PREF(TimeDisplay,0)
-ZINF_PREF(ToolbarUI,"toolbar.ui")
-ZINF_PREF(UI, "zinf.ui")
+ZINF_PREF(ToolbarUI,"toolbar-ui.so")
+ZINF_PREF(UI, "zinf-ui.so")
 ZINF_PREF(UseAlternateNIC, "")
 ZINF_PREF(UseDebugLog, "")
 ZINF_PREF(UseNIC,false)
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/src/downloadmanager.cpp ./zinf/base/src/downloadmanager.cpp
--- ./zinf_cvs-test/base/src/downloadmanager.cpp	2003-03-14 20:01:46.000000000 -0500
+++ ./zinf/base/src/downloadmanager.cpp	2003-03-20 18:56:20.000000000 -0500
@@ -97,7 +97,7 @@
     Registrar registrar;
 
     registrar.SetSubDir("plugins");
-    registrar.SetSearchString("*.dlf");
+    registrar.SetSearchString("*-dlf.so");
     registrar.InitializeRegistry(&m_formatRegistry, context->prefs);
 
     const RegistryItem* module = NULL;
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/src/player.cpp ./zinf/base/src/player.cpp
--- ./zinf_cvs-test/base/src/player.cpp	2003-03-19 20:20:00.000000000 -0500
+++ ./zinf/base/src/player.cpp	2003-03-20 21:01:57.000000000 -0500
@@ -603,7 +603,7 @@
     printf (_("%s [-save] [-ui <UI plugin name>] <MP3 file/stream> "
       "[MP3 file/stream] ...\n\n"), progname);
     printf(_("Example command line:\n\n"));
-    printf(_("   %s -ui zinf.ui mysong1.mp3 mysong2.mp3\n\n"), progname);
+    printf(_("   %s -ui zinf-ui.so mysong1.mp3 mysong2.mp3\n\n"), progname);
 
     m_didUsage = true;
 }
@@ -622,14 +622,14 @@
         // no direct match, try w/ .ui appended...
         char      foo[512];
 
-        sprintf(foo, "%s.ui", p2);
+        sprintf(foo, "%s-ui.so", p2);
         // ut << "Comparing: " << p1 << " to " << foo << endl;
         if (strcmp(p1, foo))
         {
             // no plugin.ui match, try  plugin-arch.ui
             char      foo[512];
 
-            sprintf(foo, "%s.ui", p2);
+            sprintf(foo, "%s-ui.so", p2);
             // cout << "Comparing: " << p1 << " to " << foo << endl;
             if (strcmp(p1, foo))
             {
@@ -701,7 +701,7 @@
 
 #ifdef unix
 #ifndef HAVE_GTK
-      if (name == "zinf.ui") {
+      if (name == "zinf-ui.so") {
           pref = kTextUIPref;
           context->prefs->GetPrefString(pref, name);
       }
@@ -748,7 +748,7 @@
     delete [] cp;
 
 #ifdef HAVE_GTK
-    if(name != "zinf.ui")
+    if(name != "zinf-ui.so")
        loadSecondaryUIs = false;
 #endif
 
@@ -864,7 +864,7 @@
 //         cerr << boost::format("%1% will quit") % The_BRANDING << endl;
 
 
-         cerr << "No UI plugin in '" << thePath << "' matched 'plugins/" << name << "' or 'plugins/" << name << ".ui.'" << endl;
+         cerr << "No UI plugin in '" << thePath << "' matched 'plugins/" << name << "' or 'plugins/" << name << "-ui.so.'" << endl;
          cerr << The_BRANDING << " will quit." << endl;
 #endif
          Event    *e = new Event(CMD_QuitPlayer);
@@ -1229,14 +1229,12 @@
 {
    RegistryItem *lmc_item = NULL;
    char     *iExt;
-
    iExt = GetExtension(szUrl);
    if (!iExt)
       return NULL;
-
    if (m_lmcExtensions->find(iExt) != m_lmcExtensions->end()) 
        lmc_item = (*m_lmcExtensions)[iExt];
-
+       
    delete[] iExt;
 
    return lmc_item;
@@ -1322,7 +1320,6 @@
    if (!pmi_item)
    {
       char szErr[1024];
-
       sprintf(szErr, _("Cannot determine what pmi to use for %s\n"), pc->URL().c_str());
       m_context->log->Error(szErr);
       AcceptEvent(new ErrorMessageEvent(szErr));
@@ -1346,10 +1343,9 @@
    if (extension) {
        if (!strncasecmp("CDA", extension, 3)) {
            int32_t i = 0;
-
            while (NULL != (item = m_pmoRegistry->GetItem(i++)))
            {
-               if (!strcmp("cd.pmo", item->Name()))
+               if (!strcmp("cd-pmo.so", item->Name()))
                {
                    break;
                }
@@ -1364,19 +1360,28 @@
 
        int32_t i = 0;
 
-       while (NULL != (item = m_pmoRegistry->GetItem(i++)))
+       while (NULL != (item = m_pmoRegistry->GetItem(i)))
        {
 	    if(!defaultPMO.compare(item->Name()))
             {
                 break;
             }
+	    i++;
        }
 
 	   // if the default isn't around then just use first one 
 	   // is there a better way?
-	   if(!item)
-		  item = m_pmoRegistry->GetItem(0);
-
+	   if(!item){
+		cerr << "Requested pmo " << defaultPMO.c_str() << " not found\n";
+		int32_t xx = 1;
+		item = m_pmoRegistry->GetItem(0);
+		while(!strcmp(item->Name(), "cd-pmo.so") ||
+		      !strcmp(item->Name(), "wavout-pmo.so")){
+		    item = m_pmoRegistry->GetItem(xx);
+		    xx++;
+		}
+		cerr << "using pmo "<< item->Name() << " instead. Update pref\n";
+	    }
 	   if (item)
 	   {
 		  pmo = (PhysicalMediaOutput *) item->InitFunction()(m_context);
@@ -2230,7 +2235,7 @@
 
     while(NULL != (pmo_item = pmoRegistry->GetItem(i++))) 
     {
-        if(!strcmp("cd.pmo", pmo_item->Name())) 
+        if(!strcmp("cd-pmo.so", pmo_item->Name())) 
         {
             break;
         }
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/src/playlist.cpp ./zinf/base/src/playlist.cpp
--- ./zinf_cvs-test/base/src/playlist.cpp	2003-03-14 20:01:46.000000000 -0500
+++ ./zinf/base/src/playlist.cpp	2003-03-20 18:47:12.000000000 -0500
@@ -252,13 +252,13 @@
     Registrar registrar;
 
     registrar.SetSubDir("plugins");
-    registrar.SetSearchString("*.plf");
+    registrar.SetSearchString("*-plf.so");
     registrar.InitializeRegistry(&m_playlistRegistry, context->prefs);
 
-    registrar.SetSearchString("*.mdf");
+    registrar.SetSearchString("*-mdf.so");
     registrar.InitializeRegistry(&m_metadataRegistry, context->prefs);
 
-    registrar.SetSearchString("*.ppp");
+    registrar.SetSearchString("*-ppp.so");
     registrar.InitializeRegistry(&m_portableRegistry, context->prefs);
 
     RegistryItem* module = NULL;
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/unix/src/bootstrap.cpp ./zinf/base/unix/src/bootstrap.cpp
--- ./zinf_cvs-test/base/unix/src/bootstrap.cpp	2003-02-09 02:43:31.000000000 -0500
+++ ./zinf/base/unix/src/bootstrap.cpp	2003-03-20 18:48:11.000000000 -0500
@@ -211,28 +211,28 @@
 #if MP3_PROF
     RegistryItem* item = new RegistryItem;
     item->SetPath("[builtin]");
-    item->SetName("xingmp3.lmc");
-    item->SetDescription("xingmp3.lmc");
+    item->SetName("xingmp3-lmc.so");
+    item->SetDescription("xingmp3-lmc.so");
     item->SetInitFunction((InitializeFunction)Initialize);
     lmc->Add(item);
 #else
     registrar->SetSubDir("plugins");
-    registrar->SetSearchString("*.lmc");
+    registrar->SetSearchString("*-lmc.so");
     registrar->InitializeRegistry(lmc,context->prefs);
 #endif
 
     registrar->SetSubDir("plugins");
-    registrar->SetSearchString("*.pmi");
+    registrar->SetSearchString("*-pmi.so");
     pmi = new Registry;
     registrar->InitializeRegistry(pmi,context->prefs);
 
     registrar->SetSubDir("plugins");
-    registrar->SetSearchString("*.pmo");
+    registrar->SetSearchString("*-pmo.so");
     pmo = new Registry;
     registrar->InitializeRegistry(pmo,context->prefs);
 
     registrar->SetSubDir("plugins");
-    registrar->SetSearchString("*.ui");
+    registrar->SetSearchString("*-ui.so");
     ui = new Registry;
     registrar->InitializeRegistry(ui,context->prefs);
 
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/base/unix/src/unixprefs.cpp ./zinf/base/unix/src/unixprefs.cpp
--- ./zinf_cvs-test/base/unix/src/unixprefs.cpp	2003-03-17 14:24:56.000000000 -0500
+++ ./zinf/base/unix/src/unixprefs.cpp	2003-03-20 19:06:10.000000000 -0500
@@ -284,9 +284,9 @@
 UnixPrefs::UnixPrefs() : 
 #if 0
 	kDefaultLibraryPath(".:~/."BRANDING_APP_NAME":"UNIX_LIBDIR"/"BRANDING_APP_NAME),
-	kDefaultUI("zinf.ui"),                                        
-	kDefaultTextUI("zinfcmd.ui"),                                 
-	kDefaultPMO("soundcard.pmo"),                                 
+	kDefaultUI("zinf-ui.so"),                                        
+	kDefaultTextUI("zinfcmd-ui.so"),                                 
+	kDefaultPMO("soundcard-pmo.so"),                                 
 	kDefaultALSADevice("0:0"),                                    
 	kDefaultESOUNDHost("localhost"),
 #endif
diff -Naur -x libtool -x 'Make*' -x 'config*' -x '*.o' -x '*.la' -x '*.lo' -x '*m4' -x po -x CVS -x 'auto*' -x '.cvs*' -x .deps ./zinf_cvs-test/ui/zinf/src/ForeignTheme.cpp ./zinf/ui/zinf/src/ForeignTheme.cpp
--- ./zinf_cvs-test/ui/zinf/src/ForeignTheme.cpp	2003-02-13 07:21:37.000000000 -0500
+++ ./zinf/ui/zinf/src/ForeignTheme.cpp	2003-03-20 20:23:53.000000000 -0500
@@ -45,7 +45,7 @@
     Registrar registrar;
 
     registrar.SetSubDir("plugins");
-    registrar.SetSearchString("*.ftf");
+    registrar.SetSearchString("*-ftf.so");
     registrar.InitializeRegistry(&m_formatRegistry, context->prefs);
 
     RegistryItem *plug = NULL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.