<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3492" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hello and thanks for the feedback.</DIV>
<DIV> </DIV>
<DIV>The TCP choice main reason is to offer the ability to send audio information messages</DIV>
<DIV>to a client, either :</DIV>
<DIV>- the same VLC instance</DIV>
<DIV>- an another VLC instance (that could be running on a different host)</DIV>
<DIV>- an third application in charge of receiving the messages and displaying a panel with only bargraphs</DIV>
<DIV> </DIV>
<DIV>Philippe</DIV>
<DIV><BR>>>> "Rémi Denis-Courmont" <remi@remlab.net> Lundi 16 Novembre 2009 18:06 >>><BR>Hello,<BR><BR>Le lundi 16 novembre 2009 12:30:55 clement chesnin, vous avez écrit :<BR>> Here is a new version made with git, including the changes you<BR>> suggested. Please tell us if there are things to change or tweak...<BR><BR>Uuh, please double check your patches. You sent tens of thousands of extra <BR>lines through the PO files.<BR><BR>+if (!(p_sys->TCPconnection = net_ConnectTCP(p_this,p_sys->address,p_sys-<BR>>port))) {<BR>+        free(p_sys);<BR>+return VLC_EGENERIC;<BR>+}<BR><BR>The error value is -1, not 0. That said, I wonder why you use TCP instead of <BR>an intra-process mechanism.<BR><BR>+char *message = (char*)malloc(255*sizeof(char));<BR><BR>sizeof(char) is fundamentally always one.<BR>'char message[255];' would be much simpler here.<BR><BR>+nbChannels = aout_FormatNbChannels( &p_filter->fmt_in.audio );<BR>+if (p_sys->nbChannels != nbChannels) {<BR>+/*free(p_sys->value);<BR>+p_sys->value = (int*)malloc(nbChannels * sizeof(int));<BR>+for (i=0; i<nbChannels; i++) {<BR>+p_sys->value[i] = 0;<BR>+}*/<BR>+p_sys->nbChannels = nbChannels;<BR>+}<BR><BR>The if statement is useless here.<BR><BR>+/* 5 - compare it to the threshold */<BR>+sprintf(message,"@audiobargraph_v audiobargraph_v-alarm ");<BR>+if (sum < p_sys->alarm_threshold) {<BR>+sprintf(message,"%s1\n",message);<BR>+} else {<BR>+sprintf(message,"%s0\n",message);<BR>+}<BR><BR>This is undefined use of sprintf() and will fail on some platforms.<BR><BR>+if (p_sys->bargraph) {<BR>+/* 6 - sent the message with the values for the BarGraph */<BR>+if ((nbChannels > 0) && (p_sys->counter%(p_sys->bargraph_repetition) == 0)) <BR>{<BR>+sprintf(message,"@audiobargraph_v audiobargraph_v-i_values ");<BR>+for (i=0; i<(nbChannels-1); i++) {<BR>+sprintf(message,"%s%f:", message, i_value[i]);<BR>+}<BR>+sprintf(message,"%s%f\n", message, i_value[nbChannels-1]);<BR><BR>Same problem as above.<BR><BR>+    p_sys->p_blend = NULL;<BR>+    if( !b_sub )<BR>+    {<BR>+<BR>+        p_sys->p_blend = filter_NewBlend( VLC_OBJECT(p_filter),<BR>+                                          &p_filter->fmt_in.video );<BR>+        if( !p_sys->p_blend )<BR>+        {<BR>+            free( p_sys );<BR>+            return VLC_EGENERIC;<BR><BR>You're leaking p_barGraph here.<BR><BR>+res = strtok(i_values, delim);<BR>+while (res != NULL) {<BR>+nbChannels++;<BR>+p_BarGraph->i_values = (int*)realloc(p_BarGraph->i_values, <BR>nbChannels*sizeof(int));<BR>+p_BarGraph->i_values[nbChannels-1] = __MAX( __MIN( atof(res)*p_BarGraph-<BR>>scale, p_BarGraph->scale ), 0 );<BR>+p_BarGraph->nbChannels = nbChannels;<BR>+res = strtok(NULL, delim);<BR>+}<BR><BR>strtok() is not thread-safe. Use strtok_r() instead.<BR><BR>+res = strtok(i_values, delim);<BR>+while (res != NULL) {<BR>+p_BarGraph->nbChannels++;<BR>+p_BarGraph->i_values = (int*)realloc(p_BarGraph->i_values, p_BarGraph-<BR>>nbChannels*sizeof(int));<BR>+p_BarGraph->i_values[p_BarGraph->nbChannels-1] = __MAX( __MIN( <BR>atof(res)*p_BarGraph->scale, p_BarGraph->scale ), 0 );<BR>+res = strtok(NULL, delim);<BR>+}<BR><BR>Same as above. You could probably factor this code.<BR><BR>-- <BR>Rémi Denis-Courmont<BR><A href="http://www.remlab.net/">http://www.remlab.net/</A><BR></DIV></BODY></HTML>