1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
|
diff --git a/ChangeLog b/ChangeLog
index d7d211d..ad57852 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2004-10-21 Henrique de Moraes Holschuh <hmh@debian.org>
+
+ * timidity/mod2midi.c (Voice_Play,Voice_SetPeriod):
+ improve the code path when period2note returns -1
+
+2004-10-21 Eric A. Welsh <ewelsh@ccb.wustl.edu>
+
+ * timidity/mod2midi.c (period2note):
+ initialize *finetune when returning a bad period
+ * timidity/mod2midi.c (load_module_samples):
+ samples without names were causing NULL pointer reads
+ * timidity/mod2midi.c (period2note):
+ delete extra \n
+
+2004-10-18 Eric A. Welsh <ewelsh@ccb.wustl.edu>
+
+ * libunimod/mlutil.c (getAmigaPeriod): Avoid division by zero
+ * timidity/mod2midi.c: Change all VERB_NORMAL and VERB_VERBOSE
+ messages to VERB_NOISY.
+
+2004-10-17 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+
+ * libunimod/mloader.c (SL_LoadSamples): too many arguments to
+ function `FreeSampleList'
+ * timidity/aq.c: fix wrong prototype (int -> void)
+
2004-10-03 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
* NEWS: Add new entry for 2.13.2
diff --git a/interface/alsaseq_c.c b/interface/alsaseq_c.c
index ac7b918..8d608a7 100644
--- a/interface/alsaseq_c.c
+++ b/interface/alsaseq_c.c
@@ -500,6 +500,7 @@ static void stop_playing(void)
static void doit(struct seq_context *ctxp)
{
+ int err, timeout_val = 10;
for (;;) {
while (snd_seq_event_input_pending(ctxp->handle, 1)) {
if (do_sequencer(ctxp))
@@ -532,10 +533,20 @@ static void doit(struct seq_context *ctxp)
struct timeval timeout;
FD_ZERO(&rfds);
FD_SET(ctxp->fd, &rfds);
- timeout.tv_sec = 0;
- timeout.tv_usec = 10000; /* 10ms */
- if (select(ctxp->fd + 1, &rfds, NULL, NULL, &timeout) < 0)
+ timeout.tv_sec = (timeout_val / 1000);
+ timeout.tv_usec = (timeout_val % 1000) * 1000;
+ err = select(ctxp->fd + 1, &rfds, NULL, NULL, timeout_val < 0 ? NULL : &timeout);
+ if (err < 0) {
goto __done;
+ } else if (err == 0) {
+ if (timeout_val < 1024) {
+ timeout_val+=timeout_val;
+ } else {
+ timeout_val = -1;
+ }
+ } else {
+ timeout_val = 10;
+ }
}
}
diff --git a/interface/xaw_i.c b/interface/xaw_i.c
index 7efd6dd..84b6885 100644
--- a/interface/xaw_i.c
+++ b/interface/xaw_i.c
@@ -261,7 +261,7 @@ int amplitude = DEFAULT_AMPLIFICATION;
String bitmapdir = XAW_BITMAP_DIR;
Boolean arrangetitle,savelist;
static char **current_flist = NULL;
-static int voices = 0, last_voice = 0, voices_num_width;
+static last_voice = 0, voices_num_width;
static int maxentry_on_a_menu = 0,submenu_n = 0;
#define OPTIONS_WINDOW 1
#define FLIST_WINDOW 2
diff --git a/libunimod/mloader.c b/libunimod/mloader.c
index 943b307..bea58df 100644
--- a/libunimod/mloader.c
+++ b/libunimod/mloader.c
@@ -636,14 +636,14 @@ SL_LoadSamples (void)
s->sample->flags = (s->sample->flags & ~SF_FORMATMASK) | s->outfmt;
if (s->sample->data == NULL)
{
- FreeSampleList (musiclist);
+ FreeSampleList ();
return 1;
}
}
s = s->next;
}
- FreeSampleList (musiclist);
+ FreeSampleList ();
return 0;
}
diff --git a/libunimod/mlutil.c b/libunimod/mlutil.c
index 3008a53..e147e8a 100644
--- a/libunimod/mlutil.c
+++ b/libunimod/mlutil.c
@@ -321,6 +321,7 @@ ULONG getAmigaPeriod (UBYTE flags, ULONG period)
if (flags & UF_LINEAR)
{
period = lintab[period % 768] >> (period / 768);
+ if (period < 1) period = 1;
period = (8363L * 1712L) / period;
}
diff --git a/timidity/aRts_a.c b/timidity/aRts_a.c
index 0140a47..6bacce3 100644
--- a/timidity/aRts_a.c
+++ b/timidity/aRts_a.c
@@ -56,6 +56,8 @@
#include "playmidi.h"
#include "miditrace.h"
+static int arts_init_state = 0; /* 0=no init, 1=arts_init, 2=arts_free */
+static int arts_atexit = 0; /* 1=atexit handler has been installed */
static arts_stream_t stream = 0;
static int server_buffer = 0;
static int output_count = 0;
@@ -64,9 +66,11 @@ static int open_output(void); /* 0=success, 1=warning, -1=fatal error */
static void close_output(void);
static int output_data(char *buf, int32 nbytes);
static int acntl(int request, void *arg);
-static int detect(void);
-/* export the playback mode */
+/* export the playback mode. aRts cannot support auto-detection properly
+ * see TiMidity bug report #35 on Kagemai. Do not add any functionality
+ * that would require TiMidity to call arts_init() again after an
+ * arts_free(), it will blow up */
#define dpm arts_play_mode
@@ -82,17 +86,16 @@ PlayMode dpm = {
open_output,
close_output,
output_data,
- acntl,
- detect
+ acntl
};
-static int detect(void)
+static void arts_shutdown(void)
{
- if (arts_init() == 0) {
- arts_free();
- return 1; /* ok, found */
+ if(arts_init_state == 1) {
+ close_output();
+ arts_free();
+ arts_init_state = 2; /* paranoia */
}
- return 0;
}
/*************************************************************************/
@@ -114,10 +117,23 @@ static int open_output(void)
channels = (dpm.encoding & PE_MONO) ? 1 : 2;
/* Open the audio device */
- if((i = arts_init()) != 0)
- {
- ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
- dpm.name, arts_error_text(i));
+ switch (arts_init_state) {
+ case 0:
+ if((i = arts_init()) != 0)
+ {
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
+ dpm.name, arts_error_text(i));
+ return -1;
+ }
+ arts_init_state = 1;
+ if (!arts_atexit) {
+ atexit(arts_shutdown);
+ arts_atexit = 1;
+ }
+ break;
+ case 2:
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
+ "TiMidity aRts bug: open_output() after close_output() not supported");
return -1;
}
stream = arts_play_stream(dpm.rate,
@@ -186,7 +202,6 @@ static void close_output(void)
if(stream == 0)
return;
arts_close_stream(stream);
- arts_free();
stream = 0;
}
@@ -197,7 +212,6 @@ static int acntl(int request, void *arg)
{
case PM_REQ_DISCARD: /* Discard stream */
arts_close_stream(stream);
- arts_free();
stream=NULL;
return 0;
case PM_REQ_RATE: /* Change sample rate */
diff --git a/timidity/aq.c b/timidity/aq.c
index af2f603..bedd737 100644
--- a/timidity/aq.c
+++ b/timidity/aq.c
@@ -87,7 +87,7 @@ static int32 estimate_queue_size(void);
/* effect.c */
extern void init_effect(void);
-extern int do_effect(int32* buf, int32 count);
+extern void do_effect(int32* buf, int32 count);
int aq_calc_fragsize(void)
{
diff --git a/timidity/common.c b/timidity/common.c
index 2fd5ea1..1ff7445 100644
--- a/timidity/common.c
+++ b/timidity/common.c
@@ -27,10 +27,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-#include <time.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif /* HAVE_SYS_TIME_H */
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif /* TIME_WITH_SYS_TIME */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
@@ -405,7 +411,8 @@ struct timidity_file *open_file(char *name, int decompress, int noise_mode)
}
/* First try the given name */
- strncpy(current_filename, url_unexpand_home_dir(name), 1023);
+ /* strncpy(current_filename, url_unexpand_home_dir(name), 1023); */
+ strncpy(current_filename, name, 1023);
current_filename[1023]='\0';
if(noise_mode)
diff --git a/timidity/flac_a.c b/timidity/flac_a.c
index 698fd29..e28acd6 100644
--- a/timidity/flac_a.c
+++ b/timidity/flac_a.c
@@ -45,9 +45,6 @@
#endif
#include <FLAC/all.h>
-#ifdef AU_OGGFLAC
-#include <OggFLAC/stream_encoder.h>
-#endif
#ifdef AU_FLAC_DLL
#include "w32_libFLAC_dll_g.h"
@@ -78,11 +75,7 @@ PlayMode dpm = {
DEFAULT_RATE, PE_SIGNED|PE_16BIT, PF_PCM_STREAM,
-1,
{0}, /* default: get all the buffer fragments you can */
-#ifndef AU_OGGFLAC
- "FLAC", 'F',
-#else
"FLAC / OggFLAC", 'F',
-#endif /* AU_OGGFLAC */
NULL,
open_output,
close_output,
@@ -100,28 +93,22 @@ typedef struct {
unsigned long out_bytes;
union {
FLAC__StreamEncoderState flac;
- FLAC__SeekableStreamEncoderState s_flac;
-#ifdef AU_OGGFLAC
- OggFLAC__StreamEncoderState ogg;
-#endif
+ FLAC__StreamEncoderState s_flac;
+ FLAC__StreamEncoderState ogg;
} state;
union {
union {
FLAC__StreamEncoder *stream;
- FLAC__SeekableStreamEncoder *s_stream;
+ FLAC__StreamEncoder *s_stream;
} flac;
-#ifdef AU_OGGFLAC
union {
- OggFLAC__StreamEncoder *stream;
+ FLAC__StreamEncoder *stream;
} ogg;
-#endif
} encoder;
} FLAC_ctx;
typedef struct {
-#ifdef AU_OGGFLAC
int isogg;
-#endif
int verify;
int padding;
int blocksize;
@@ -138,9 +125,7 @@ typedef struct {
/* default compress level is 5 */
FLAC_options flac_options = {
-#ifdef AU_OGGFLAC
0, /* isogg */
-#endif
0, /* verify */
4096, /* padding */
4608, /* blocksize */
@@ -158,13 +143,11 @@ FLAC_options flac_options = {
static long serial_number = 0;
FLAC_ctx *flac_ctx = NULL;
-#ifdef AU_OGGFLAC
static FLAC__StreamEncoderWriteStatus
-ogg_stream_encoder_write_callback(const OggFLAC__StreamEncoder *encoder,
+ogg_stream_encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
unsigned bytes, unsigned samples,
unsigned current_frame, void *client_data);
-#endif
static FLAC__StreamEncoderWriteStatus
flac_stream_encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
@@ -174,13 +157,10 @@ static void flac_stream_encoder_metadata_callback(const FLAC__StreamEncoder *enc
const FLAC__StreamMetadata *metadata,
void *client_data);
static FLAC__StreamEncoderWriteStatus
-flac_seekable_stream_encoder_write_callback(const FLAC__SeekableStreamEncoder *encoder,
+flac_stream_encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
unsigned bytes, unsigned samples,
unsigned current_frame, void *client_data);
-static void flac_seekable_stream_encoder_metadata_callback(const FLAC__SeekableStreamEncoder *encoder,
- const FLAC__StreamMetadata *metadata,
- void *client_data);
/* preset */
void flac_set_compression_level(int compression_level)
@@ -278,12 +258,10 @@ void flac_set_option_verify(int verify)
{
flac_options.verify = verify;
}
-#ifdef AU_OGGFLAC
void flac_set_option_oggflac(int isogg)
{
flac_options.isogg = isogg;
}
-#endif
static int flac_session_close()
{
@@ -295,19 +273,17 @@ static int flac_session_close()
dpm.fd = -1;
if (ctx != NULL) {
-#ifdef AU_OGGFLAC
if (flac_options.isogg) {
if (ctx->encoder.ogg.stream) {
- OggFLAC__stream_encoder_finish(ctx->encoder.ogg.stream);
- OggFLAC__stream_encoder_delete(ctx->encoder.ogg.stream);
+ FLAC__stream_encoder_finish(ctx->encoder.ogg.stream);
+ FLAC__stream_encoder_delete(ctx->encoder.ogg.stream);
}
}
else
-#endif /* AU_OGGFLAC */
if (flac_options.seekable) {
if (ctx->encoder.flac.s_stream) {
- FLAC__seekable_stream_encoder_finish(ctx->encoder.flac.s_stream);
- FLAC__seekable_stream_encoder_delete(ctx->encoder.flac.s_stream);
+ FLAC__stream_encoder_finish(ctx->encoder.flac.s_stream);
+ FLAC__stream_encoder_delete(ctx->encoder.flac.s_stream);
}
}
else
@@ -371,17 +347,16 @@ static int flac_output_open(const char *fname, const char *comment)
metadata[num_metadata++] = &padding;
}
-#ifdef AU_OGGFLAC
if (flac_options.isogg) {
- if ((ctx->encoder.ogg.stream = OggFLAC__stream_encoder_new()) == NULL) {
+ if ((ctx->encoder.ogg.stream = FLAC__stream_encoder_new()) == NULL) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create OggFLAC stream");
flac_session_close();
return -1;
}
- OggFLAC__stream_encoder_set_channels(ctx->encoder.ogg.stream, nch);
+ FLAC__stream_encoder_set_channels(ctx->encoder.ogg.stream, nch);
/* 16bps only */
- OggFLAC__stream_encoder_set_bits_per_sample(ctx->encoder.ogg.stream, 16);
+ FLAC__stream_encoder_set_bits_per_sample(ctx->encoder.ogg.stream, 16);
/* set sequential number for serial */
serial_number++;
@@ -389,9 +364,9 @@ static int flac_output_open(const char *fname, const char *comment)
srand(time(NULL));
serial_number = rand();
}
- OggFLAC__stream_encoder_set_serial_number(ctx->encoder.ogg.stream, serial_number);
+ FLAC__stream_encoder_set_ogg_serial_number(ctx->encoder.ogg.stream, serial_number);
- OggFLAC__stream_encoder_set_verify(ctx->encoder.ogg.stream, flac_options.verify);
+ FLAC__stream_encoder_set_verify(ctx->encoder.ogg.stream, flac_options.verify);
if (!FLAC__format_sample_rate_is_valid(dpm.rate)) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "invalid sampling rate %d",
@@ -399,53 +374,52 @@ static int flac_output_open(const char *fname, const char *comment)
flac_session_close();
return -1;
}
- OggFLAC__stream_encoder_set_sample_rate(ctx->encoder.ogg.stream, dpm.rate);
+ FLAC__stream_encoder_set_sample_rate(ctx->encoder.ogg.stream, dpm.rate);
- OggFLAC__stream_encoder_set_qlp_coeff_precision(ctx->encoder.ogg.stream, flac_options.qlp_coeff_precision);
+ FLAC__stream_encoder_set_qlp_coeff_precision(ctx->encoder.ogg.stream, flac_options.qlp_coeff_precision);
/* expensive! */
- OggFLAC__stream_encoder_set_do_qlp_coeff_prec_search(ctx->encoder.ogg.stream, flac_options.qlp_coeff_precision_search);
+ FLAC__stream_encoder_set_do_qlp_coeff_prec_search(ctx->encoder.ogg.stream, flac_options.qlp_coeff_precision_search);
if (nch == 2) {
- OggFLAC__stream_encoder_set_do_mid_side_stereo(ctx->encoder.ogg.stream, flac_options.mid_side);
- OggFLAC__stream_encoder_set_loose_mid_side_stereo(ctx->encoder.ogg.stream, flac_options.adaptive_mid_side);
+ FLAC__stream_encoder_set_do_mid_side_stereo(ctx->encoder.ogg.stream, flac_options.mid_side);
+ FLAC__stream_encoder_set_loose_mid_side_stereo(ctx->encoder.ogg.stream, flac_options.adaptive_mid_side);
}
- OggFLAC__stream_encoder_set_max_lpc_order(ctx->encoder.ogg.stream, flac_options.max_lpc_order);
- OggFLAC__stream_encoder_set_min_residual_partition_order(ctx->encoder.ogg.stream, flac_options.min_residual_partition_order);
- OggFLAC__stream_encoder_set_max_residual_partition_order(ctx->encoder.ogg.stream, flac_options.max_residual_partition_order);
-
- OggFLAC__stream_encoder_set_blocksize(ctx->encoder.ogg.stream, flac_options.blocksize);
+ FLAC__stream_encoder_set_max_lpc_order(ctx->encoder.ogg.stream, flac_options.max_lpc_order);
+ FLAC__stream_encoder_set_min_residual_partition_order(ctx->encoder.ogg.stream, flac_options.min_residual_partition_order);
+ FLAC__stream_encoder_set_max_residual_partition_order(ctx->encoder.ogg.stream, flac_options.max_residual_partition_order);
- OggFLAC__stream_encoder_set_client_data(ctx->encoder.ogg.stream, ctx);
+ FLAC__stream_encoder_set_blocksize(ctx->encoder.ogg.stream, flac_options.blocksize);
if (0 < num_metadata)
- OggFLAC__stream_encoder_set_metadata(ctx->encoder.ogg.stream, metadata, num_metadata);
-
- /* set callback */
- OggFLAC__stream_encoder_set_write_callback(ctx->encoder.ogg.stream, ogg_stream_encoder_write_callback);
-
- ctx->state.ogg = OggFLAC__stream_encoder_init(ctx->encoder.ogg.stream);
- if (ctx->state.ogg != OggFLAC__STREAM_ENCODER_OK) {
+ FLAC__stream_encoder_set_metadata(ctx->encoder.ogg.stream, metadata, num_metadata);
+
+ ctx->state.ogg = FLAC__stream_encoder_init_ogg_stream(ctx->encoder.ogg.stream,
+ 0,
+ ogg_stream_encoder_write_callback,
+ 0, 0, 0,
+ ctx);
+ if (ctx->state.ogg != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create OggFLAC state (%s)",
- OggFLAC__StreamEncoderStateString[ctx->state.ogg]);
+ FLAC__StreamEncoderStateString[ctx->state.ogg]);
flac_session_close();
return -1;
}
}
else
-#endif /* AU_OGGFLAC */
if (flac_options.seekable) {
- if ((ctx->encoder.flac.s_stream = FLAC__seekable_stream_encoder_new()) == NULL) {
+ /* FLAC SEEKABLE STREAM */
+ if ((ctx->encoder.flac.s_stream = FLAC__stream_encoder_new()) == NULL) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create FLAC stream");
flac_session_close();
return -1;
}
- FLAC__seekable_stream_encoder_set_channels(ctx->encoder.flac.s_stream, nch);
+ FLAC__stream_encoder_set_channels(ctx->encoder.flac.s_stream, nch);
/* 16bps only */
- FLAC__seekable_stream_encoder_set_bits_per_sample(ctx->encoder.flac.s_stream, 16);
+ FLAC__stream_encoder_set_bits_per_sample(ctx->encoder.flac.s_stream, 16);
- FLAC__seekable_stream_encoder_set_verify(ctx->encoder.flac.s_stream, flac_options.verify);
+ FLAC__stream_encoder_set_verify(ctx->encoder.flac.s_stream, flac_options.verify);
if (!FLAC__format_sample_rate_is_valid(dpm.rate)) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "invalid sampling rate %d",
@@ -453,44 +427,40 @@ static int flac_output_open(const char *fname, const char *comment)
flac_session_close();
return -1;
}
- FLAC__seekable_stream_encoder_set_sample_rate(ctx->encoder.flac.s_stream, dpm.rate);
+ FLAC__stream_encoder_set_sample_rate(ctx->encoder.flac.s_stream, dpm.rate);
- FLAC__seekable_stream_encoder_set_qlp_coeff_precision(ctx->encoder.flac.s_stream, flac_options.qlp_coeff_precision);
+ FLAC__stream_encoder_set_qlp_coeff_precision(ctx->encoder.flac.s_stream, flac_options.qlp_coeff_precision);
/* expensive! */
- FLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search(ctx->encoder.flac.s_stream, flac_options.qlp_coeff_precision_search);
+ FLAC__stream_encoder_set_do_qlp_coeff_prec_search(ctx->encoder.flac.s_stream, flac_options.qlp_coeff_precision_search);
if (nch == 2) {
- FLAC__seekable_stream_encoder_set_do_mid_side_stereo(ctx->encoder.flac.s_stream, flac_options.mid_side);
- FLAC__seekable_stream_encoder_set_loose_mid_side_stereo(ctx->encoder.flac.s_stream, flac_options.adaptive_mid_side);
+ FLAC__stream_encoder_set_do_mid_side_stereo(ctx->encoder.flac.s_stream, flac_options.mid_side);
+ FLAC__stream_encoder_set_loose_mid_side_stereo(ctx->encoder.flac.s_stream, flac_options.adaptive_mid_side);
}
- FLAC__seekable_stream_encoder_set_max_lpc_order(ctx->encoder.flac.s_stream, flac_options.max_lpc_order);
- FLAC__seekable_stream_encoder_set_min_residual_partition_order(ctx->encoder.flac.s_stream, flac_options.min_residual_partition_order);
- FLAC__seekable_stream_encoder_set_max_residual_partition_order(ctx->encoder.flac.s_stream, flac_options.max_residual_partition_order);
+ FLAC__stream_encoder_set_max_lpc_order(ctx->encoder.flac.s_stream, flac_options.max_lpc_order);
+ FLAC__stream_encoder_set_min_residual_partition_order(ctx->encoder.flac.s_stream, flac_options.min_residual_partition_order);
+ FLAC__stream_encoder_set_max_residual_partition_order(ctx->encoder.flac.s_stream, flac_options.max_residual_partition_order);
- FLAC__seekable_stream_encoder_set_blocksize(ctx->encoder.flac.s_stream, flac_options.blocksize);
- FLAC__seekable_stream_encoder_set_client_data(ctx->encoder.flac.s_stream, ctx);
+ FLAC__stream_encoder_set_blocksize(ctx->encoder.flac.s_stream, flac_options.blocksize);
if (0 < num_metadata)
- FLAC__seekable_stream_encoder_set_metadata(ctx->encoder.flac.s_stream, metadata, num_metadata);
+ FLAC__stream_encoder_set_metadata(ctx->encoder.flac.s_stream, metadata, num_metadata);
- /* set callback */
-/* FLAC__seekable_stream_encoder_set_metadata_callback(ctx->encoder.flac.s_stream, flac_seekable_stream_encoder_metadata_callback); /* */
-#ifndef __BORLANDC__
- FLAC__stream_encoder_set_metadata_callback(ctx->encoder.flac.s_stream, flac_seekable_stream_encoder_metadata_callback); /* */
-#endif
- FLAC__seekable_stream_encoder_set_write_callback(ctx->encoder.flac.s_stream, flac_seekable_stream_encoder_write_callback);
+ ctx->state.s_flac = FLAC__stream_encoder_init_stream(
+ ctx->encoder.flac.s_stream,
+ flac_stream_encoder_write_callback,
+ 0, 0, 0,
+ ctx);
- ctx->state.s_flac = FLAC__seekable_stream_encoder_init(ctx->encoder.flac.s_stream);
- if (ctx->state.s_flac != FLAC__SEEKABLE_STREAM_ENCODER_OK) {
+ if (ctx->state.s_flac != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create FLAC state (%s)",
- FLAC__SeekableStreamEncoderStateString[ctx->state.s_flac]);
+ FLAC__StreamEncoderStateString[ctx->state.s_flac]);
flac_session_close();
return -1;
}
- }
- else
- {
+ } else {
+ /* NON SEEKABLE STREAM */
if ((ctx->encoder.flac.stream = FLAC__stream_encoder_new()) == NULL) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create FLAC stream");
flac_session_close();
@@ -525,16 +495,16 @@ static int flac_output_open(const char *fname, const char *comment)
FLAC__stream_encoder_set_max_residual_partition_order(ctx->encoder.flac.stream, flac_options.max_residual_partition_order);
FLAC__stream_encoder_set_blocksize(ctx->encoder.flac.stream, flac_options.blocksize);
- FLAC__stream_encoder_set_client_data(ctx->encoder.flac.stream, ctx);
if (0 < num_metadata)
FLAC__stream_encoder_set_metadata(ctx->encoder.flac.stream, metadata, num_metadata);
- /* set callback */
- FLAC__stream_encoder_set_metadata_callback(ctx->encoder.flac.stream, flac_stream_encoder_metadata_callback);
- FLAC__stream_encoder_set_write_callback(ctx->encoder.flac.stream, flac_stream_encoder_write_callback);
-
- ctx->state.flac = FLAC__stream_encoder_init(ctx->encoder.flac.stream);
+ ctx->state.flac = FLAC__stream_encoder_init_stream(ctx->encoder.flac.stream,
+ flac_stream_encoder_write_callback,
+ 0,
+ 0,
+ flac_stream_encoder_metadata_callback,
+ ctx);
if (ctx->state.flac != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot create FLAC state (%s)",
FLAC__StreamEncoderStateString[ctx->state.flac]);
@@ -550,7 +520,6 @@ static int auto_flac_output_open(const char *input_filename, const char *title)
{
char *output_filename;
-#ifdef AU_OGGFLAC
if (flac_options.isogg) {
#ifndef __W32G__
output_filename = create_auto_output_name(input_filename, "ogg", NULL, 0);
@@ -559,7 +528,6 @@ static int auto_flac_output_open(const char *input_filename, const char *title)
#endif
}
else
-#endif /* AU_OGGFLAC */
{
#ifndef __W32G__
output_filename = create_auto_output_name(input_filename, "flac", NULL, 0);
@@ -608,12 +576,10 @@ static int open_output(void)
exclude_enc |= PE_BYTESWAP | PE_24BIT;
dpm.encoding = validate_encoding(dpm.encoding, include_enc, exclude_enc);
-#ifdef AU_OGGFLAC
if (flac_options.isogg) {
ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "*** cannot write back seekpoints when encoding to Ogg yet ***");
ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "*** and stream end will not be written. ***");
}
-#endif
#ifndef __W32G__
if(dpm.name == NULL) {
@@ -638,9 +604,8 @@ static int open_output(void)
return 0;
}
-#ifdef AU_OGGFLAC
static FLAC__StreamEncoderWriteStatus
-ogg_stream_encoder_write_callback(const OggFLAC__StreamEncoder *encoder,
+ogg_stream_encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
unsigned bytes, unsigned samples,
unsigned current_frame, void *client_data)
@@ -654,7 +619,6 @@ ogg_stream_encoder_write_callback(const OggFLAC__StreamEncoder *encoder,
else
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
}
-#endif
static FLAC__StreamEncoderWriteStatus
flac_stream_encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
@@ -675,26 +639,6 @@ static void flac_stream_encoder_metadata_callback(const FLAC__StreamEncoder *enc
void *client_data)
{
}
-static FLAC__StreamEncoderWriteStatus
-flac_seekable_stream_encoder_write_callback(const FLAC__SeekableStreamEncoder *encoder,
- const FLAC__byte buffer[],
- unsigned bytes, unsigned samples,
- unsigned current_frame, void *client_data)
-{
- FLAC_ctx *ctx = (FLAC_ctx *)client_data;
-
- ctx->out_bytes += bytes;
-
- if (write(dpm.fd, buffer, bytes) == bytes)
- return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
- else
- return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
-}
-static void flac_seekable_stream_encoder_metadata_callback(const FLAC__SeekableStreamEncoder *encoder,
- const FLAC__StreamMetadata *metadata,
- void *client_data)
-{
-}
static int output_data(char *buf, int32 nbytes)
{
@@ -723,21 +667,18 @@ static int output_data(char *buf, int32 nbytes)
oggbuf[i] = *s++;
}
-#ifdef AU_OGGFLAC
if (flac_options.isogg) {
- ctx->state.ogg = OggFLAC__stream_encoder_get_state(ctx->encoder.ogg.stream);
- if (ctx->state.ogg != OggFLAC__STREAM_ENCODER_OK) {
- if (ctx->state.ogg == OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR) {
+ ctx->state.ogg = FLAC__stream_encoder_get_state(ctx->encoder.ogg.stream);
+ if (ctx->state.ogg != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "FLAC stream verify error (%s)",
- FLAC__StreamDecoderStateString[OggFLAC__stream_encoder_get_verify_decoder_state(ctx->encoder.ogg.stream)]);
- }
+ FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_verify_decoder_state(ctx->encoder.ogg.stream)]);
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot encode OggFLAC stream (%s)",
- OggFLAC__StreamEncoderStateString[ctx->state.ogg]);
+ FLAC__StreamEncoderStateString[ctx->state.ogg]);
flac_session_close();
return -1;
}
- if (!OggFLAC__stream_encoder_process_interleaved(ctx->encoder.ogg.stream, oggbuf,
+ if (!FLAC__stream_encoder_process_interleaved(ctx->encoder.ogg.stream, oggbuf,
nbytes / nch / 2)) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot encode OggFLAC stream");
flac_session_close();
@@ -745,24 +686,23 @@ static int output_data(char *buf, int32 nbytes)
}
}
else
-#endif /* AU_OGGFLAC */
if (flac_options.seekable) {
- ctx->state.s_flac = FLAC__seekable_stream_encoder_get_state(ctx->encoder.flac.s_stream);
+ ctx->state.s_flac = FLAC__stream_encoder_get_state(ctx->encoder.flac.s_stream);
if (ctx->state.s_flac != FLAC__STREAM_ENCODER_OK) {
if (ctx->state.s_flac == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR |
FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "FLAC stream verify error (%s)",
- FLAC__SeekableStreamDecoderStateString[FLAC__seekable_stream_encoder_get_verify_decoder_state(ctx->encoder.flac.s_stream)]);
+ FLAC__StreamDecoderStateString[FLAC__stream_encoder_get_verify_decoder_state(ctx->encoder.flac.s_stream)]);
}
else {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot encode FLAC stream (%s)",
- FLAC__SeekableStreamEncoderStateString[ctx->state.s_flac]);
+ FLAC__StreamEncoderStateString[ctx->state.s_flac]);
}
flac_session_close();
return -1;
}
- if (!FLAC__seekable_stream_encoder_process_interleaved(ctx->encoder.flac.s_stream, oggbuf,
+ if (!FLAC__stream_encoder_process_interleaved(ctx->encoder.flac.s_stream, oggbuf,
nbytes / nch / 2 )) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "cannot encode FLAC stream");
flac_session_close();
@@ -814,19 +754,17 @@ static void close_output(void)
}
if (flac_options.isogg) {
-#ifdef AU_OGGFLAC
- if ((ctx->state.ogg = OggFLAC__stream_encoder_get_state(ctx->encoder.ogg.stream)) != OggFLAC__STREAM_ENCODER_OK) {
+ if ((ctx->state.ogg = FLAC__stream_encoder_get_state(ctx->encoder.ogg.stream)) != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "OggFLAC stream encoder is invalid (%s)",
- OggFLAC__StreamEncoderStateString[ctx->state.ogg]);
+ FLAC__StreamEncoderStateString[ctx->state.ogg]);
/* fall through */
}
}
else
-#endif /* AU_OGGFLAC */
if (flac_options.seekable) {
- if ((ctx->state.s_flac = FLAC__seekable_stream_encoder_get_state(ctx->encoder.flac.s_stream)) != FLAC__SEEKABLE_STREAM_ENCODER_OK) {
+ if ((ctx->state.s_flac = FLAC__stream_encoder_get_state(ctx->encoder.flac.s_stream)) != FLAC__STREAM_ENCODER_OK) {
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "FLAC stream encoder is invalid (%s)",
- FLAC__SeekableStreamEncoderStateString[ctx->state.s_flac]);
+ FLAC__StreamEncoderStateString[ctx->state.s_flac]);
/* fall through */
}
}
diff --git a/timidity/mod2midi.c b/timidity/mod2midi.c
index 72c0293..2f86cf3 100644
--- a/timidity/mod2midi.c
+++ b/timidity/mod2midi.c
@@ -195,7 +195,8 @@ period2note (int period, int *finetune)
if (period < 14 || period > 13696)
{
- ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "BAD period %d\n", period);
+ ctl->cmsg(CMSG_WARNING, VERB_NOISY, "BAD period %d", period);
+ *finetune = 0;
return -1;
}
@@ -266,11 +267,13 @@ Voice_SetPeriod (UBYTE v, ULONG period)
return;
new_noteon = period2note (ModV[v].period, &bend);
+ if (new_noteon >= 0) {
#ifndef TRACE_SLIDE_NOTES
- bend += (new_noteon - ModV[v].noteon) << 13;
- new_noteon = ModV[v].noteon;
+ bend += (new_noteon - ModV[v].noteon) << 13;
+ new_noteon = ModV[v].noteon;
#endif
- bend = WHEEL_VALUE(bend);
+ bend = WHEEL_VALUE(bend);
+ }
if (ModV[v].noteon != new_noteon)
{
@@ -278,7 +281,7 @@ Voice_SetPeriod (UBYTE v, ULONG period)
if (new_noteon < 0)
{
- ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+ ctl->cmsg(CMSG_WARNING, VERB_NOISY,
"Strange period %d",
ModV[v].period);
return;
@@ -330,13 +333,13 @@ Voice_Play (UBYTE v, SAMPLE * s, ULONG start)
Voice_Stop (v);
new_noteon = period2note (ModV[v].period, &bend);
- bend = WHEEL_VALUE(bend);
if (new_noteon < 0) {
- ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+ ctl->cmsg(CMSG_WARNING, VERB_NOISY,
"Strange period %d",
ModV[v].period);
return;
}
+ bend = WHEEL_VALUE(bend);
ModV[v].noteon = new_noteon;
ModV[v].time = at;
@@ -590,9 +593,13 @@ void load_module_samples (SAMPLE * s, int numsamples, int ntsc)
special_patch[i]->sample = sp =
(Sample *)safe_malloc(sizeof(Sample));
memset(sp, 0, sizeof(Sample));
- strncpy(name, s->samplename, 22);
- name[22] = '\0';
- code_convert(name, NULL, 23, NULL, "ASCII");
+ memset(name, 0, 23 * sizeof(char));
+ if (s->samplename != NULL)
+ {
+ strncpy(name, s->samplename, 22);
+ name[22] = '\0';
+ code_convert(name, NULL, 23, NULL, "ASCII");
+ }
if(name[0] == '\0')
special_patch[i]->name = NULL;
else
diff --git a/timidity/reverb.c b/timidity/reverb.c
index 2bc8dea..a5b4c06 100644
--- a/timidity/reverb.c
+++ b/timidity/reverb.c
@@ -1624,8 +1624,8 @@ static void do_ch_reverb_panning_delay(int32 *buf, int32 count, InfoDelay3 *info
buf[i] += r;
buf[++i] += l;
- if (++index0 == buf_size) {index0 = 0;}
- if (++buf_index == buf_size) {buf_index = 0;}
+ if (index0++ == buf_size) {index0 = 0;}
+ if (buf_index++ == buf_size) {buf_index = 0;}
}
memset(reverb_effect_buffer, 0, sizeof(int32) * count);
info->index[0] = index0;
diff --git a/timidity/tables.c b/timidity/tables.c
index bb37994..9f55f54 100644
--- a/timidity/tables.c
+++ b/timidity/tables.c
@@ -1682,4 +1682,4 @@ float lofi_sampling_freq_table_xg[] =
420.0, 416.0, 412.0, 408.0, 405.0, 401.0, 397.0, 394.0,
390.0, 387.0, 383.0, 380.0, 377.0, 374.0, 371.0, 368.0,
364.0, 361.0, 359.0, 356.0, 353.0, 350.0, 347.0, 345.0,
-};
\ No newline at end of file
+};
diff --git a/timidity/timidity.c b/timidity/timidity.c
index a53a367..e443b4c 100644
--- a/timidity/timidity.c
+++ b/timidity/timidity.c
@@ -40,31 +40,21 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif /* TIME_WITH_SYS_TIME */
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif /* NAVE_SYS_STAT_H */
#include <fcntl.h> /* for open */
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif
-
-#ifndef __bool_true_false_are_defined
-# ifdef bool
-# undef bool
-# endif
-# ifdef ture
-# undef ture
-# endif
-# ifdef false
-# undef false
-# endif
-# define bool int
-# define false ((bool)0)
-# define true (!false)
-# define __bool_true_false_are_defined true
-#endif /* C99 _Bool hack */
-
#ifdef BORLANDC_EXCEPTION
#include <excpt.h>
#endif /* BORLANDC_EXCEPTION */
@@ -311,9 +301,7 @@ static const struct option longopts[] = {
{ "flac-verify", no_argument, NULL, TIM_OPT_FLAC_VERIFY },
{ "flac-padding", required_argument, NULL, TIM_OPT_FLAC_PADDING },
{ "flac-complevel", required_argument, NULL, TIM_OPT_FLAC_COMPLEVEL },
-#ifdef AU_OGGFLAC
{ "oggflac", no_argument, NULL, TIM_OPT_FLAC_OGGFLAC },
-#endif /* AU_OGGFLAC */
#endif /* AU_FLAC */
#ifdef AU_SPEEX
{ "speex-quality", required_argument, NULL, TIM_OPT_SPEEX_QUALITY },
@@ -449,9 +437,7 @@ static inline int parse_opt_output_swab(const char *);
static inline int parse_opt_flac_verify(const char *);
static inline int parse_opt_flac_padding(const char *);
static inline int parse_opt_flac_complevel(const char *);
-#ifdef AU_OGGFLAC
static inline int parse_opt_flac_oggflac(const char *);
-#endif /* AU_OGGFLAC */
#endif /* AU_FLAC */
#ifdef AU_SPEEX
static inline int parse_opt_speex_quality(const char *);
@@ -2789,10 +2775,8 @@ MAIN_INTERFACE int set_tim_opt_long(int c, char *optarg, int index)
return parse_opt_flac_padding(arg);
case TIM_OPT_FLAC_COMPLEVEL:
return parse_opt_flac_complevel(arg);
-#ifdef AU_OGGFLAC
case TIM_OPT_FLAC_OGGFLAC:
return parse_opt_flac_oggflac(arg);
-#endif /* AU_OGGFLAC */
#endif /* AU_FLAC */
#ifdef AU_SPEEX
case TIM_OPT_SPEEX_QUALITY:
@@ -3642,10 +3626,8 @@ static inline int parse_opt_h(const char *arg)
" Write a PADDING block of length n",
" --flac-complevel=n (for Ogg FLAC only)",
" Set compression level n:[0..8]",
-#ifdef AU_OGGFLAC
" --oggflac (for Ogg FLAC only)",
" Output OggFLAC stream (experimental)",
-#endif /* AU_OGGFLAC */
#endif /* AU_FLAC */
#ifdef AU_SPEEX
" --speex-quality=n (for Ogg Speex only)",
@@ -4381,7 +4363,6 @@ static inline int parse_opt_flac_complevel(const char *arg)
return 0;
}
-#ifdef AU_OGGFLAC
extern void flac_set_option_oggflac(int);
static inline int parse_opt_flac_oggflac(const char *arg)
@@ -4389,7 +4370,6 @@ static inline int parse_opt_flac_oggflac(const char *arg)
flac_set_option_oggflac(1);
return 0;
}
-#endif /* AU_OGGFLAC */
#endif /* AU_FLAC */
#ifdef AU_SPEEX
@@ -5466,14 +5446,14 @@ extern int volatile save_playlist_once_before_exit_flag;
static int CoInitializeOK = 0;
#endif
-static inline bool directory_p(const char* path)
+static inline int directory_p(const char* path)
{
#if defined ( IA_W32GUI ) || defined ( IA_W32G_SYN )
return is_directory(path);
#else
struct stat st;
if(stat(path, &st) != -1) return S_ISDIR(st.st_mode);
- return false;
+ return 0;
#endif
}
@@ -5649,11 +5629,11 @@ int main(int argc, char **argv)
}
ctl->cmsg(CMSG_FATAL, VERB_NORMAL,
- "%s: Can't read any configuration file.\nPlease check "
+ "%s: Error reading configuration file.\nPlease check "
"%s or %s", program_name, config1, config2);
#else
ctl->cmsg(CMSG_FATAL, VERB_NORMAL,
- "%s: Can't read any configuration file.\nPlease check "
+ "%s: Error reading configuration file.\nPlease check "
CONFIG_FILE, program_name);
#endif /* __W32__ */
}
diff --git a/timidity/wrd.h b/timidity/wrd.h
index 0815aa7..fd7fbb3 100644
--- a/timidity/wrd.h
+++ b/timidity/wrd.h
@@ -148,6 +148,7 @@ static inline void print_ecmd(char*, int*, int);
#endif
#include <limits.h>
#include "mblock.h"
+#include "common.h"
#include "controls.h"
static inline void print_ecmd(char *cmd, int *args, int narg)
{
diff --git a/timidity/wrd_read.c b/timidity/wrd_read.c
index e7ae7f8..c824f49 100644
--- a/timidity/wrd_read.c
+++ b/timidity/wrd_read.c
@@ -1765,7 +1765,10 @@ static char *wrd_name_string(int cmd)
#ifdef ENABLE_SHERRY
/*******************************************************************************/
+#if 0
+/* for mac only */
#pragma mark -
+#endif
static int sherry_started; /* 0 - before start command 0x01*/
/* 1 - after start command 0x01*/
|