Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 756859 - media-video/ffmpeg-4.3.1[srt]: build failed with net-libs/srt-1.4.2
Summary: media-video/ffmpeg-4.3.1[srt]: build failed with net-libs/srt-1.4.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL: http://git.videolan.org/?p=ffmpeg.git...
Whiteboard:
Keywords: PATCH
: 758962 (view as bug list)
Depends on:
Blocks: 761547
  Show dependency tree
 
Reported: 2020-11-26 16:51 UTC by vowstar
Modified: 2020-12-25 02:35 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.xz,31.45 KB, application/x-xz)
2020-11-26 16:56 UTC, vowstar
Details
patch (0001_fix_libsrt.patch,2.39 KB, patch)
2020-11-26 16:57 UTC, vowstar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vowstar 2020-11-26 16:51:39 UTC
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)) {
Comment 1 vowstar 2020-11-26 16:56:03 UTC
Created attachment 675130 [details]
build.log

The failed build log
Comment 2 vowstar 2020-11-26 16:57:15 UTC
Created attachment 675133 [details, diff]
patch

With this patch this bug fixed
Comment 3 Greg Turner 2020-11-28 21:28:01 UTC
Same compile fail, here, on ~amd64 during regular system update.  And, same fix w4m.
Comment 4 John Ragland 2020-11-30 01:03:10 UTC
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!
Comment 5 Attila Tóth 2020-12-02 14:11:26 UTC
(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!
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-07 21:31:58 UTC
*** Bug 758962 has been marked as a duplicate of this bug. ***
Comment 7 Luke A. Guest 2020-12-18 13:29:51 UTC
This patch works. Is there a reason why it's not in portage yet?
Comment 8 Larry the Git Cow gentoo-dev 2020-12-25 02:35:56 UTC
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(+)