shithub: opus-tools

Download patch

ref: e186a8512f9372f3cd358547a0d6d9edc0e4522f
parent: 69b8e72571ca9d046662b73aae7f79a2c7a7a4a3
author: Gregory Maxwell <greg@xiph.org>
date: Wed May 16 12:30:08 EDT 2012

Include <opus.h> instead of <opus/opus.h> for compatibility with multiple header installs.

--- /dev/null
+++ b/Makefile.unix
@@ -1,0 +1,17 @@
+#CC=gcc
+CFLAGS:=-DHAVE_SYS_SOUNDCARD_H -O2 -g -c -Wall -Wextra -DHAVE_GETOPT_H -DEXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT $(CFLAGS)
+INCLUDES=-I../opus/include
+
+all: opusenc opusdec
+
+.c.o:
+	$(CC) $(CFLAGS) $(INCLUDES) $< -o $@
+
+opusenc: src/opus_header.o src/opusenc.o src/resample.o src/audio-in.o src/diag_range.o
+	$(CC) $(LDFLAGS) src/opus_header.o src/audio-in.o src/diag_range.o src/opusenc.o src/resample.o -o opusenc ../opus/.libs/libopus.a -lm -logg
+
+opusdec: src/opus_header.o src/wav_io.o src/wave_out.o src/opusdec.o src/resample.o src/diag_range.o
+	$(CC) $(LDFLAGS) src/wave_out.o src/opus_header.o src/wav_io.o src/diag_range.o src/opusdec.o src/resample.o -o opusdec ../opus/.libs/libopus.a -lm -logg
+
+clean:
+	rm -f src/*.o opusenc opusdec
--- a/src/Makefile
+++ /dev/null
@@ -1,17 +1,0 @@
-#CC=gcc
-CFLAGS:=-DHAVE_SYS_SOUNDCARD_H -O2 -g -c -Wall -Wextra -DHAVE_GETOPT_H -DEXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT $(CFLAGS)
-INCLUDES=-I../../opus/include
-
-all: opusenc opusdec
-
-.c.o:
-	$(CC) $(CFLAGS) $(INCLUDES) $< -o $@
-
-opusenc: opus_header.o opusenc.o resample.o audio-in.o diag_range.o
-	$(CC) $(LDFLAGS) opus_header.o audio-in.o diag_range.o opusenc.o resample.o -o opusenc ../../opus/.libs/libopus.a -lm -logg
-
-opusdec: opus_header.o wav_io.o wave_out.o opusdec.o resample.o diag_range.o
-	$(CC) $(LDFLAGS) wave_out.o opus_header.o wav_io.o diag_range.o opusdec.o resample.o -o opusdec ../../opus/.libs/libopus.a -lm -logg
-
-clean:
-	rm -f *.o opusenc opusdec
--- a/src/diag_range.c
+++ b/src/diag_range.c
@@ -32,7 +32,7 @@
 #endif
 
 #include <stdio.h>
-#include <opus/opus.h>
+#include <opus.h>
 #include "diag_range.h"
 
 /*This is some non-exported code copied wholesale from libopus.
--- a/src/opus_header.h
+++ b/src/opus_header.h
@@ -1,7 +1,7 @@
 #ifndef OPUS_HEADER_H
 #define OPUS_HEADER_H
 
-#include <opus/opus_types.h>
+#include <opus_types.h>
 
 typedef struct {
    int version;
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -45,8 +45,8 @@
 #include <limits.h>
 #include <string.h>
 
-#include <opus/opus.h>
-#include <opus/opus_multistream.h>
+#include <opus.h>
+#include <opus_multistream.h>
 #include <ogg/ogg.h>
 
 #if defined WIN32 || defined _WIN32
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -43,8 +43,8 @@
 #define snprintf _snprintf
 #endif
 
-#include <opus/opus.h>
-#include <opus/opus_multistream.h>
+#include <opus.h>
+#include <opus_multistream.h>
 #include <ogg/ogg.h>
 #include "wav_io.h"
 
--- a/src/wav_io.c
+++ b/src/wav_io.c
@@ -32,7 +32,6 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <opus/opus_types.h>
 #include "wav_io.h"
 
 void write_wav_header(FILE *file, int rate, int channels)
--- a/src/wav_io.h
+++ b/src/wav_io.h
@@ -29,7 +29,7 @@
 #define WAV_IO_H
 
 #include <stdio.h>
-#include <opus/opus_types.h>
+#include <opus_types.h>
 
 #if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
 #define le_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8))