Commit 77987aba authored by Stefan Westerfeld's avatar Stefan Westerfeld

Support "-" as filename for hls-mark, to use stdin as input.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 88c5fbba
......@@ -275,11 +275,23 @@ TSReader::parse_header (Header& header, vector<unsigned char>& data)
Error
TSReader::load (const string& inname)
{
FILE *infile = fopen (inname.c_str(), "r");
ScopedFile infile_s (infile);
if (!infile)
return Error (string_printf ("error opening input .ts '%s'", inname.c_str()));
if (inname == "-")
{
return load (stdin);
}
else
{
FILE *infile = fopen (inname.c_str(), "r");
ScopedFile infile_s (infile);
if (!infile)
return Error (string_printf ("error opening input .ts '%s'", inname.c_str()));
return load (infile);
}
}
Error
TSReader::load (FILE *infile)
{
vector<unsigned char> awmk_stream;
Header header;
bool header_valid = false;
......
......@@ -34,6 +34,7 @@ private:
};
std::vector<Entry> m_entries;
bool parse_header (Header& header, std::vector<unsigned char>& data);
Error load (FILE *infile);
public:
Error load (const std::string& inname);
const std::vector<Entry>& entries();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment