When I update srt to net-libs/srt-1.4.2 and rebuild media-video/ffmpeg-4.3.1, it failed because src/libavformat/libsrt.c:317:66: error: ‘SRTO_STRICTENC’ undeclared (first use in this function); did you mean ‘SRTO_STATE’? It is due to the API upgrade of srt. https://trac.ffmpeg.org/ticket/8760 Reproducible: Always Steps to Reproduce: 1. Install media-video/ffmpeg-4.3.1 with srt use flag Actual Results: build failed because src/libavformat/libsrt.c:317:66: error: ‘SRTO_STRICTENC’ undeclared (first use in this function); did you mean ‘SRTO_STATE’? Expected Results: Install success This fix http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315 tested fixed this issue. --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -313,8 +313,12 @@ static int libsrt_set_options_pre(URLContext *h, int fd) (s->pbkeylen >= 0 && libsrt_setsockopt(h, fd, SRTO_PBKEYLEN, "SRTO_PBKEYLEN", &s->pbkeylen, sizeof(s->pbkeylen)) < 0) || (s->passphrase && libsrt_setsockopt(h, fd, SRTO_PASSPHRASE, "SRTO_PASSPHRASE", s->passphrase, strlen(s->passphrase)) < 0) || #if SRT_VERSION_VALUE >= 0x010302 +#if SRT_VERSION_VALUE >= 0x010401 + (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_ENFORCEDENCRYPTION, "SRTO_ENFORCEDENCRYPTION", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) || +#else /* SRTO_STRICTENC == SRTO_ENFORCEDENCRYPTION (53), but for compatibility, we used SRTO_STRICTENC */ (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_STRICTENC, "SRTO_STRICTENC", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) || +#endif (s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, sizeof(s->kmrefreshrate)) < 0) || (s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, sizeof(s->kmpreannounce)) < 0) || #endif @@ -333,7 +337,11 @@ static int libsrt_set_options_pre(URLContext *h, int fd) (s->lossmaxttl >= 0 && libsrt_setsockopt(h, fd, SRTO_LOSSMAXTTL, "SRTO_LOSSMAXTTL", &s->lossmaxttl, sizeof(s->lossmaxttl)) < 0) || (s->minversion >= 0 && libsrt_setsockopt(h, fd, SRTO_MINVERSION, "SRTO_MINVERSION", &s->minversion, sizeof(s->minversion)) < 0) || (s->streamid && libsrt_setsockopt(h, fd, SRTO_STREAMID, "SRTO_STREAMID", s->streamid, strlen(s->streamid)) < 0) || +#if SRT_VERSION_VALUE >= 0x010401 + (s->smoother && libsrt_setsockopt(h, fd, SRTO_CONGESTION, "SRTO_CONGESTION", s->smoother, strlen(s->smoother)) < 0) || +#else (s->smoother && libsrt_setsockopt(h, fd, SRTO_SMOOTHER, "SRTO_SMOOTHER", s->smoother, strlen(s->smoother)) < 0) || +#endif (s->messageapi >= 0 && libsrt_setsockopt(h, fd, SRTO_MESSAGEAPI, "SRTO_MESSAGEAPI", &s->messageapi, sizeof(s->messageapi)) < 0) || (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) || ((h->flags & AVIO_FLAG_WRITE) && libsrt_setsockopt(h, fd, SRTO_SENDER, "SRTO_SENDER", &yes, sizeof(yes)) < 0)) {
Created attachment 675130 [details] build.log The failed build log
Created attachment 675133 [details, diff] patch With this patch this bug fixed
Same compile fail, here, on ~amd64 during regular system update. And, same fix w4m.
Saving the patch as /etc/portage/patches/media-video/ffmpeg-4.3.1/0001_fix_libsrt.patch and re-emerging ffmpeg worked for me, thanks!
(In reply to vowstar from comment #2) > Created attachment 675133 [details, diff] [details, diff] > patch > > With this patch this bug fixed Thanks for the patch!
*** Bug 758962 has been marked as a duplicate of this bug. ***
This patch works. Is there a reason why it's not in portage yet?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2bb4173add20c89953f7c2f7f42f5f81d67bf45 commit f2bb4173add20c89953f7c2f7f42f5f81d67bf45 Author: Sam James <sam@gentoo.org> AuthorDate: 2020-12-25 02:35:38 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2020-12-25 02:35:51 +0000 media-video/ffmpeg: fix USE=srt with >=net-libs/srt-1.4.2 Closes: https://bugs.gentoo.org/756859 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Sam James <sam@gentoo.org> media-video/ffmpeg/ffmpeg-4.3.1.ebuild | 1 + .../files/ffmpeg-4.3.1-srt-1.4.2-build.patch | 52 ++++++++++++++++++++++ 2 files changed, 53 insertions(+)