eDVBMetaParser::eDVBMetaParser()
{
m_time_create = 0;
+ m_data_ok = 0;
}
int eDVBMetaParser::parseFile(const std::string &basename)
case 3:
m_time_create = atoi(line);
break;
+ case 4:
+ m_tags = line;
+ break;
default:
break;
}
++linecnt;
}
fclose(f);
+ m_data_ok = 1;
return 0;
}
m_name = description;
m_description = "";
m_time_create = 0;
+
+ m_data_ok = 1;
fclose(f);
return 0;
}
fclose(f);
return -1;
}
+
+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");
+ if (!f)
+ return -ENOENT;
+ fprintf(f, "%s\n%s\n%s\n%d\n%s\n", m_ref.toString().c_str(), m_name.c_str(), m_description.c_str(), m_time_create, m_tags.c_str());
+ fclose(f);
+ return 0;
+}