patch for ffmpeg 0.6 svn #25603

git-svn-id: svn://kolibrios.org@1680 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2010-10-29 18:47:18 +00:00
parent 82eba545cd
commit d6f81b2980
2 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,17 @@
1)Download Newlib from http://code.google.com/p/kolibri-pe/downloads/detail?name=libc.7z
Type svn co svn://svn.ffmpeg.org/ffmpeg/branches/0.6 ffmpeg-0.6
to install ffmpeg-0.6 branch. Apply patch.
2) Type './configure' to create the configuration. A list of configure
options is printed by running 'configure --help'.
Known working configuration:
./configure --disable-shared --enable-static --disable-network --disable-debug --enable-memalign-hack --extra-cflags=-fno-builtin-printf --extra-cflags=-fno-common --disable-protocol=pipe --disable-encoders --enable-gpl --extra-cflags=-I<path to newlib includes> --disable-ffplay --disable-vdpau --enable-hardcoded-tables --disable-devices
'configure' can be launched from a directory different from the FFmpeg
sources to build the objects out of tree. To do this, use an absolute
path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'.
You can manually change some options in resulted config.h and config.mak.
3) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required.

View File

@ -0,0 +1,115 @@
Index: libavcodec/utils.c
===================================================================
--- libavcodec/utils.c (revision 25603)
+++ libavcodec/utils.c (working copy)
@@ -1071,27 +1071,33 @@
* and opened file name in **filename. */
int av_tempfile(char *prefix, char **filename) {
int fd=-1;
-#if !HAVE_MKSTEMP
- *filename = tempnam(".", prefix);
-#else
+//#if !defined(HAVE_MKSTEMP)
+// *filename = tempnam(".", prefix);
+//#else
size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
*filename = av_malloc(len);
-#endif
+//#endif
/* -----common section-----*/
if (*filename == NULL) {
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
return -1;
}
-#if !HAVE_MKSTEMP
+//#if !defined(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);
+// }
+
+
+ snprintf(*filename, len, "%sXXXXXX", prefix);
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
+
+//#endif
/* -----common section-----*/
if (fd < 0) {
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
Index: libavcodec/vorbis.c
===================================================================
--- libavcodec/vorbis.c (revision 25603)
+++ libavcodec/vorbis.c (working copy)
@@ -23,6 +23,7 @@
#undef V_DEBUG
//#define V_DEBUG
+#include <math.h>
#define ALT_BITSTREAM_READER_LE
#include "avcodec.h"
#include "get_bits.h"
Index: libavformat/avio.c
===================================================================
--- libavformat/avio.c (revision 25603)
+++ libavformat/avio.c (working copy)
@@ -174,7 +174,7 @@
if (fast_retries)
fast_retries--;
else
- usleep(1000);
+ /*usleep(1000)*/;
} else if (ret < 1)
return ret < 0 ? ret : len;
if (ret)
Index: libswscale/swscale.c
===================================================================
--- libswscale/swscale.c (revision 25603)
+++ libswscale/swscale.c (working copy)
@@ -1834,7 +1834,7 @@
* swscale wrapper, so we don't need to export the SwsContext.
* Assumes planar YUV to be in YUV order instead of YVU.
*/
-int sws_scale(SwsContext *c, const uint8_t* const src[], const int srcStride[], int srcSliceY,
+int sws_scale(SwsContext *c, uint8_t* src[], const int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* const dst[], const int dstStride[])
{
int i;
Index: libswscale/swscale.h
===================================================================
--- libswscale/swscale.h (revision 25603)
+++ libswscale/swscale.h (working copy)
@@ -192,7 +192,7 @@
* the destination image
* @return the height of the output slice
*/
-int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
+int sws_scale(struct SwsContext *context, uint8_t* srcSlice[], const int srcStride[],
int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
#if LIBSWSCALE_VERSION_MAJOR < 1
/**
Index: libswscale/utils.c
===================================================================
--- libswscale/utils.c (revision 25603)
+++ libswscale/utils.c (working copy)
@@ -24,6 +24,8 @@
#include <math.h>
#include <stdio.h>
#include "config.h"
+#undef HAVE_VIRTUALALLOC
+#define HAVE_VIRTUALALLOC 0
#include <assert.h>
#if HAVE_SYS_MMAN_H
#include <sys/mman.h>