Commit 57fa2fc6 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cus/stable'

* cus/stable:
  ffplay: use libswresample instead of av_audio_convert
  audioconvert: add av_get_default_channel_layout public function
  ffplay: use avctx->channels and avctx->freq before avcodec_open2 consistently
  ffplay: remove now unnecessary request_channels, we set it now with options
  ffplay: set request_channels to 2
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 3ebab62f 1dd3c473
This diff is collapsed.
......@@ -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;
}
......@@ -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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment