[FFmpeg-devel] make work (live) libsrt
Marton Balint
cus at passwd.hu
Sat Aug 25 13:44:00 EEST 2018
On Sat, 25 Aug 2018, Marton Balint wrote:
>
>
> On Sat, 25 Aug 2018, Tudor Suciu wrote:
>
>> Hello,
>>
>> Is this patch in a better shape for inclusion?
>
> The code seems OK, please resend the patch with a docs/protocols.texi
> update for the new option.
On the second look, there are some strange things:
> @@ -73,6 +74,7 @@ static const AVOption libsrt_options[] = {
> { "listen_timeout", "Connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> { "send_buffer_size", "Socket send buffer size (in bytes)", OFFSET(send_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
> { "recv_buffer_size", "Socket receive buffer size (in bytes)", OFFSET(recv_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
> + { "pkt_size", "Maximum SRT packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = 1316 }, -1, INT_MAX, .flags = D|E },
minimum value is 1, not -1.
> + if (flags & AVIO_FLAG_WRITE) {
> + h->max_packet_size = 1316;
> + }
> +
See below.
> @@ -466,6 +475,9 @@ static int libsrt_open(URLContext *h, const char *uri, int flags)
> }
> }
> }
> + if (flags & AVIO_FLAG_WRITE && s->pkt_size > 0) {
> + h->max_packet_size = s->pkt_size;
> + }
You can simplify this to:
if (flags & AVIO_FLAG_WRITE)
h->max_packet_size = s->pkt_size > 0 ? s->pkt_size : 1316;
This way the chunk before this one is not needed.
Thanks,
Marton
More information about the ffmpeg-devel
mailing list