<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>I'm using libswresample to convert audio between different sample format (planar format to packed format).</div>
<div><br></div><div>To init swcontext I need input audio channel_layout.</div>
<div><br></div><div>But today I found a video, when avcode_open called on it to get audio codec, the returned AVCodecContext</div><div>has channels field 1, but channle_layout 0.</div><div><br></div><div>Since 0 channle_layout will cause swcontext init error, I'd like to know what 1 channels but 0 channel_layout means</div>
<div>and if there's a workaround so that I can call sw resample successfully?</div><div><br></div></blockquote><div><br></div><div>If your channel layout is 0, I think you can just simply fall back to using av_get_default_channel_layout(codecCtx->channels)</div>
<div><br></div><div><br></div></div>