summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile2
-rw-r--r--src/video_decode.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index b5a6901..43087cb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,7 +4,7 @@ LIBAV_DECODE_FLAGS=`pkg-config --libs --cflags libavformat libavcodec libavutil
all: advtime decode_frame frame_to_pgm
advtime: advtime.c video_decode.c
- gcc $(CFLAGS) $(LIBAV_DECODE_FLAGS) advtime.c video_decode.c -o $@
+ gcc $(CFLAGS) $(LIBAV_DECODE_FLAGS) -DDEBUG=0 advtime.c video_decode.c -o $@
decode_frame: decode_frame.c
gcc $(CFLAGS) $(LIBAV_DECODE_FLAGS) decode_frame.c -o $@
diff --git a/src/video_decode.c b/src/video_decode.c
index 1d17afe..4a2eaf4 100644
--- a/src/video_decode.c
+++ b/src/video_decode.c
@@ -1,4 +1,7 @@
+#ifndef DEBUG
#define DEBUG 1
+#endif
+
#include "video_decode.h"
#include <libavutil/avutil.h>
@@ -106,7 +109,9 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame)
if (packet.data != NULL)
av_free_packet(&packet);
if (av_read_frame(vd->fmt_ctx, &packet) < 0) {
+#if DEBUG
fprintf(stderr, "Found no video stream packet!\n");
+#endif
return -1;
}
} while (packet.stream_index != vd->stream);