mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
Otherwise we get misaligned allocations. This gets ffplay working on Haiku, so we have at least one simple media player to cover basic needs.
152 lines
4.9 KiB
Plaintext
152 lines
4.9 KiB
Plaintext
From 6ed8a346799f20ba114b314d1054a30add1c4044 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Mon, 16 Oct 2017 18:31:07 +0200
|
|
Subject: disable ebx on x86.
|
|
|
|
|
|
diff --git a/configure b/configure
|
|
index 1797c5d..63ea916 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -6595,6 +6595,7 @@ enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pt
|
|
if test $target_os = "haiku"; then
|
|
disable memalign
|
|
disable posix_memalign
|
|
+ enabled x86_32 && enabled shared && disable ebx_available
|
|
fi
|
|
|
|
# add_dep lib dep
|
|
--
|
|
2.15.1
|
|
|
|
|
|
From 3780da8297339a332322d7c38e16f7dd42337bd9 Mon Sep 17 00:00:00 2001
|
|
From: Nicolas George <george@nsup.org>
|
|
Date: Fri, 27 Oct 2017 20:46:28 +0200
|
|
Subject: lavf/avio: temporarily accept 0 as EOF.
|
|
|
|
Print a warning to let applicatios fix their use.
|
|
After a deprecation period, check with a low-level assert.
|
|
Also make the constraint explicit in the doxygen comment.
|
|
|
|
Signed-off-by: Nicolas George <george@nsup.org>
|
|
|
|
diff --git a/libavformat/avio.h b/libavformat/avio.h
|
|
index f9c5972..250cf90 100644
|
|
--- a/libavformat/avio.h
|
|
+++ b/libavformat/avio.h
|
|
@@ -452,6 +452,8 @@ void avio_free_directory_entry(AVIODirEntry **entry);
|
|
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
|
|
* @param opaque An opaque pointer to user-specific data.
|
|
* @param read_packet A function for refilling the buffer, may be NULL.
|
|
+ * For stream protocols, must never return 0 but rather
|
|
+ * a proper AVERROR code.
|
|
* @param write_packet A function for writing the buffer contents, may be NULL.
|
|
* The function may not change the input buffers content.
|
|
* @param seek A function for seeking to specified byte position, may be NULL.
|
|
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
|
|
index 636cb46..a862d27 100644
|
|
--- a/libavformat/aviobuf.c
|
|
+++ b/libavformat/aviobuf.c
|
|
@@ -531,6 +531,24 @@ void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType typ
|
|
s->last_time = time;
|
|
}
|
|
|
|
+static int read_packet_wrapper(AVIOContext *s, uint8_t *buf, int size)
|
|
+{
|
|
+ int ret;
|
|
+
|
|
+ if (!s->read_packet)
|
|
+ return AVERROR_EOF;
|
|
+ ret = s->read_packet(s->opaque, buf, size);
|
|
+#if FF_API_OLD_AVIO_EOF_0
|
|
+ if (!ret && !s->max_packet_size) {
|
|
+ av_log(NULL, AV_LOG_WARNING, "Invalid return value 0 for stream protocol\n");
|
|
+ ret = AVERROR_EOF;
|
|
+ }
|
|
+#else
|
|
+ av_assert2(ret || s->max_packet_size);
|
|
+#endif
|
|
+ return ret;
|
|
+}
|
|
+
|
|
/* Input stream */
|
|
|
|
static void fill_buffer(AVIOContext *s)
|
|
@@ -569,10 +587,7 @@ static void fill_buffer(AVIOContext *s)
|
|
len = s->orig_buffer_size;
|
|
}
|
|
|
|
- if (s->read_packet)
|
|
- len = s->read_packet(s->opaque, dst, len);
|
|
- else
|
|
- len = 0;
|
|
+ len = read_packet_wrapper(s, dst, len);
|
|
if (len <= 0) {
|
|
/* do not modify buffer if EOF reached so that a seek back can
|
|
be done without rereading data */
|
|
@@ -644,8 +659,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
|
|
if (len == 0 || s->write_flag) {
|
|
if((s->direct || size > s->buffer_size) && !s->update_checksum) {
|
|
// bypass the buffer and read data directly into buf
|
|
- if(s->read_packet)
|
|
- len = s->read_packet(s->opaque, buf, size);
|
|
+ len = read_packet_wrapper(s, buf, size);
|
|
|
|
if (len <= 0) {
|
|
/* do not modify buffer if EOF reached so that a seek back can
|
|
@@ -711,7 +725,7 @@ int avio_read_partial(AVIOContext *s, unsigned char *buf, int size)
|
|
return -1;
|
|
|
|
if (s->read_packet && s->write_flag) {
|
|
- len = s->read_packet(s->opaque, buf, size);
|
|
+ len = read_packet_wrapper(s, buf, size);
|
|
if (len > 0)
|
|
s->pos += len;
|
|
return len;
|
|
diff --git a/libavformat/version.h b/libavformat/version.h
|
|
index 878917d..ba400e1 100644
|
|
--- a/libavformat/version.h
|
|
+++ b/libavformat/version.h
|
|
@@ -97,6 +97,9 @@
|
|
#ifndef FF_API_OLD_ROTATE_API
|
|
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 58)
|
|
#endif
|
|
+#ifndef FF_API_OLD_AVIO_EOF_0
|
|
+#define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 58)
|
|
+#endif
|
|
|
|
|
|
#ifndef FF_API_R_FRAME_RATE
|
|
--
|
|
2.15.1
|
|
|
|
|
|
From f449ce0153359ef24e5afbf49144c539be92f789 Mon Sep 17 00:00:00 2001
|
|
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
|
Date: Fri, 2 Feb 2018 11:39:47 +0100
|
|
Subject: Re-enable memalign for Haiku
|
|
|
|
This had been disabled in 2011:
|
|
https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2011-June/038362.html
|
|
|
|
If there are still problems with it we should rather fix them on Haiku
|
|
side.
|
|
|
|
diff --git a/configure b/configure
|
|
index 63ea916..e8f55bf 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -6593,8 +6593,6 @@ enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pt
|
|
|
|
|
|
if test $target_os = "haiku"; then
|
|
- disable memalign
|
|
- disable posix_memalign
|
|
enabled x86_32 && enabled shared && disable ebx_available
|
|
fi
|
|
|
|
--
|
|
2.15.1
|
|
|