@ -229,21 +229,18 @@ void assert_avoptions(AVDictionary *m)
}
}
}
}
static void asse rt_codec_experimental ( AVCodecContext * c , int encoder )
static void abo rt_codec_experimental ( AVCodec * c , int encoder )
{
{
const char * codec_string = encoder ? " encoder " : " decoder " ;
const char * codec_string = encoder ? " encoder " : " decoder " ;
AVCodec * codec ;
AVCodec * codec ;
if ( c - > codec - > capabilities & CODEC_CAP_EXPERIMENTAL & &
av_log ( NULL , AV_LOG_FATAL , " %s '%s' is experimental and might produce bad "
c - > strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL ) {
" results. \n Add '-strict experimental' if you want to use it. \n " ,
av_log ( NULL , AV_LOG_FATAL , " %s '%s' is experimental and might produce bad "
codec_string , c - > name ) ;
" results. \n Add '-strict experimental' if you want to use it. \n " ,
codec = encoder ? avcodec_find_encoder ( c - > id ) : avcodec_find_decoder ( c - > id ) ;
codec_string , c - > codec - > name ) ;
if ( ! ( codec - > capabilities & CODEC_CAP_EXPERIMENTAL ) )
codec = encoder ? avcodec_find_encoder ( c - > codec - > id ) : avcodec_find_decoder ( c - > codec - > id ) ;
av_log ( NULL , AV_LOG_FATAL , " Or use the non experimental %s '%s'. \n " ,
if ( ! ( codec - > capabilities & CODEC_CAP_EXPERIMENTAL ) )
codec_string , codec - > name ) ;
av_log ( NULL , AV_LOG_FATAL , " Or use the non experimental %s '%s'. \n " ,
exit ( 1 ) ;
codec_string , codec - > name ) ;
exit ( 1 ) ;
}
}
}
/*
/*
@ -1442,7 +1439,7 @@ static void print_sdp(void)
static int init_input_stream ( int ist_index , char * error , int error_len )
static int init_input_stream ( int ist_index , char * error , int error_len )
{
{
int i ;
int i , ret ;
InputStream * ist = input_streams [ ist_index ] ;
InputStream * ist = input_streams [ ist_index ] ;
if ( ist - > decoding_needed ) {
if ( ist - > decoding_needed ) {
AVCodec * codec = ist - > dec ;
AVCodec * codec = ist - > dec ;
@ -1470,12 +1467,13 @@ static int init_input_stream(int ist_index, char *error, int error_len)
if ( ! av_dict_get ( ist - > opts , " threads " , NULL , 0 ) )
if ( ! av_dict_get ( ist - > opts , " threads " , NULL , 0 ) )
av_dict_set ( & ist - > opts , " threads " , " auto " , 0 ) ;
av_dict_set ( & ist - > opts , " threads " , " auto " , 0 ) ;
if ( avcodec_open2 ( ist - > st - > codec , codec , & ist - > opts ) < 0 ) {
if ( ( ret = avcodec_open2 ( ist - > st - > codec , codec , & ist - > opts ) ) < 0 ) {
if ( ret = = AVERROR_EXPERIMENTAL )
abort_codec_experimental ( codec , 0 ) ;
snprintf ( error , error_len , " Error while opening decoder for input stream #%d:%d " ,
snprintf ( error , error_len , " Error while opening decoder for input stream #%d:%d " ,
ist - > file_index , ist - > st - > index ) ;
ist - > file_index , ist - > st - > index ) ;
return AVERROR ( EINVAL ) ;
return ret ;
}
}
assert_codec_experimental ( ist - > st - > codec , 0 ) ;
assert_avoptions ( ist - > opts ) ;
assert_avoptions ( ist - > opts ) ;
}
}
@ -1808,13 +1806,13 @@ static int transcode_init(void)
}
}
if ( ! av_dict_get ( ost - > opts , " threads " , NULL , 0 ) )
if ( ! av_dict_get ( ost - > opts , " threads " , NULL , 0 ) )
av_dict_set ( & ost - > opts , " threads " , " auto " , 0 ) ;
av_dict_set ( & ost - > opts , " threads " , " auto " , 0 ) ;
if ( avcodec_open2 ( ost - > st - > codec , codec , & ost - > opts ) < 0 ) {
if ( ( ret = avcodec_open2 ( ost - > st - > codec , codec , & ost - > opts ) ) < 0 ) {
if ( ret = = AVERROR_EXPERIMENTAL )
abort_codec_experimental ( codec , 1 ) ;
snprintf ( error , sizeof ( error ) , " Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height " ,
snprintf ( error , sizeof ( error ) , " Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height " ,
ost - > file_index , ost - > index ) ;
ost - > file_index , ost - > index ) ;
ret = AVERROR ( EINVAL ) ;
goto dump_format ;
goto dump_format ;
}
}
assert_codec_experimental ( ost - > st - > codec , 1 ) ;
assert_avoptions ( ost - > opts ) ;
assert_avoptions ( ost - > opts ) ;
if ( ost - > st - > codec - > bit_rate & & ost - > st - > codec - > bit_rate < 1000 )
if ( ost - > st - > codec - > bit_rate & & ost - > st - > codec - > bit_rate < 1000 )
av_log ( NULL , AV_LOG_WARNING , " The bitrate parameter is set too low. "
av_log ( NULL , AV_LOG_WARNING , " The bitrate parameter is set too low. "