[Libav-user] about channel_layout in AVCodecContext

Bjoern Drabeck bjoern.drabeck at gmail.com
Mon Mar 18 03:06:23 CET 2013

> I'm using libswresample to convert audio between different sample format
> (planar format to packed format).
> To init swcontext I need input audio channel_layout.
> But today I found a video, when avcode_open called on it to get audio
> codec, the returned AVCodecContext
> has channels field 1, but channle_layout 0.
> Since 0 channle_layout will cause swcontext init error, I'd like to know
> what 1 channels but 0 channel_layout means
> and if there's a workaround so that I can call sw resample successfully?
If your channel layout is 0, I think you can just simply fall back to
using av_get_default_channel_layout(codecCtx->channels)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130318/9b78939a/attachment.html>

More information about the Libav-user mailing list