@ -106,11 +106,7 @@ static const struct {
{ " downmix " , 2 , AV_CH_LAYOUT_STEREO_DOWNMIX , } ,
} ;
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
static uint64_t get_channel_layout_single ( const char * name , int name_len , int compat )
# else
static uint64_t get_channel_layout_single ( const char * name , int name_len )
# endif
{
int i ;
char * end ;
@ -128,27 +124,8 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
return ( int64_t ) 1 < < i ;
i = strtol ( name , & end , 10 ) ;
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
if ( compat ) {
if ( end - name = = name_len | |
( end + 1 - name = = name_len & & * end = = ' c ' ) ) {
layout = av_get_default_channel_layout ( i ) ;
if ( end - name = = name_len ) {
av_log ( NULL , AV_LOG_WARNING ,
" Single channel layout '%.*s' is interpreted as a number of channels, "
" switch to the syntax '%.*sc' otherwise it will be interpreted as a "
" channel layout number in a later version \n " ,
name_len , name , name_len , name ) ;
}
return layout ;
}
} else {
# endif
if ( ( end + 1 - name = = name_len & & * end = = ' c ' ) )
return av_get_default_channel_layout ( i ) ;
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
}
# endif
layout = strtoll ( name , & end , 0 ) ;
if ( end - name = = name_len )
@ -156,11 +133,7 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
return 0 ;
}
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
uint64_t ff_get_channel_layout ( const char * name , int compat )
# else
uint64_t av_get_channel_layout ( const char * name )
# endif
{
const char * n , * e ;
const char * name_end = name + strlen ( name ) ;
@ -168,11 +141,7 @@ uint64_t av_get_channel_layout(const char *name)
for ( n = name ; n < name_end ; n = e + 1 ) {
for ( e = n ; e < name_end & & * e ! = ' + ' & & * e ! = ' | ' ; e + + ) ;
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
layout_single = get_channel_layout_single ( n , e - n , compat ) ;
# else
layout_single = get_channel_layout_single ( n , e - n ) ;
# endif
if ( ! layout_single )
return 0 ;
layout | = layout_single ;
@ -180,13 +149,6 @@ uint64_t av_get_channel_layout(const char *name)
return layout ;
}
# if FF_API_GET_CHANNEL_LAYOUT_COMPAT
uint64_t av_get_channel_layout ( const char * name )
{
return ff_get_channel_layout ( name , 1 ) ;
}
# endif
void av_bprint_channel_layout ( struct AVBPrint * bp ,
int nb_channels , uint64_t channel_layout )
{