@ -523,6 +523,7 @@ struct codec_handler *codec_handler_make_playback(const struct rtp_payload_type
return handler ;
return handler ;
}
}
// does not init/parse a=fmtp
static void ensure_codec_def_type ( struct rtp_payload_type * pt , enum media_type type ) {
static void ensure_codec_def_type ( struct rtp_payload_type * pt , enum media_type type ) {
if ( pt - > codec_def )
if ( pt - > codec_def )
return ;
return ;
@ -533,10 +534,13 @@ static void ensure_codec_def_type(struct rtp_payload_type *pt, enum media_type t
if ( ! pt - > codec_def - > support_encoding | | ! pt - > codec_def - > support_decoding )
if ( ! pt - > codec_def - > support_encoding | | ! pt - > codec_def - > support_decoding )
pt - > codec_def = NULL ;
pt - > codec_def = NULL ;
}
}
// does init/parse a=fmtp
void ensure_codec_def ( struct rtp_payload_type * pt , struct call_media * media ) {
void ensure_codec_def ( struct rtp_payload_type * pt , struct call_media * media ) {
if ( ! media )
if ( ! media )
return ;
return ;
ensure_codec_def_type ( pt , media - > type_id ) ;
ensure_codec_def_type ( pt , media - > type_id ) ;
if ( pt - > codec_def )
codec_parse_fmtp ( pt - > codec_def , & pt - > format , & pt - > format_parameters , NULL ) ;
}
}
// only called from codec_handlers_update()
// only called from codec_handlers_update()
@ -2176,6 +2180,8 @@ void codec_init_payload_type(struct rtp_payload_type *pt, enum media_type type)
if ( ! pt - > format_parameters . s & & def - > default_fmtp )
if ( ! pt - > format_parameters . s & & def - > default_fmtp )
str_init ( & pt - > format_parameters , ( char * ) def - > default_fmtp ) ;
str_init ( & pt - > format_parameters , ( char * ) def - > default_fmtp ) ;
codec_parse_fmtp ( def , & pt - > format , & pt - > format_parameters , NULL ) ;
if ( def - > init )
if ( def - > init )
def - > init ( pt ) ;
def - > init ( pt ) ;