Skip to content

Commit cc755ba

Browse files
author
Valentin Noel
committed
Transcoder: throw an exception if no non-empty filename is set as input
Since the input profile cannot be guessed from such inputs.
1 parent a85f867 commit cc755ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 3 additions & 3 deletions
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 = -1;
338+
size_t nonEmptyFileName = std::numeric_limits<size_t>::max();
339339
for(size_t i = 0; i < inputStreamDescArray.size(); ++i)
340340
{
341341
if(!inputStreamDescArray.at(i)._filename.empty())
@@ -344,8 +344,8 @@ 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");
347+
if(nonEmptyFileName == std::numeric_limits<size_t>::max())
348+
throw std::runtime_error("Cannot get profile from empty input streams");
349349

350350
const InputStreamDesc& inputStreamDesc = inputStreamDescArray.at(nonEmptyFileName);
351351
InputFile inputFile(inputStreamDesc._filename);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy