@@ -55,8 +55,8 @@ bool AudioTransform::init(const Frame& srcFrame, const Frame& dstFrame)
55
55
const AudioFrame& src = static_cast <const AudioFrame&>(srcFrame);
56
56
const AudioFrame& dst = static_cast <const AudioFrame&>(dstFrame);
57
57
58
- av_opt_set_int (_audioConvertContext, " in_channel_layout" , av_get_default_channel_layout ( src.getNbChannels () ), 0 );
59
- av_opt_set_int (_audioConvertContext, " out_channel_layout" , av_get_default_channel_layout ( dst.getNbChannels () ), 0 );
58
+ av_opt_set_int (_audioConvertContext, " in_channel_layout" , src.getChannelLayout ( ), 0 );
59
+ av_opt_set_int (_audioConvertContext, " out_channel_layout" , dst.getChannelLayout ( ), 0 );
60
60
av_opt_set_int (_audioConvertContext, " in_sample_rate" , src.getSampleRate (), 0 );
61
61
av_opt_set_int (_audioConvertContext, " out_sample_rate" , dst.getSampleRate (), 0 );
62
62
SetSampleFormat (_audioConvertContext, " in_sample_fmt" , src.getSampleFormat (), 0 );
@@ -67,8 +67,8 @@ bool AudioTransform::init(const Frame& srcFrame, const Frame& dstFrame)
67
67
FreeResampleContext (&_audioConvertContext);
68
68
std::stringstream msg;
69
69
msg << " Unable to open audio convert context:" << std::endl;
70
- msg << " in_channel_layout " << av_get_default_channel_layout ( src.getNbChannels () ) << std::endl;
71
- msg << " out_channel_layout " << av_get_default_channel_layout ( dst.getNbChannels () ) << std::endl;
70
+ msg << " in_channel_layout " << src.getChannelLayoutDesc ( ) << std::endl;
71
+ msg << " out_channel_layout " << dst.getChannelLayoutDesc ( ) << std::endl;
72
72
msg << " in_sample_rate " << src.getSampleRate () << std::endl;
73
73
msg << " out_sample_rate " << dst.getSampleRate () << std::endl;
74
74
msg << " in_sample_fmt " << src.getSampleFormat () << std::endl;
@@ -80,8 +80,10 @@ bool AudioTransform::init(const Frame& srcFrame, const Frame& dstFrame)
80
80
msg << " Audio conversion from " << getSampleFormatName (src.getSampleFormat ()) << " to "
81
81
<< getSampleFormatName (dst.getSampleFormat ()) << std::endl;
82
82
msg << " Source, number of channels = " << src.getNbChannels () << std::endl;
83
+ msg << " Source, channel layout = " << src.getChannelLayoutDesc () << std::endl;
83
84
msg << " Source, sample rate = " << src.getSampleRate () << std::endl;
84
85
msg << " Destination, number of channels = " << dst.getNbChannels () << std::endl;
86
+ msg << " Destination, channel layout = " << dst.getChannelLayoutDesc () << std::endl;
85
87
msg << " Destination, sample rate = " << dst.getSampleRate () << std::endl;
86
88
LOG_INFO (msg.str ())
87
89
0 commit comments