allow some more media types, fix extension detection
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 23 Mar 2006 10:32:46 +0000 (10:32 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 23 Mar 2006 10:32:46 +0000 (10:32 +0000)
lib/service/servicefs.cpp

index 22d8cf6..c53e055 100644 (file)
@@ -129,13 +129,20 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
                        list.push_back(service);
                } else
                {
                        list.push_back(service);
                } else
                {
-                       std::string extension = filename.substr(filename.rfind('.'));
+                       size_t e = filename.rfind('.');
+                       std::string extension = (e != std::string::npos) ? filename.substr(e) : "";
                        int type = -1;
                        
                        if (extension == ".ts")
                                type = eServiceFactoryDVB::id;
                        else if (extension == ".mp3" || extension == ".ogg" || extension == ".avi")
                                type = 4097;
                        int type = -1;
                        
                        if (extension == ".ts")
                                type = eServiceFactoryDVB::id;
                        else if (extension == ".mp3" || extension == ".ogg" || extension == ".avi")
                                type = 4097;
+                       else if (extension == ".ogg")
+                               type = 4097;
+                       else if (extension == ".mpg")
+                               type = 4097;
+                       else if (extension == ".vob")
+                               type = 4097;
                        
                        if (type != -1)
                        {
                        
                        if (type != -1)
                        {