refuse to write metadata when no real metadata is available
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 31 Oct 2006 21:03:52 +0000 (21:03 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 31 Oct 2006 21:03:52 +0000 (21:03 +0000)
lib/dvb/metaparser.cpp
lib/dvb/metaparser.h

index ed4947b419e61d9399df9c71b963d2ad9171e778..3e3f9a79143df6cde1b7b50f6e8af02168f35fcd 100644 (file)
@@ -5,6 +5,7 @@
 eDVBMetaParser::eDVBMetaParser()
 {
        m_time_create = 0;
+       m_data_ok = 0;
 }
 
 int eDVBMetaParser::parseFile(const std::string &basename)
@@ -64,6 +65,7 @@ int eDVBMetaParser::parseMeta(const std::string &tsname)
                ++linecnt;
        }
        fclose(f);
+       m_data_ok = 1;
        return 0;
 }
 
@@ -111,6 +113,8 @@ int eDVBMetaParser::parseRecordings(const std::string &filename)
                        m_name = description;
                        m_description = "";
                        m_time_create = 0;
+                       
+                       m_data_ok = 1;
                        fclose(f);
                        return 0;
                }
@@ -121,6 +125,8 @@ int eDVBMetaParser::parseRecordings(const std::string &filename)
 
 int eDVBMetaParser::updateMeta(const std::string &tsname)
 {
+       if (!m_data_ok) 
+               return -1;
        std::string filename = tsname + ".meta";
 
        FILE *f = fopen(filename.c_str(), "w");
index 5eddaa092b9b9c144b79072c707c37d0c5ec5bff..01fabde892701abd5282009bdb79494e1191d8b6 100644 (file)
@@ -14,6 +14,8 @@ public:
        int parseRecordings(const std::string &filename);
        int updateMeta(const std::string &basename);
        
+       int m_data_ok;
+       
        eServiceReferenceDVB m_ref;
        std::string m_name, m_description;
        int m_time_create;