From: Andre Noll Date: Fri, 5 Mar 2010 07:42:13 +0000 (+0100) Subject: audiod: Make default filters work also for udp streams. X-Git-Tag: v0.4.2~29 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=081ea8699e6a309c44446884b8c3752529d96a25;ds=sidebyside audiod: Make default filters work also for udp streams. Currently one has to use --no_default_filters and must specify fecdec as the first filter for UDP streams, a fact that is not documented anywhere. Make decoding of udp streams work if no filters were given by changing init_default_filters() to add fecdec automatically if the udp receiver is used. --- diff --git a/NEWS b/NEWS index d99605a1..7f370eb5 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ NEWS for the new buffer tree API. - Fix audible buffer underruns for wma streams. - The alsa writer no longer prints meaningless underrun durations. + - audiod: Defaults work also for udp streams. If no filter is + given for an audio format that is received via upd, fecdec is + automatically added as the first filter (along with the decoder). --------------------------------------- 0.4.1 (2009-12-22) "concurrent horizon" diff --git a/audiod.c b/audiod.c index dd602288..1663dad3 100644 --- a/audiod.c +++ b/audiod.c @@ -873,6 +873,17 @@ static int init_default_filters(void) if (a->num_filters) continue; /* no default -- nothing to to */ + /* + * If udp is used to receive this audiod format, add fecdec as + * the first filter. + */ + if (strcmp(afi[i].receiver->name, "udp") == 0) { + tmp = para_strdup("fecdec"); + add_filter(i, tmp); + free(tmp); + if (ret < 0) + goto out; + } /* add "dec" to audio format name */ tmp = make_message("%sdec", audio_formats[i]); for (j = 0; filters[j].name; j++) @@ -898,7 +909,7 @@ static int parse_filter_args(void) { int i, ret, nf; - nf = PARA_MAX(1U, conf.filter_given); + nf = PARA_MAX(2U, conf.filter_given); PARA_INFO_LOG("maximal number of filters: %d\n", nf); FOR_EACH_AUDIO_FORMAT(i) { afi[i].filter_conf = para_malloc(nf * sizeof(void *));