File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,7 @@ std::string AudioProperties::getCodecName() const
40
40
{
41
41
if ( _codec && _codec->name )
42
42
return std::string ( _codec->name );
43
- else
44
- return " unknown codec" ;
43
+ return " unknown codec" ;
45
44
}
46
45
47
46
std::string AudioProperties::getCodecLongName () const
Original file line number Diff line number Diff line change @@ -20,22 +20,22 @@ FileProperties::FileProperties( const FormatContext& formatContext )
20
20
21
21
std::string FileProperties::getFilename () const
22
22
{
23
- if ( ! _formatContext )
24
- throw std::runtime_error ( " unknown format context " ) ;
23
+ if ( ! _formatContext || ! _formatContext-> filename )
24
+ return " unknown file name " ;
25
25
return _formatContext->filename ;
26
26
}
27
27
28
28
std::string FileProperties::getFormatName () const
29
29
{
30
- if ( ! _formatContext || ! _formatContext->iformat )
31
- throw std::runtime_error ( " unknown format context " ) ;
30
+ if ( ! _formatContext || ! _formatContext->iformat || ! _formatContext-> iformat -> name )
31
+ return " unknown format name " ;
32
32
return _formatContext->iformat ->name ;
33
33
}
34
34
35
35
std::string FileProperties::getFormatLongName () const
36
36
{
37
- if ( ! _formatContext || ! _formatContext->iformat )
38
- throw std::runtime_error ( " unknown format context " ) ;
37
+ if ( ! _formatContext || ! _formatContext->iformat || ! _formatContext-> iformat -> long_name )
38
+ return " unknown format long name " ;
39
39
return _formatContext->iformat ->long_name ;
40
40
}
41
41
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ std::string VideoProperties::getProfileName() const
84
84
85
85
if ( _codecContext->profile != -99 )
86
86
{
87
- const char * profile;
87
+ const char * profile = NULL ;
88
88
if ( ( profile = av_get_profile_name ( _codec, _codecContext->profile ) ) != NULL )
89
89
return std::string ( profile );
90
90
}
You can’t perform that action at this time.
0 commit comments