@@ -857,8 +857,6 @@ void config_init (char *fname, struct audio_s *p_audio_config,
857
857
p_misc_config -> kiss_port [i ] = 0 ; // entry not used.
858
858
p_misc_config -> kiss_chan [i ] = -1 ;
859
859
}
860
- p_misc_config -> kiss_port [0 ] = DEFAULT_KISS_PORT ;
861
- p_misc_config -> kiss_chan [0 ] = -1 ; // all channels.
862
860
863
861
p_misc_config -> enable_kiss_pt = 0 ; /* -p option */
864
862
p_misc_config -> kiss_copy = 0 ;
@@ -4537,6 +4535,13 @@ void config_init (char *fname, struct audio_s *p_audio_config,
4537
4535
continue ;
4538
4536
}
4539
4537
4538
+ if (tcp_port == 0 ) {
4539
+ // If existing config files have KISSPORT 0, ignore it and move on
4540
+ text_color_set (DW_COLOR_ERROR );
4541
+ dw_printf ("Line %d: Warning: KISSPORT 0 setting no longer needed.\n" , line );
4542
+ continue ;
4543
+ }
4544
+
4540
4545
t = split (NULL ,0 );
4541
4546
if (t != NULL ) {
4542
4547
chan = atoi (t );
@@ -4547,37 +4552,27 @@ void config_init (char *fname, struct audio_s *p_audio_config,
4547
4552
}
4548
4553
}
4549
4554
4550
- // "KISSPORT 0" is used to remove the default entry.
4551
-
4552
- if (tcp_port == 0 ) {
4553
- p_misc_config -> kiss_port [0 ] = 0 ; // Should all be wiped out?
4554
- }
4555
- else {
4556
-
4557
- // Try to find an empty slot.
4558
- // A duplicate TCP port number will overwrite the previous value.
4555
+ // Try to find an empty slot.
4556
+ // A duplicate TCP port number will overwrite the previous value.
4559
4557
4560
- int slot = -1 ;
4561
- for (int i = 0 ; i < MAX_KISS_TCP_PORTS && slot == -1 ; i ++ ) {
4562
- if (p_misc_config -> kiss_port [i ] == tcp_port ) {
4563
- slot = i ;
4564
- if ( ! (slot == 0 && tcp_port == DEFAULT_KISS_PORT )) {
4565
- text_color_set (DW_COLOR_ERROR );
4566
- dw_printf ("Line %d: Warning: Duplicate TCP port %d will overwrite previous value.\n" , line , tcp_port );
4567
- }
4568
- }
4569
- else if (p_misc_config -> kiss_port [i ] == 0 ) {
4570
- slot = i ;
4571
- }
4572
- }
4573
- if (slot >= 0 ) {
4574
- p_misc_config -> kiss_port [slot ] = tcp_port ;
4575
- p_misc_config -> kiss_chan [slot ] = chan ;
4576
- }
4577
- else {
4558
+ int slot = -1 ;
4559
+ for (int i = 0 ; i < MAX_KISS_TCP_PORTS && slot == -1 ; i ++ ) {
4560
+ if (p_misc_config -> kiss_port [i ] == tcp_port ) {
4561
+ slot = i ;
4578
4562
text_color_set (DW_COLOR_ERROR );
4579
- dw_printf ("Line %d: Too many KISSPORT commands .\n" , line );
4563
+ dw_printf ("Line %d: Warning: Duplicate TCP port %d will overwrite previous value .\n" , line , tcp_port );
4580
4564
}
4565
+ else if (p_misc_config -> kiss_port [i ] == 0 ) {
4566
+ slot = i ;
4567
+ }
4568
+ }
4569
+ if (slot >= 0 ) {
4570
+ p_misc_config -> kiss_port [slot ] = tcp_port ;
4571
+ p_misc_config -> kiss_chan [slot ] = chan ;
4572
+ }
4573
+ else {
4574
+ text_color_set (DW_COLOR_ERROR );
4575
+ dw_printf ("Line %d: Too many KISSPORT commands.\n" , line );
4581
4576
}
4582
4577
}
4583
4578
@@ -5357,6 +5352,11 @@ void config_init (char *fname, struct audio_s *p_audio_config,
5357
5352
p_misc_config -> maxv22 = p_misc_config -> retry / 3 ;
5358
5353
}
5359
5354
5355
+ /* If no kiss port specified, add default to first slot */
5356
+ if (p_misc_config -> kiss_port [0 ] == 0 ) {
5357
+ p_misc_config -> kiss_port [0 ] = DEFAULT_KISS_PORT ;
5358
+ }
5359
+
5360
5360
} /* end config_init */
5361
5361
5362
5362
0 commit comments