summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-22 22:34:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-22 22:34:02 +0200
commite847f4128543432a77fb8f85c313646a406c76f6 (patch)
treec23fd3d3cd7904fae57c6a3e7395e10e58ae5579 /libavutil
parent492cc9bcc4a50b4213648c1b8dcb7c28d17ea8f7 (diff)
parent9ee3334840c0d8564ca73dbfd6cd5a01bcdca79b (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: libspeexenc: add supported sample rates and channel layouts. Replace usleep() calls with av_usleep() lavu: add av_usleep() function utvideo: mark interlaced frames as such utvideo: Fix interlaced prediction for RGB utvideo. cosmetics: do not use full path for local headers lavu/file: include unistd.h only when available configure: check for unistd.h log: include unistd.h only when needed lavf: include libavutil/time.h instead of redeclaring av_gettime() Conflicts: configure doc/APIchanges ffmpeg.c ffplay.c libavcodec/utvideo.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/arm/float_dsp_init_arm.c2
-rw-r--r--libavutil/arm/float_dsp_init_vfp.c2
-rw-r--r--libavutil/avutil.h2
-rw-r--r--libavutil/file.c2
-rw-r--r--libavutil/log.c4
-rw-r--r--libavutil/time.c24
-rw-r--r--libavutil/time.h10
7 files changed, 42 insertions, 4 deletions
diff --git a/libavutil/arm/float_dsp_init_arm.c b/libavutil/arm/float_dsp_init_arm.c
index ab636dbcd2..f721344b39 100644
--- a/libavutil/arm/float_dsp_init_arm.c
+++ b/libavutil/arm/float_dsp_init_arm.c
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/arm/cpu.h"
#include "libavutil/float_dsp.h"
+#include "cpu.h"
#include "float_dsp_arm.h"
void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp)
diff --git a/libavutil/arm/float_dsp_init_vfp.c b/libavutil/arm/float_dsp_init_vfp.c
index dfde3fdb64..7abc3322cf 100644
--- a/libavutil/arm/float_dsp_init_vfp.c
+++ b/libavutil/arm/float_dsp_init_vfp.c
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/arm/cpu.h"
#include "libavutil/float_dsp.h"
+#include "cpu.h"
#include "float_dsp_arm.h"
void ff_vector_fmul_vfp(float *dst, const float *src0, const float *src1,
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index b3f213a240..0efaa952f4 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -153,7 +153,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 60
+#define LIBAVUTIL_VERSION_MINOR 61
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libavutil/file.c b/libavutil/file.c
index c6228effcd..d52a2e803f 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -20,7 +20,9 @@
#include "log.h"
#include <fcntl.h>
#include <sys/stat.h>
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
#if HAVE_MMAP
#include <sys/mman.h>
#elif HAVE_MAPVIEWOFFILE
diff --git a/libavutil/log.c b/libavutil/log.c
index f2272fb648..4464bd3031 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -24,7 +24,11 @@
* logging functions
*/
+#include "config.h"
+
+#if HAVE_ISATTY
#include <unistd.h>
+#endif
#include <stdlib.h>
#include "avutil.h"
#include "log.h"
diff --git a/libavutil/time.c b/libavutil/time.c
index 68f431e695..27feb0b758 100644
--- a/libavutil/time.c
+++ b/libavutil/time.c
@@ -22,13 +22,19 @@
#include <stddef.h>
#include <stdint.h>
+#include <time.h>
#if HAVE_GETTIMEOFDAY
#include <sys/time.h>
-#elif HAVE_GETSYSTEMTIMEASFILETIME
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#include "libavutil/time.h"
+#include "error.h"
int64_t av_gettime(void)
{
@@ -46,3 +52,19 @@ int64_t av_gettime(void)
return -1;
#endif
}
+
+int av_usleep(unsigned usec)
+{
+#if HAVE_NANOSLEEP
+ struct timespec ts = { usec / 1000000, usec % 1000000 * 1000 };
+ while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
+ return 0;
+#elif HAVE_USLEEP
+ return usleep(usec);
+#elif HAVE_SLEEP
+ Sleep(usec / 1000);
+ return 0;
+#else
+ return AVERROR(ENOSYS);
+#endif
+}
diff --git a/libavutil/time.h b/libavutil/time.h
index 27f4e6734a..90eb436949 100644
--- a/libavutil/time.h
+++ b/libavutil/time.h
@@ -28,4 +28,14 @@
*/
int64_t av_gettime(void);
+/**
+ * Sleep for a period of time. Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
#endif /* AVUTIL_TIME_H */