summaryrefslogtreecommitdiff
path: root/libavcodec/libxvidff.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-04-11 01:11:08 +0200
committerDiego Biurrun <diego@biurrun.de>2012-05-09 18:18:05 +0200
commit5b432d66ce49cbadcac832bffd6e22fda83807d3 (patch)
treea6ed5e3700d331f5b07d733e93e30b1cef980d1c /libavcodec/libxvidff.c
parent727af82a84999c6fbd30856c42ac1477e8fbe011 (diff)
libxvid: Separate libxvid encoder from libxvid rate control code.
This allows compiling the Xvid rate control code without the encoder.
Diffstat (limited to 'libavcodec/libxvidff.c')
-rw-r--r--libavcodec/libxvidff.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
index def80b3fac..e95bb7d3b9 100644
--- a/libavcodec/libxvidff.c
+++ b/libavcodec/libxvidff.c
@@ -33,9 +33,6 @@
#include "libavutil/mathematics.h"
#include "libxvid_internal.h"
#include "mpegvideo.h"
-#if !HAVE_MKSTEMP
-#include <fcntl.h>
-#endif
/**
* Buffer management macros.
@@ -83,42 +80,6 @@ struct xvid_ff_pass1 {
* rate-control plugin.
*/
-/* Wrapper to work around the lack of mkstemp() on mingw.
- * Also, tries to create file in /tmp first, if possible.
- * *prefix can be a character constant; *filename will be allocated internally.
- * @return file descriptor of opened file (or -1 on error)
- * and opened file name in **filename. */
-int ff_tempfile(const char *prefix, char **filename) {
- int fd=-1;
-#if !HAVE_MKSTEMP
- *filename = tempnam(".", prefix);
-#else
- size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
- *filename = av_malloc(len);
-#endif
- /* -----common section-----*/
- if (*filename == NULL) {
- av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
- return -1;
- }
-#if !HAVE_MKSTEMP
- fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
-#else
- snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
- fd = mkstemp(*filename);
- if (fd < 0) {
- snprintf(*filename, len, "./%sXXXXXX", prefix);
- fd = mkstemp(*filename);
- }
-#endif
- /* -----common section-----*/
- if (fd < 0) {
- av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
- return -1;
- }
- return fd; /* success */
-}
-
/**
* Initialize the two-pass plugin and context.
*