summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2022-06-10 00:16:51 +0200
committerMarton Balint <cus@passwd.hu>2022-06-18 16:32:23 +0200
commitb3cca50638535c0d1b5674d99586858b5b2d7af9 (patch)
tree015cc2374c8fc7b387acc587a1de412fd4abdee0 /libavformat
parent2d764069be3b4092dc986467660607d922023332 (diff)
avformat/librist: bump required version to 0.2.7
This is the first version for which fifo size setting actually works. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/librist.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/libavformat/librist.c b/libavformat/librist.c
index 58dfd7c44b..5f27cacd44 100644
--- a/libavformat/librist.c
+++ b/libavformat/librist.c
@@ -38,13 +38,6 @@
// RIST_MAX_PACKET_SIZE - 28 minimum protocol overhead
#define MAX_PAYLOAD_SIZE (10000-28)
-
-#define FF_LIBRIST_MAKE_VERSION(major, minor, patch) \
- ((patch) + ((minor)* 0x100) + ((major) *0x10000))
-#define FF_LIBRIST_VERSION FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, LIBRIST_API_VERSION_MINOR, LIBRIST_API_VERSION_PATCH)
-#define FF_LIBRIST_VERSION_41 FF_LIBRIST_MAKE_VERSION(4, 1, 0)
-#define FF_LIBRIST_VERSION_42 FF_LIBRIST_MAKE_VERSION(4, 2, 0)
-
#define FIFO_SIZE_DEFAULT 8192
typedef struct RISTContext {
@@ -160,24 +153,14 @@ static int librist_open(URLContext *h, const char *uri, int flags)
if (ret < 0)
goto err;
-#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41
- ret = rist_parse_address(uri, (const struct rist_peer_config **)&peer_config);
-#else
ret = rist_parse_address2(uri, &peer_config);
-#endif
if (ret < 0)
goto err;
if (flags & AVIO_FLAG_READ) {
-//Prior to 4.2.0 there was a bug in librist which made this call always fail.
-#if FF_LIBRIST_VERSION >= FF_LIBRIST_VERSION_42
ret = rist_receiver_set_output_fifo_size(s->ctx, s->fifo_size);
if (ret != 0)
goto err;
-#else
- if (s->fifo_size != FIFO_SIZE_DEFAULT)
- av_log(h, AV_LOG_ERROR, "librist prior to 0.2.7 has a bug which fails setting the fifo buffer size\n");
-#endif
}
if (((s->encryption == 128 || s->encryption == 256) && !s->secret) ||
@@ -219,13 +202,8 @@ static int librist_read(URLContext *h, uint8_t *buf, int size)
RISTContext *s = h->priv_data;
int ret;
-#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41
- const struct rist_data_block *data_block;
- ret = rist_receiver_data_read(s->ctx, &data_block, POLLING_TIME);
-#else
struct rist_data_block *data_block;
ret = rist_receiver_data_read2(s->ctx, &data_block, POLLING_TIME);
-#endif
if (ret < 0)
return risterr2ret(ret);
@@ -234,15 +212,10 @@ static int librist_read(URLContext *h, uint8_t *buf, int size)
return AVERROR(EAGAIN);
if (data_block->payload_len > MAX_PAYLOAD_SIZE) {
-#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41
- rist_receiver_data_block_free((struct rist_data_block**)&data_block);
-#else
rist_receiver_data_block_free2(&data_block);
-#endif
return AVERROR_EXTERNAL;
}
-#if FF_LIBRIST_VERSION >= FF_LIBRIST_VERSION_42
if (data_block->flags & RIST_DATA_FLAGS_OVERFLOW) {
if (!s->overrun_nonfatal) {
av_log(h, AV_LOG_ERROR, "Fifo buffer overrun. "
@@ -252,16 +225,11 @@ static int librist_read(URLContext *h, uint8_t *buf, int size)
goto out_free;
}
}
-#endif
size = data_block->payload_len;
memcpy(buf, data_block->payload, size);
out_free:
-#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41
- rist_receiver_data_block_free((struct rist_data_block**)&data_block);
-#else
rist_receiver_data_block_free2(&data_block);
-#endif
return size;
}