cosmetic: db.cpp: consistent coding style.
authorErik Slagter <erik@openpli.org>
Sun, 30 Nov 2014 11:04:05 +0000 (12:04 +0100)
committerErik Slagter <erik@openpli.org>
Mon, 1 Dec 2014 16:53:40 +0000 (17:53 +0100)
lib/dvb/db.cpp

index 4e4e3b3..87764b2 100644 (file)
@@ -197,23 +197,24 @@ bool eDVBService::isCrypted()
 
 int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate)
 {
+       ePtr<eDVBResourceManager> res_mgr;
        bool remote_fallback_enabled = eConfigManager::getConfigBoolValue("config.usage.remote_fallback_enabled", false);
 
-       ePtr<eDVBResourceManager> res_mgr;
-       if ( eDVBResourceManager::getInstance( res_mgr ) )
+       if (eDVBResourceManager::getInstance(res_mgr))
                eDebug("isPlayble... no res manager!!");
        else
        {
                eDVBChannelID chid, chid_ignore;
                int system;
+
                ((const eServiceReferenceDVB&)ref).getChannelID(chid);
                ((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
 
-               if(res_mgr->canAllocateChannel(chid, chid_ignore, system, simulate))
-                       return(1);
+               if (res_mgr->canAllocateChannel(chid, chid_ignore, system, simulate))
+                       return 1;
 
-               if(remote_fallback_enabled)
-                       return(2);
+               if (remote_fallback_enabled)
+                       return 2;
        }
 
        return 0;
@@ -224,58 +225,74 @@ int eDVBService::checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQ
        int res = 0;
        switch (query.m_type)
        {
-       case eDVBChannelQuery::tName:
-               res = m_service_name_sort == query.m_string;
-               break;
-       case eDVBChannelQuery::tProvider:
-               if (query.m_string == "Unknown" && m_provider_name.empty())
-                       res = 1;
-               else
-                       res = m_provider_name == query.m_string;
-               break;
-       case eDVBChannelQuery::tType:
-       {
-               int service_type = ref.getServiceType();
-               if (query.m_int == 1) // TV Service
+               case eDVBChannelQuery::tName:
+               {
+                       res = m_service_name_sort == query.m_string;
+                       break;
+               }
+               case eDVBChannelQuery::tProvider:
+               {
+                       if (query.m_string == "Unknown" && m_provider_name.empty())
+                               res = 1;
+                       else
+                               res = m_provider_name == query.m_string;
+                       break;
+               }
+               case eDVBChannelQuery::tType:
                {
-                       // Hack for dish network
-                       int onid = ref.getOriginalNetworkID().get();
-                       if (onid >= 0x1001 && onid <= 0x100b)
+                       int service_type = ref.getServiceType();
+                       if (query.m_int == 1) // TV Service
                        {
-                               static int dish_tv_types[] = { 128, 133, 137, 140, 144, 145, 150, 154, 163, 164, 165, 166, 167, 168, 173, 174 };
-                               static size_t dish_tv_num_types = sizeof(dish_tv_types) / sizeof(int);
-                               if (std::binary_search(dish_tv_types, dish_tv_types + dish_tv_num_types, service_type))
-                                       return true;
+                               // Hack for dish network
+                               int onid = ref.getOriginalNetworkID().get();
+                               if (onid >= 0x1001 && onid <= 0x100b)
+                               {
+                                       static int dish_tv_types[] = { 128, 133, 137, 140, 144, 145, 150, 154, 163, 164, 165, 166, 167, 168, 173, 174 };
+                                       static size_t dish_tv_num_types = sizeof(dish_tv_types) / sizeof(int);
+                                       if (std::binary_search(dish_tv_types, dish_tv_types + dish_tv_num_types, service_type))
+                                               return true;
+                               }
                        }
+                       res = service_type == query.m_int;
+                       break;
+               }
+               case eDVBChannelQuery::tBouquet:
+               {
+                       res = 0;
+                       break;
+               }
+               case eDVBChannelQuery::tSatellitePosition:
+               {
+                       res = ((unsigned int)ref.getDVBNamespace().get())>>16 == (unsigned int)query.m_int;
+                       break;
+               }
+               case eDVBChannelQuery::tFlags:
+               {
+                       res = (m_flags & query.m_int) == query.m_int;
+                       break;
+               }
+               case eDVBChannelQuery::tChannelID:
+               {
+                       eDVBChannelID chid;
+                       ref.getChannelID(chid);
+                       res = chid == query.m_channelid;
+                       break;
+               }
+               case eDVBChannelQuery::tAND:
+               {
+                       res = checkFilter(ref, *query.m_p1) && checkFilter(ref, *query.m_p2);
+                       break;
+               }
+               case eDVBChannelQuery::tOR:
+               {
+                       res = checkFilter(ref, *query.m_p1) || checkFilter(ref, *query.m_p2);
+                       break;
+               }
+               case eDVBChannelQuery::tAny:
+               {
+                       res = 1;
+                       break;
                }
-               res = service_type == query.m_int;
-               break;
-       }
-       case eDVBChannelQuery::tBouquet:
-               res = 0;
-               break;
-       case eDVBChannelQuery::tSatellitePosition:
-               res = ((unsigned int)ref.getDVBNamespace().get())>>16 == (unsigned int)query.m_int;
-               break;
-       case eDVBChannelQuery::tFlags:
-               res = (m_flags & query.m_int) == query.m_int;
-               break;
-       case eDVBChannelQuery::tChannelID:
-       {
-               eDVBChannelID chid;
-               ref.getChannelID(chid);
-               res = chid == query.m_channelid;
-               break;
-       }
-       case eDVBChannelQuery::tAND:
-               res = checkFilter(ref, *query.m_p1) && checkFilter(ref, *query.m_p2);
-               break;
-       case eDVBChannelQuery::tOR:
-               res = checkFilter(ref, *query.m_p1) || checkFilter(ref, *query.m_p2);
-               break;
-       case eDVBChannelQuery::tAny:
-               res = 1;
-               break;
        }
 
        if (query.m_inverse)