Skip to content

Commit 5ad23f7

Browse files
author
Clement Champetier
committed
Audio profile: remove channel layout requirement
Fix: the channel layout is not required by FFMPEG when open audio codec context. So an audio profile has not to set this value.
1 parent 398033d commit 5ad23f7

File tree

4 files changed

+1
-9
lines changed

4 files changed

+1
-9
lines changed

src/AvTranscoder/EssenceStream/OutputAudio.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ void OutputAudio::setProfile( Profile::ProfileDesc& desc, const AudioFrameDesc&
181181
if( ! desc.count( Profile::avProfileCodec ) ||
182182
! desc.count( Profile::avProfileSampleFormat ) ||
183183
! desc.count( Profile::avProfileSampleRate ) ||
184-
! desc.count( Profile::avProfileChannel ) ||
185-
! desc.count( Profile::avProfileChannelLayout ) )
184+
! desc.count( Profile::avProfileChannel ) )
186185
{
187186
throw std::runtime_error( "The profile " + desc[ Profile::avProfileIdentificatorHuman ] + " is invalid." );
188187
}
@@ -194,9 +193,6 @@ void OutputAudio::setProfile( Profile::ProfileDesc& desc, const AudioFrameDesc&
194193
if( desc[ Profile::avProfileChannel ] == "0" )
195194
throw std::runtime_error( "Profile " + desc[ Profile::avProfileIdentificatorHuman ] + ": bad audio channel." );
196195

197-
if( desc[ Profile::avProfileChannelLayout ] == "0" )
198-
throw std::runtime_error( "Profile " + desc[ Profile::avProfileIdentificatorHuman ] + ": bad audio channel layout." );
199-
200196
_audioDesc.setAudioCodec( desc[ Profile::avProfileCodec ] );
201197
size_t sample_rate = std::strtoul( desc[ Profile::avProfileSampleRate ].c_str(), NULL, 0 );
202198
size_t channels = std::strtoul( desc[ Profile::avProfileChannel ].c_str(), NULL, 0 );

src/AvTranscoder/Profile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const std::string Profile::avProfileSampleFormat( "sample_fmt" );
2525
const std::string Profile::avProfileFrameRate( "r" );
2626
const std::string Profile::avProfileSampleRate( "ar" );
2727
const std::string Profile::avProfileChannel( "ac" );
28-
const std::string Profile::avProfileChannelLayout( "channel_layout" );
2928
const std::string Profile::avProfileWidth( "width" );
3029
const std::string Profile::avProfileHeight( "height" );
3130

src/AvTranscoder/Profile.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class Profile
2525
static const std::string avProfileFrameRate;
2626
static const std::string avProfileSampleRate;
2727
static const std::string avProfileChannel;
28-
static const std::string avProfileChannelLayout;
2928

3029
static const std::string avProfileWidth;
3130
static const std::string avProfileHeight;

src/AvTranscoder/Profiles/Wave.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ void loadWave( Profile::ProfilesDesc& profiles )
1616
wave24b48kMono[ Profile::avProfileSampleFormat ] = "s32";
1717
wave24b48kMono[ Profile::avProfileSampleRate ] = "48000";
1818
wave24b48kMono[ Profile::avProfileChannel ] = "1";
19-
wave24b48kMono[ Profile::avProfileChannelLayout ] = "1";
2019

2120
Profile::ProfileDesc wave16b48kMono;
2221

@@ -28,7 +27,6 @@ void loadWave( Profile::ProfilesDesc& profiles )
2827
wave16b48kMono[ Profile::avProfileSampleFormat ] = "s16";
2928
wave16b48kMono[ Profile::avProfileSampleRate ] = "48000";
3029
wave16b48kMono[ Profile::avProfileChannel ] = "1";
31-
wave16b48kMono[ Profile::avProfileChannelLayout ] = "1";
3230

3331
profiles.push_back( wave24b48kMono );
3432
profiles.push_back( wave16b48kMono );

0 commit comments

Comments
 (0)