Skip to content

Commit 4d4ca1e

Browse files
author
Valentin NOEL
committed
Transcoder: handle empty filnames only case
1 parent dd89b56 commit 4d4ca1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ ProfileLoader::Profile Transcoder::getProfileFromInputs(const std::vector<InputS
335335
assert(inputStreamDescArray.size() >= 1);
336336

337337
// Get properties from the first input
338-
size_t nonEmptyFileName = 0;
338+
size_t nonEmptyFileName = -1;
339339
for(size_t i = 0; i < inputStreamDescArray.size(); ++i)
340340
{
341341
if(!inputStreamDescArray.at(i)._filename.empty())
@@ -344,6 +344,9 @@ ProfileLoader::Profile Transcoder::getProfileFromInputs(const std::vector<InputS
344344
break;
345345
}
346346
}
347+
if(nonEmptyFileName == -1)
348+
throw std::runtime_error("Cannot handle only empty streams as input");
349+
347350
const InputStreamDesc& inputStreamDesc = inputStreamDescArray.at(nonEmptyFileName);
348351
InputFile inputFile(inputStreamDesc._filename);
349352

0 commit comments

Comments
 (0)