Commit e2dd519a authored by Stefan Westerfeld's avatar Stefan Westerfeld

HLS: more checks for write errors in TSWriter

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 2229770c
...@@ -186,6 +186,8 @@ TSWriter::process (const string& inname, const string& outname) ...@@ -186,6 +186,8 @@ TSWriter::process (const string& inname, const string& outname)
else else
{ {
err = p.write (outfile); err = p.write (outfile);
if (err)
return err;
} }
} }
...@@ -205,7 +207,10 @@ TSWriter::process (const string& inname, const string& outname) ...@@ -205,7 +207,10 @@ TSWriter::process (const string& inname, const string& outname)
p_file[pos++] = data[data_pos]; p_file[pos++] = data[data_pos];
if (pos == 188) if (pos == 188)
{ {
p_file.write (outfile); Error err = p_file.write (outfile);
if (err)
return err;
p_file.clear (TSPacket::ID::awmk_data); p_file.clear (TSPacket::ID::awmk_data);
pos = 12; pos = 12;
} }
...@@ -215,6 +220,8 @@ TSWriter::process (const string& inname, const string& outname) ...@@ -215,6 +220,8 @@ TSWriter::process (const string& inname, const string& outname)
if (pos != 12) if (pos != 12)
{ {
Error err = p_file.write (outfile); Error err = p_file.write (outfile);
if (err)
return err;
} }
} }
......
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