diff --git a/Makefile b/Makefile index 3e99959..dfe4a54 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CFLAGS = -g -DUP=0 -DDN=1 -D_GNU_SOURCE=1 -W -Wall -O3 -std=c99 -ffast-math -fsingle-precision-constant $(shell sdl-config --cflags) +CFLAGS = -g -DUP=1 -DDN=1 -D_GNU_SOURCE=1 -W -Wall -O3 -std=c99 -ffast-math -fsingle-precision-constant $(shell sdl-config --cflags) LDFLAGS = -lm -lasound $(shell sdl-config --libs) all: encode decode debug diff --git a/README b/README index e9d723e..8c69d7d 100644 --- a/README +++ b/README @@ -26,7 +26,7 @@ You can find a lot more about DDC's and FM demodulation on the Internet. I Suggest finding and reading the enlightening "Virtual Radios" Paper of Vanu Bose, Michael Ismert, Matt Welborn, and John Guttag. You should also look at GNU Radio: http://gnuradio.org/ and at the invaluable information at dspGuru: http://www.dspguru.com/ -smpte.ppm is converted from http://en.wikipedia.org/wiki/File:SMPTE_Color_Bars.svg +smpte.ppm is converted from http://en.wikipedia.org/wiki/File:SMPTE_Color_Bars.svg compile everything: # make diff --git a/alsa.c b/alsa.c index d0e6b19..788f003 100644 --- a/alsa.c +++ b/alsa.c @@ -8,7 +8,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include -#include +#include #include "alsa.h" struct alsa { @@ -96,14 +96,14 @@ int open_alsa_read(struct pcm **p, char *name) free(alsa); return 0; } - + if (snd_pcm_hw_params_any(pcm, params) < 0) { fprintf(stderr, "Can not configure this PCM device.\n"); snd_pcm_close(alsa->pcm); free(alsa); return 0; } - + if (snd_pcm_hw_params_set_access(pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { fprintf(stderr, "Error setting access.\n"); snd_pcm_close(alsa->pcm); @@ -172,14 +172,14 @@ int open_alsa_write(struct pcm **p, char *name, int rate, int channels, float se free(alsa); return 0; } - + if (snd_pcm_hw_params_any(pcm, params) < 0) { fprintf(stderr, "Can not configure this PCM device.\n"); snd_pcm_close(alsa->pcm); free(alsa); return 0; } - + if (snd_pcm_hw_params_set_access(pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { fprintf(stderr, "Error setting access.\n"); snd_pcm_close(alsa->pcm); diff --git a/ddc.c b/ddc.c index b9513f1..643b779 100644 --- a/ddc.c +++ b/ddc.c @@ -5,7 +5,7 @@ To the extent possible under law, the author(s) have dedicated all copyright and You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see . */ -#include +#include #include #include #include "window.h" diff --git a/debug.c b/debug.c index 9518a94..e581fac 100644 --- a/debug.c +++ b/debug.c @@ -10,7 +10,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include -#include +#include #include #include "mmap_file.h" #include "pcm.h" diff --git a/decode.c b/decode.c index abcd69b..79528b9 100644 --- a/decode.c +++ b/decode.c @@ -10,7 +10,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include -#include +#include #include #include "pcm.h" #include "ddc.h" diff --git a/encode.c b/encode.c index 5991da1..f56f857 100644 --- a/encode.c +++ b/encode.c @@ -10,7 +10,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include -#include +#include #include #include "yuv.h" #include "utils.h" @@ -195,7 +195,7 @@ int main(int argc, char **argv) } while (add_sample(0.0)); - + close_pcm(pcm); close_img(img); return 0; diff --git a/mmap_file.c b/mmap_file.c index 4f5c360..1a7b548 100644 --- a/mmap_file.c +++ b/mmap_file.c @@ -39,12 +39,12 @@ int mmap_file_ro(void **p, char *name, size_t *size) if (*p == MAP_FAILED) { perror("mmap"); close(fd); - return 0; + return 0; } if (close(fd) == -1) { perror ("close"); - return 0; + return 0; } *size = sb.st_size; return 1; @@ -87,12 +87,12 @@ int mmap_file_rw(void **p, char *name, size_t size) if (*p == MAP_FAILED) { perror("mmap"); close(fd); - return 0; + return 0; } if (close(fd) == -1) { perror ("close"); - return 0; + return 0; } return 1; }