aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-08-23 20:17:25 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-08-27 10:09:31 +0200
commitc0bca6425d6e7e5d9f3094f56a17bad213c639db (patch)
tree976175c9b6558fa9478deb41cec87310d3153ac3
parent73b40dafc8365eeb7c1451d3221f2f27d7f22e8f (diff)
downloadffmpeg-c0bca6425d6e7e5d9f3094f56a17bad213c639db.tar.gz
examples/decoding_encoding: store temporary files in current dir
Do not clutter the temporary directory with files, also "/tmp" is not always available, e.g. in Windows. Also add the clean-test Makefile rule, which will clean the generated files.
-rw-r--r--doc/examples/Makefile7
-rw-r--r--doc/examples/decoding_encoding.c14
2 files changed, 12 insertions, 9 deletions
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 5217d6e56a..c630b2aa9e 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -23,9 +23,12 @@ OBJS=$(addsuffix .o,$(EXAMPLES))
decoding_encoding: LDLIBS += -lm
muxing: LDLIBS += -lm
-.phony: all clean
+.phony: all clean-test clean
all: $(OBJS) $(EXAMPLES)
-clean:
+clean-test:
+ rm -rf test*.pgm test.h264 test.mp2 test.sw test.mpg
+
+clean: clean-test
rm -rf $(EXAMPLES) $(OBJS)
diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c
index c3e9a2933a..309342f210 100644
--- a/doc/examples/decoding_encoding.c
+++ b/doc/examples/decoding_encoding.c
@@ -606,18 +606,18 @@ int main(int argc, char **argv)
avcodec_register_all();
if (argc <= 1) {
- audio_encode_example("/tmp/test.mp2");
- audio_decode_example("/tmp/test.sw", "/tmp/test.mp2");
+ audio_encode_example("test.mp2");
+ audio_decode_example("test.sw", "test.mp2");
- video_encode_example("/tmp/test.h264", AV_CODEC_ID_H264);
- video_encode_example("/tmp/test.mpg", AV_CODEC_ID_MPEG1VIDEO);
- filename = "/tmp/test.mpg";
+ video_encode_example("test.h264", AV_CODEC_ID_H264);
+ video_encode_example("test.mpg", AV_CODEC_ID_MPEG1VIDEO);
+ filename = "test.mpg";
} else {
filename = argv[1];
}
- // audio_decode_example("/tmp/test.sw", filename);
- video_decode_example("/tmp/test%d.pgm", filename);
+ // audio_decode_example("test.sw", filename);
+ video_decode_example("test%02d.pgm", filename);
return 0;
}