ffmpeg-libsrt.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315 Mon Sep 17 00:00:00 2001
  2. From: Jun Zhao <[email protected]>
  3. Date: Sun, 12 Jul 2020 13:48:48 +0800
  4. Subject: [PATCH 1/1] lavf/srt: fix build fail when used the libsrt 1.4.1
  5. libsrt changed the:
  6. SRTO_SMOOTHER -> SRTO_CONGESTION
  7. SRTO_STRICTENC -> SRTO_ENFORCEDENCRYPTION
  8. and removed the front of deprecated options (SRTO_SMOOTHER/SRTO_STRICTENC)
  9. in the header, it's lead to build fail
  10. fix #8760
  11. Signed-off-by: Jun Zhao <[email protected]>
  12. ---
  13. libavformat/libsrt.c | 8 ++++++++
  14. 1 file changed, 8 insertions(+)
  15. diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
  16. index 4de575b..4719ce0 100644
  17. --- a/libavformat/libsrt.c
  18. +++ b/libavformat/libsrt.c
  19. @@ -313,8 +313,12 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
  20. (s->pbkeylen >= 0 && libsrt_setsockopt(h, fd, SRTO_PBKEYLEN, "SRTO_PBKEYLEN", &s->pbkeylen, sizeof(s->pbkeylen)) < 0) ||
  21. (s->passphrase && libsrt_setsockopt(h, fd, SRTO_PASSPHRASE, "SRTO_PASSPHRASE", s->passphrase, strlen(s->passphrase)) < 0) ||
  22. #if SRT_VERSION_VALUE >= 0x010302
  23. +#if SRT_VERSION_VALUE >= 0x010401
  24. + (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_ENFORCEDENCRYPTION, "SRTO_ENFORCEDENCRYPTION", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
  25. +#else
  26. /* SRTO_STRICTENC == SRTO_ENFORCEDENCRYPTION (53), but for compatibility, we used SRTO_STRICTENC */
  27. (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_STRICTENC, "SRTO_STRICTENC", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
  28. +#endif
  29. (s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, sizeof(s->kmrefreshrate)) < 0) ||
  30. (s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, sizeof(s->kmpreannounce)) < 0) ||
  31. #endif
  32. @@ -333,7 +337,11 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
  33. (s->lossmaxttl >= 0 && libsrt_setsockopt(h, fd, SRTO_LOSSMAXTTL, "SRTO_LOSSMAXTTL", &s->lossmaxttl, sizeof(s->lossmaxttl)) < 0) ||
  34. (s->minversion >= 0 && libsrt_setsockopt(h, fd, SRTO_MINVERSION, "SRTO_MINVERSION", &s->minversion, sizeof(s->minversion)) < 0) ||
  35. (s->streamid && libsrt_setsockopt(h, fd, SRTO_STREAMID, "SRTO_STREAMID", s->streamid, strlen(s->streamid)) < 0) ||
  36. +#if SRT_VERSION_VALUE >= 0x010401
  37. + (s->smoother && libsrt_setsockopt(h, fd, SRTO_CONGESTION, "SRTO_CONGESTION", s->smoother, strlen(s->smoother)) < 0) ||
  38. +#else
  39. (s->smoother && libsrt_setsockopt(h, fd, SRTO_SMOOTHER, "SRTO_SMOOTHER", s->smoother, strlen(s->smoother)) < 0) ||
  40. +#endif
  41. (s->messageapi >= 0 && libsrt_setsockopt(h, fd, SRTO_MESSAGEAPI, "SRTO_MESSAGEAPI", &s->messageapi, sizeof(s->messageapi)) < 0) ||
  42. (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) ||
  43. ((h->flags & AVIO_FLAG_WRITE) && libsrt_setsockopt(h, fd, SRTO_SENDER, "SRTO_SENDER", &yes, sizeof(yes)) < 0)) {
  44. --
  45. 2.7.4