Skip to content

Commit 9a4c455

Browse files
author
Clement Champetier
committed
FileProperties: all getters throw exception when can't access data
1 parent 0f30297 commit 9a4c455

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AvTranscoder/mediaProperty/FileProperties.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ FileProperties::FileProperties( const FormatContext& formatContext )
2121
std::string FileProperties::getFilename() const
2222
{
2323
if( ! _formatContext || ! _formatContext->filename )
24-
return "unknown file name";
24+
throw std::runtime_error( "unknown file name" );
2525
return _formatContext->filename;
2626
}
2727

2828
std::string FileProperties::getFormatName() const
2929
{
3030
if( ! _formatContext || ! _formatContext->iformat || ! _formatContext->iformat->name )
31-
return "unknown format name";
31+
throw std::runtime_error( "unknown format name");
3232
return _formatContext->iformat->name;
3333
}
3434

3535
std::string FileProperties::getFormatLongName() const
3636
{
3737
if( ! _formatContext || ! _formatContext->iformat || ! _formatContext->iformat->long_name )
38-
return "unknown format long name";
38+
throw std::runtime_error( "unknown format long name");
3939
return _formatContext->iformat->long_name;
4040
}
4141

0 commit comments

Comments
 (0)