• R/O
  • HTTP
  • SSH
  • HTTPS

cinnamon: Commit

Cinnamon audio library


Commit MetaInfo

Revision3f9332a045583b7c9067a6a24a8b56c625f451d6 (tree)
Zeit2019-11-15 17:19:52
AutorAlaskanEmily <emily@alas...>
CommiterAlaskanEmily

Log Message

Completed OSS backend

Ändern Zusammenfassung

Diff

--- a/src/common/cin_convert_core.inc
+++ b/src/common/cin_convert_core.inc
@@ -29,7 +29,25 @@
2929 CIN_DSP_CONVERT_SAMPLE_INT_TO_INT(COMMON_TYPE, OUT_TYPE, X)
3030 #endif
3131
32-static void CIN_DSP_CONVERT_NAME (
32+/* Used in the stereo to mono specialization. */
33+#define CIN_DSP_STEREO_TO_MONO(IN_PTR, COMMON_VALUE, DEST_PTR) do{ \
34+ const IN_TYPE *const STM_in_ptr = (IN_PTR); \
35+ const IN_TYPE STM_in_sample0 = in[0]; \
36+ const IN_TYPE STM_in_sample1 = in[1]; \
37+ const COMMON_TYPE STM_common_sample0 = \
38+ CIN_DSP_CONVERT_SAMPLE_IN_TO_COMMON(STM_in_sample0); \
39+ const COMMON_TYPE STM_common_sample1 = \
40+ CIN_DSP_CONVERT_SAMPLE_IN_TO_COMMON(STM_in_sample1); \
41+ const COMMON_TYPE STM_common_value = (COMMON_VALUE) = \
42+ (STM_common_sample0 / (COMMON_TYPE)2) + \
43+ (STM_common_sample1 / (COMMON_TYPE)2); \
44+ (void)sizeof((COMMON_VALUE)); \
45+ (DEST_PTR)[0] = \
46+ CIN_DSP_CONVERT_SAMPLE_COMMON_TO_OUT(STM_common_value); \
47+ } while(0)
48+
49+
50+static unsigned CIN_DSP_CONVERT_NAME (
3351 const unsigned num_in_frames,
3452 const IN_TYPE *in,
3553 OUT_TYPE *out,
@@ -45,10 +63,14 @@ static void CIN_DSP_CONVERT_NAME (
4563 const ldiv_t rate = ldiv(out_sample_rate, in_sample_rate);
4664 int at = 0;
4765 unsigned i, channel;
66+ /* Used for the return value */
67+ const unsigned char *const original_out = (unsigned char*)out;
68+
69+ unsigned out_frames = 0;
4870
4971 for(i = 0; i < num_in_frames; i++){
50- unsigned out_frames = 0;
5172
73+ out_frames = 0;
5274 at -= rate.rem;
5375 if(at < 0){
5476 at += in_sample_rate;
@@ -61,7 +83,14 @@ static void CIN_DSP_CONVERT_NAME (
6183 out_frames += rate.quot;
6284 if(out_frames != 0){
6385
64- {
86+ /* Special case for stereo -> mono. Ideally this would NOT be
87+ * checked inside the loop :(
88+ */
89+ if(in_num_channels == 2 && out_num_channels == 1){
90+ COMMON_TYPE unused;
91+ CIN_DSP_STEREO_TO_MONO(in, unused, out);
92+ }
93+ else{
6594 /* Hold on to the final channel we processed, so that we can
6695 * paste it over all the remaining channels.
6796 */
@@ -91,10 +120,45 @@ static void CIN_DSP_CONVERT_NAME (
91120 in += in_num_channels;
92121
93122 out_frames--;
94- if(out_frames != 0){
123+
124+ if(out_frames != 0 && (i + 1) < num_in_frames){
95125 COMMON_TYPE common_step, common_sample_begin;
126+
127+ /* Special case for stereo -> mono. Ideally this would NOT be
128+ * checked inside the loop :(
129+ */
130+ if(in_num_channels == 2 && out_num_channels == 1){
131+ unsigned frame = 0;
132+ /* Get the input samples we will lerp between. */
133+ COMMON_TYPE common_sample, common_sample_end;
134+ OUT_TYPE unused;
135+ CIN_DSP_STEREO_TO_MONO(in+0, common_sample, &unused);
136+ CIN_DSP_STEREO_TO_MONO(in+2, common_sample_end, &unused);
137+ /* This is slightly lossy with integer common types and
138+ * small steps. */
139+ common_step =
140+ (common_sample_end - common_sample) /
141+ ((COMMON_TYPE)out_frames);
142+
143+ while(1){
144+ out[0] = common_sample;
145+ if(++frame == out_frames)
146+ break;
147+ common_sample += common_step;
148+ out++;
149+ }
150+
151+ /* This skips the below loops in a way that plays well with
152+ * GCC, clang, and MSVC's optimizers.
153+ */
154+ channel = out_num_channels;
155+ }
156+ else{
157+ channel = 0;
158+ }
159+
96160 /* Process per-channel, since we need to do lerps. */
97- for(channel = 0; channel < num_common_channels; channel++){
161+ for(;channel < num_common_channels; channel++){
98162 /* Get the input samples we will lerp between. */
99163 const IN_TYPE in_sample_start = in[channel];
100164 const IN_TYPE in_sample_end =
@@ -110,7 +174,8 @@ static void CIN_DSP_CONVERT_NAME (
110174 const COMMON_TYPE common_sample_end =
111175 CIN_DSP_CONVERT_SAMPLE_IN_TO_COMMON(in_sample_end);
112176
113- OUT_TYPE *dest = out + channel; /* Will be advanced on each frame */
177+ /* Will be advanced on each frame */
178+ OUT_TYPE *dest = out + channel;
114179 unsigned frame = 0;
115180
116181 /* This is slightly lossy with integer common types and
@@ -128,9 +193,11 @@ static void CIN_DSP_CONVERT_NAME (
128193 }
129194 }
130195
131- /* Repeat just the stepping for any remaining channels. */
196+ /* Copy the last written channel over all remaining channels.
197+ */
132198 for(; channel < out_num_channels; channel++){
133- OUT_TYPE *dest = out + channel; /* Will be advanced on each frame */
199+ /* Will be advanced on each frame */
200+ OUT_TYPE *dest = out + channel;
134201 COMMON_TYPE common_sample = common_sample_begin;
135202 unsigned frame = 0;
136203 while(1){
@@ -143,12 +210,15 @@ static void CIN_DSP_CONVERT_NAME (
143210 }
144211
145212 in += in_num_channels;
146- out += out_num_channels * (out_frames + 1);
213+ out += out_num_channels * out_frames;
147214 }
148215 }
149216 }
217+
218+ return ((unsigned char*)out) - original_out;
150219 }
151220
221+#undef CIN_DSP_STEREO_TO_MONO
152222 #undef COMMON_TYPE
153223 #undef OUT_TYPE
154224 #undef IN_TYPE
--- a/src/common/cin_dsp.c
+++ b/src/common/cin_dsp.c
@@ -97,7 +97,10 @@ static void Cin_DSP_Mix ## TYPE(unsigned num_bytes, \
9797 \
9898 switch(num_streams){ \
9999 case 0: return; \
100- case 1: memmove(out, *in, num_bytes); return; \
100+ case 1: \
101+ if(*in != out) \
102+ memmove(out, *in, num_bytes); \
103+ return; \
101104 default: \
102105 case 4: data[3] = in[3]; \
103106 case 3: data[2] = in[2]; \
@@ -475,7 +478,7 @@ unsigned Cin_DSP_Convert(unsigned num_bytes,
475478 void *out_data){
476479
477480 #define CIN_DSP_CONVERT_CALL(IN_TYPE, OUT_TYPE) \
478- (num_bytes / sizeof(IN_TYPE))/in_format->num_channels, \
481+ (num_bytes / (sizeof(IN_TYPE) * in_format->num_channels)), \
479482 (const IN_TYPE *)in_data, \
480483 (OUT_TYPE *)out_data, \
481484 in_format->sample_rate, \
@@ -486,39 +489,39 @@ unsigned Cin_DSP_Convert(unsigned num_bytes,
486489 #define CIN_DSP_CONVERT_1(IN_TYPE) \
487490 switch(out_format->sample_format){ \
488491 case CIN_DSP_FORMAT_S8: \
489- Cin_DSP_Convert ## IN_TYPE ## S8( \
490- CIN_DSP_CONVERT_CALL(IN_TYPE, S8) ); break; \
492+ return Cin_DSP_Convert ## IN_TYPE ## S8( \
493+ CIN_DSP_CONVERT_CALL(IN_TYPE, S8) ); \
491494 case CIN_DSP_FORMAT_S16: \
492- Cin_DSP_Convert ## IN_TYPE ## S16( \
493- CIN_DSP_CONVERT_CALL(IN_TYPE, S16) ); break; \
495+ return Cin_DSP_Convert ## IN_TYPE ## S16( \
496+ CIN_DSP_CONVERT_CALL(IN_TYPE, S16) ); \
494497 case CIN_DSP_FORMAT_S32: \
495- Cin_DSP_Convert ## IN_TYPE ## S32( \
496- CIN_DSP_CONVERT_CALL(IN_TYPE, S32) ); break; \
498+ return Cin_DSP_Convert ## IN_TYPE ## S32( \
499+ CIN_DSP_CONVERT_CALL(IN_TYPE, S32) ); \
497500 case CIN_DSP_FORMAT_FLOAT32: \
498- Cin_DSP_Convert ## IN_TYPE ## Float32( \
499- CIN_DSP_CONVERT_CALL(IN_TYPE, Float32) ); break; \
501+ return Cin_DSP_Convert ## IN_TYPE ## Float32( \
502+ CIN_DSP_CONVERT_CALL(IN_TYPE, Float32) ); \
500503 case CIN_DSP_FORMAT_FLOAT64: \
501- Cin_DSP_Convert ## IN_TYPE ## Float64( \
502- CIN_DSP_CONVERT_CALL(IN_TYPE, Float64) ); break; \
504+ return Cin_DSP_Convert ## IN_TYPE ## Float64( \
505+ CIN_DSP_CONVERT_CALL(IN_TYPE, Float64) ); \
503506 default: \
504507 return 0; \
505508 }
506509
507510 switch(in_format->sample_format){
508511 case CIN_DSP_FORMAT_S8:
509- CIN_DSP_CONVERT_1(S8); break;
512+ CIN_DSP_CONVERT_1(S8);
510513
511514 case CIN_DSP_FORMAT_S16:
512- CIN_DSP_CONVERT_1(S16); break;
515+ CIN_DSP_CONVERT_1(S16);
513516
514517 case CIN_DSP_FORMAT_S32:
515- CIN_DSP_CONVERT_1(S32); break;
518+ CIN_DSP_CONVERT_1(S32);
516519
517520 case CIN_DSP_FORMAT_FLOAT32:
518- CIN_DSP_CONVERT_1(Float32); break;
521+ CIN_DSP_CONVERT_1(Float32);
519522
520523 case CIN_DSP_FORMAT_FLOAT64:
521- CIN_DSP_CONVERT_1(Float64); break;
524+ CIN_DSP_CONVERT_1(Float64);
522525
523526 default:
524527 return 0;
--- a/src/common/cin_dsp.h
+++ b/src/common/cin_dsp.h
@@ -416,7 +416,7 @@ CIN_DSP_CALL(unsigned) Cin_DSP_ConversionSize(unsigned num_bytes,
416416 * @param in_data Input data to convert
417417 * @param out_format Format to convert to
418418 * @param out_data Destination buffer.
419- * @return Number of bytes converted.
419+ * @return Number of bytes converted, or 0 on error.
420420 *
421421 * @sa Cin_DSP_ConversionSize
422422 */
@@ -430,6 +430,9 @@ CIN_DSP_CALL(unsigned) Cin_DSP_Convert(unsigned in_bytes,
430430 /**
431431 * @brief Mixes multiple audio buffers of the same format and size.
432432 *
433+ * Mixing can re-use an input buffer, although if out_data appears in the
434+ * in_data array it MUST be the first element and must only appear once.
435+ *
433436 * @param num_bytes Number of bytes of data to consume
434437 * @param format Format of data to consume
435438 * @param num_streams Number of streams in @p in_data
--- a/src/common/cin_mixer_sound.h
+++ b/src/common/cin_mixer_sound.h
@@ -73,6 +73,7 @@ CIN_PRIVATE(void) Cin_ResampleSound(const struct Cin_Loader *from,
7373 * You must include cin_soft_loader.h and cin_dsp.h to use this.
7474 * This is only a macro to allow us to avoid adding an additional library just
7575 * to glue together SoftLoader and MixerSound.
76+ * TODO: This just swallows errors!
7677 */
7778 #define CIN_MIXER_SOUND_FROM_SOFT_LOADER(LD, FMT, OUT, ALLOCATOR) do{ \
7879 const struct Cin_Loader *const CIN_MIXER_loader = (LD);\
@@ -95,6 +96,7 @@ CIN_PRIVATE(void) Cin_ResampleSound(const struct Cin_Loader *from,
9596 struct Cin_MixerSound *const CIN_MIXER_out = \
9697 ALLOCATOR(sizeof(struct Cin_MixerSound) + CIN_MIXER_out_size); \
9798 (OUT) = CIN_MIXER_out; \
99+ CIN_MIXER_out->byte_len = CIN_MIXER_out_size; \
98100 for(CIN_MIXER_loader_data = CIN_MIXER_loader->first; \
99101 CIN_MIXER_loader_data != NULL; \
100102 CIN_MIXER_loader_data = CIN_MIXER_loader_data->next){ \
@@ -105,6 +107,7 @@ CIN_PRIVATE(void) Cin_ResampleSound(const struct Cin_Loader *from,
105107 CIN_SOFT_LOADER_DATA(CIN_MIXER_loader_data), \
106108 CIN_MIXER_out_format, \
107109 CIN_MIXER_SOUND_PCM(CIN_MIXER_out) + CIN_MIXER_i); \
110+ if(CIN_MIXER_added == 0) break; \
108111 CIN_MIXER_i += CIN_MIXER_added; \
109112 } \
110113 } \
--- a/src/common/makefile
+++ b/src/common/makefile
@@ -22,5 +22,5 @@ libcin_mixer.a: $(MIXER_OBJECTS)
2222 cin_mixer_sound.o: cin_mixer_sound.c cin_mixer_sound.h cin_dsp.h $(ROOTDIR)/cin_export.h $(ROOTDIR)/cin_format.h
2323 $(CC) $(CFLAGS) -I"$(ROOTDIR)" -c cin_mixer_sound.c -o cin_mixer_sound.o
2424
25-cin_dsp.o: cin_dsp.c cin_dsp.h
25+cin_dsp.o: cin_dsp.c cin_dsp.h cin_convert_core.inc
2626 $(CC) $(CFLAGS) -c cin_dsp.c -o cin_dsp.o
--- a/src/oss/cin_oss.c
+++ b/src/oss/cin_oss.c
@@ -20,6 +20,7 @@
2020
2121 #include <assert.h>
2222 #include <stdlib.h>
23+#include <stdio.h>
2324 #include <string.h>
2425 #include <unistd.h>
2526 #include <time.h>
@@ -40,6 +41,8 @@ void *Cin_OSS_ThreadFunc(void *v){
4041 const int bytes_per_frame = CIN_FORMAT_BYTES_PER_SAMPLE(format) * num_channels;
4142 const int buffer_size = (bytes_per_frame * rate) / 10;
4243
44+ const void *input_data[CIN_OSS_SOUND_CHANNELS+1];
45+
4346 void *const buffer = malloc(buffer_size);
4447
4548 CIN_DSP_NEW_STACK_FMT_STRUCT(dsp_fmt);
@@ -73,11 +76,75 @@ iter:
7376 }
7477
7578 if(active_channels != 0){
76- Cin_DSP_Mix(buffer_size, dsp_fmt, active_channels, channels, buffer);
79+ /* First, mix any finalizing channels (channels without enough data to
80+ * fill the buffer)
81+ */
7782 i = 0;
83+
84+ /* Find the first channel which is being finalized, if any. */
7885 do{
79- channels[i]->position += buffer_size;
86+ if(channels[i]->position + buffer_size >
87+ channels[i]->byte_len){
88+ break;
89+ }
8090 }while(++i < active_channels);
91+
92+ /* Check this only if we broke early (found a finalizing channel) */
93+ if(i != active_channels){
94+ input_data[0] = buffer;
95+
96+ /* Very fortunately, zero-init is ALSO zero in float and double */
97+ memset(buffer, 0, buffer_size);
98+
99+ do{
100+ struct Cin_MixerSound *const snd = channels[i];
101+ const int remaining_length =
102+ snd->byte_len - snd->position;
103+ if(remaining_length < buffer_size){
104+ input_data[1] = CIN_MIXER_SOUND_PCM(channels[i]) +
105+ snd->position;
106+
107+ Cin_DSP_Mix(remaining_length,
108+ dsp_fmt,
109+ 2,
110+ input_data,
111+ buffer);
112+
113+ /* Pull out this channel by simply swapping in the final
114+ * element. This makes removing any element constant time,
115+ * and is acceptable because the order of the channels is
116+ * not important.
117+ */
118+ channels[i] = channels[--active_channels];
119+ }
120+ else{
121+ i++;
122+ }
123+ }while(i < active_channels);
124+
125+ /* Set i = 1, so that we do not place anything over the input_data
126+ * element containing our mixed finalizing sounds.
127+ */
128+ i = 1;
129+ }
130+ else{
131+ /* No finalizing sounds, so no extra inputs. */
132+ i = 0;
133+ }
134+
135+ /* No need to remix if all channels were finalizing. */
136+ if(active_channels != 0){
137+ register unsigned source_i = 0;
138+ do{
139+ input_data[i++] = CIN_MIXER_SOUND_PCM(channels[source_i]) +
140+ channels[source_i]->position;
141+ channels[source_i]->position += buffer_size;
142+ }while(++source_i < active_channels);
143+ }
144+ /* i contains the final element placed into input_data, regardless
145+ * of how many were from the input channels.
146+ */
147+ Cin_DSP_Mix(buffer_size, dsp_fmt, i, input_data, buffer);
81148 }
82149 else{
83150 memset(buffer, 0, buffer_size);
--- a/src/oss/cin_oss_driver.c
+++ b/src/oss/cin_oss_driver.c
@@ -7,6 +7,7 @@
77
88 #include "cin_oss_driver.h"
99 #include "cin_oss_sound.h"
10+#include "cin_mixer_sound.h"
1011 #include "cin_oss.h"
1112 #include "cinnamon.h"
1213
@@ -119,7 +120,7 @@ CIN_PRIVATE(int) Cin_OSS_NewID(struct Cin_Driver *drv){
119120 CIN_PRIVATE(int) Cin_OSS_PushCommand(struct Cin_Driver *drv,
120121 struct Cin_OSS_Command *cmd){
121122 TAILQ_INSERT_TAIL(&drv->commands, cmd, entries);
122- return 1;
123+ return 0;
123124 }
124125
125126 /*****************************************************************************/
@@ -203,21 +204,30 @@ CIN_PRIVATE(int) Cin_OSS_ProcessCommands(struct Cin_Driver *drv){
203204
204205 switch(command){
205206 case CIN_OSS_INSERT:
206- puts("CIN_OSS_INSERT");
207+ /* puts("CIN_OSS_INSERT"); */
207208 SLIST_INSERT_HEAD(&drv->sounds, sound, entries);
208209 break;
209210 case CIN_OSS_DELETE:
210- puts("CIN_OSS_DELETE");
211+ /* puts("CIN_OSS_DELETE"); */
211212 if(prev == NULL)
212213 SLIST_REMOVE_HEAD(&drv->sounds, entries);
213214 else
215+ /* When compiling on Linux with OSS emulation, we need to
216+ * deal with not having this macro. */
217+#ifndef SLIST_REMOVE_AFTER
218+ SLIST_REMOVE(&drv->sounds,
219+ SLIST_NEXT(prev, entries),
220+ Cin_OSS_Sound,
221+ entries);
222+#else
214223 SLIST_REMOVE_AFTER(prev, entries);
224+#endif
215225 /* We want to stop any playing instances of this sound. */
216226
217227 /* FALLTHROUGH */
218228 case CIN_OSS_STOP:
219- if(command == CIN_OSS_STOP)
220- puts("CIN_OSS_STOP");
229+ /* if(command == CIN_OSS_STOP)
230+ puts("CIN_OSS_STOP"); */
221231 for(i = 0; i < CIN_OSS_SOUND_CHANNELS; i++){
222232 if(drv->channels[i] == sound->snd){
223233 drv->channels[i] = NULL;
@@ -225,10 +235,25 @@ CIN_PRIVATE(int) Cin_OSS_ProcessCommands(struct Cin_Driver *drv){
225235 }
226236 break;
227237 case CIN_OSS_PLAY:
228- puts("CIN_OSS_PLAY");
238+ /* puts("CIN_OSS_PLAY"); */
239+
240+ /* Check if the sound is already playing, and do nothing
241+ * if it is.
242+ */
243+ for(i = 0; i < CIN_OSS_SOUND_CHANNELS; i++){
244+ if(drv->channels[i] == sound->snd){
245+ sound = NULL;
246+ /* Found. */
247+ break;
248+ }
249+ }
250+ if(sound == NULL)
251+ break;
252+
229253 for(i = 0; i < CIN_OSS_SOUND_CHANNELS; i++){
230254 if(drv->channels[i] == NULL){
231255 drv->channels[i] = sound->snd;
256+ drv->channels[i]->position = 0;
232257 break;
233258 }
234259 }
@@ -239,7 +264,7 @@ CIN_PRIVATE(int) Cin_OSS_ProcessCommands(struct Cin_Driver *drv){
239264 */
240265 break;
241266 case CIN_OSS_QUIT:
242- puts("CIN_OSS_QUIT");
267+ /* puts("CIN_OSS_QUIT"); */
243268 /* Keep going so that we at least drain the queue. */
244269 val = 1;
245270 break;
@@ -366,12 +391,12 @@ enum Cin_DriverError Cin_CreateDriver(struct Cin_Driver *drv){
366391
367392 drv->rate = val;
368393
369- /* Set the buffer size. */
394+ /* Set the buffer size.
370395 val = 0x0004000B;
371396 if(ioctl(dev, SNDCTL_DSP_SETFRAGMENT, &val) == -1){
372397 ret = Cin_eDriverFailure;
373398 goto fail_device;
374- }
399+ } */
375400 }
376401
377402 {
@@ -401,7 +426,7 @@ void Cin_DestroyDriver(struct Cin_Driver *drv){
401426 Cin_OSS_PushCommand(drv, quit);
402427 {
403428 void *unused;
404- pthread_join(&drv->thread, &unused);
429+ pthread_join(drv->thread, &unused);
405430 }
406431 /* Finalize the driver. */
407432 close(drv->dev);
--- a/src/oss/cin_oss_sound.c
+++ b/src/oss/cin_oss_sound.c
@@ -26,16 +26,22 @@ static enum Cin_SoundError cin_sound_command(struct Cin_Sound *snd, int type){
2626 struct Cin_OSS_Command *cmd = Cin_OSS_NewCommand(snd->sound_id, type);
2727
2828 if(Cin_OSS_Lock(snd->drv) != 0){
29+ assert(!"Could not lock");
2930 return Cin_eSoundFailure;
3031 }
3132
32- if(Cin_OSS_PushCommand(snd->drv, cmd) != 0)
33+ if(Cin_OSS_PushCommand(snd->drv, cmd) != 0){
34+ assert(!"Could not push command");
3335 ret = Cin_eSoundFailure;
34-
35- if(Cin_OSS_Unlock(snd->drv) != 0)
36+ }
37+
38+ if(Cin_OSS_Unlock(snd->drv) != 0){
39+ assert(!"Could not unlock");
3640 return Cin_eSoundFailure;
37- else
41+ }
42+ else{
3843 return ret;
44+ }
3945 }
4046
4147 /*****************************************************************************/
--- a/src/oss/makefile
+++ b/src/oss/makefile
@@ -9,14 +9,14 @@ CIN_COMMONLIB=$(ROOTDIR)/common/libcin_common.a
99 CIN_MIXERLIB=$(ROOTDIR)/common/libcin_mixer.a
1010
1111 libcin_oss_x.a: $(OBJECTS)
12- if [[ -f libcin_oss_x2.a ]] ; then rm libcin_oss_x2.a ; fi
12+ if [ -f libcin_oss_x2.a ] ; then rm libcin_oss_x2.a ; fi
1313 $(AR) rc libcin_oss_x2.a $(OBJECTS)
1414 $(RANLIB) libcin_oss_x2.a
1515 mv libcin_oss_x2.a libcin_oss_x.a
1616
1717 libcin_oss.a: $(CIN_COMMONLIB) $(CIN_MIXERLIB) libcin_oss_x.a
18- if [[ -f libcin_oss2.a ]] ; then rm libcin_oss2.a ; fi
19- echo $$'create libcin_oss2.a\naddlib libcin_oss_x.a\naddlib $(CIN_COMMONLIB)\naddlib $(CIN_MIXERLIB)\nsave\nend\n' | $(AR) M
18+ if [ -f libcin_oss2.a ] ; then rm libcin_oss2.a ; fi
19+ echo 'create libcin_oss2.a\naddlib libcin_oss_x.a\naddlib $(CIN_COMMONLIB)\naddlib $(CIN_MIXERLIB)\nsave\nend\n' | $(AR) M
2020 $(RANLIB) libcin_oss2.a
2121 mv libcin_oss2.a libcin_oss.a
2222
@@ -26,7 +26,7 @@ cin_oss.o: cin_oss.c cin_oss.h cin_oss_driver.h cin_oss_sound.h $(COMMONHEADERS)
2626 $(CC) $(CFLAGS) -I"$(ROOTDIR)" -I"$(ROOTDIR)/common" -c cin_oss.c -o cin_oss.o
2727
2828 cin_oss_driver.o: cin_oss_driver.c cin_oss_driver.h cin_oss.h $(COMMONHEADERS)
29- $(CC) $(CFLAGS) -I"$(ROOTDIR)" -c cin_oss_driver.c -o cin_oss_driver.o
29+ $(CC) $(CFLAGS) -I"$(ROOTDIR)" -I"$(ROOTDIR)/common" -c cin_oss_driver.c -o cin_oss_driver.o
3030
3131 cin_oss_sound.o: cin_oss_sound.c cin_oss.h $(COMMONHEADERS) ../common/cin_soft_loader.h ../common/cin_mixer_sound.h
3232 $(CC) $(CFLAGS) -I"$(ROOTDIR)" -I"$(ROOTDIR)/common" -c cin_oss_sound.c -o cin_oss_sound.o
Show on old repository browser