[FFmpeg-cvslog] audioconvert: add av_get_default_channel_layout public function

Clément Bœsch ubitux at gmail.com
Mon Oct 3 00:49:31 CEST 2011


On Mon, Oct 03, 2011 at 12:38:42AM +0200, Marton Balint wrote:
> ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Oct  2 16:28:36 2011 +0200| [60aaf044f3fdbeb1cf702b144cb0597ce4988020] | committer: Marton Balint
> 
> audioconvert: add av_get_default_channel_layout public function
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60aaf044f3fdbeb1cf702b144cb0597ce4988020
> ---
> 
>  libavutil/audioconvert.c |    8 ++++++++
>  libavutil/audioconvert.h |    5 +++++
>  2 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c
> index 524f6f9..4a87942 100644
> --- a/libavutil/audioconvert.c
> +++ b/libavutil/audioconvert.c
> @@ -131,3 +131,11 @@ int av_get_channel_layout_nb_channels(int64_t channel_layout)
>          x &= x-1; // unset lowest set bit
>      return count;
>  }
> +
> +int av_get_default_channel_layout(int nb_channels) {
> +    int i;
> +    for (i = 0; channel_layout_map[i].name; i++)
> +        if (nb_channels == channel_layout_map[i].nb_channels)
> +            return channel_layout_map[i].layout;
> +    return 0;
> +}
> diff --git a/libavutil/audioconvert.h b/libavutil/audioconvert.h
> index 134c610..03965cc 100644
> --- a/libavutil/audioconvert.h
> +++ b/libavutil/audioconvert.h
> @@ -92,4 +92,9 @@ void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int6
>   */
>  int av_get_channel_layout_nb_channels(int64_t channel_layout);
>  
> +/**
> + * Return default channel layout for a given number of channels.
> + */
> +int av_get_default_channel_layout(int nb_channels);
> +
>  #endif /* AVUTIL_AUDIOCONVERT_H */
> 

No bump?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20111003/3662fc5f/attachment.asc>


More information about the ffmpeg-cvslog mailing list