Metaparser: add sanity check
authorlittlesat <littlesat99@yahoo.com>
Thu, 15 Oct 2015 18:31:27 +0000 (20:31 +0200)
committerlittlesat <littlesat99@yahoo.com>
Thu, 15 Oct 2015 18:31:27 +0000 (20:31 +0200)
For the case a service reference in an 'older' recording does not exists
anymore in the lamedb and the metafile needs for some reason needs to be
recreated

lib/dvb/metaparser.cpp

index feab521..be72948 100644 (file)
@@ -217,11 +217,14 @@ int eDVBMetaParser::updateMeta(const std::string &tsname)
        {
                ePtr<iServiceHandler> service_center;
                ePtr<iStaticServiceInformation> service_info;
-               std::string service_name;
                eServiceCenter::getInstance(service_center);
                service_center->info(ref, service_info);
-               service_info->getName(ref, service_name);
-               ref.setName(service_name);
+               if (service_info)
+               {
+                       std::string service_name;
+                       service_info->getName(ref, service_name);
+                       ref.setName(service_name);
+               }
        }
 
        fprintf(f, "%s\n%s\n%s\n%d\n%s\n%d\n%lld\n%s\n%d\n%d\n", ref.toString().c_str(), m_name.c_str(), m_description.c_str(), m_time_create, m_tags.c_str(), m_length, m_filesize, m_service_data.c_str(), m_packet_size, m_scrambled);