diff mbox series

[FFmpeg-devel] Rename SRT's streamid to srt_streamid to avoid a conflict with standard streamid option

Message ID CALV4eUVNRDcf0dQBxTyHO737G7Tfg6aMuJN2oDnF9T_2o+PzYw@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] Rename SRT's streamid to srt_streamid to avoid a conflict with standard streamid option | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Sergey Ilinykh June 3, 2021, 10:37 a.m. UTC
Default streamid is some numeric value and not used by SRT code. Instead
SRT has its own string streamid. Current code has the same option name for
both and this causes a conflict when ffmpeg is started from a terminal.

The attached patch fixes it by renaming SRT's "streamid" to "srt_streamid"

Best Regards,
Sergey
Subject: [PATCH] Rename SRT's streamid to srt_streamid to avoid a conflict
 with standard streamid option

---
 libavformat/libsrt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marton Balint June 5, 2021, 9:18 a.m. UTC | #1
On Thu, 3 Jun 2021, Sergey Ilinykh wrote:

> Default streamid is some numeric value and not used by SRT code. Instead
> SRT has its own string streamid. Current code has the same option name for
> both and this causes a conflict when ffmpeg is started from a terminal.
>
> The attached patch fixes it by renaming SRT's "streamid" to "srt_streamid"

You should not simply rename, but rahter add an alias for the option. Also 
the relevant documentation needs to be updated/expanded.

Thanks,
Marton
Sergey Ilinykh June 8, 2021, 4:45 p.m. UTC | #2
this one http://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/280949.html
does a better job. please merge


Best Regards,
Sergey


чт, 3 июн. 2021 г. в 13:37, Sergey Ilinykh <rion4ik@gmail.com>:

> Default streamid is some numeric value and not used by SRT code. Instead
> SRT has its own string streamid. Current code has the same option name for
> both and this causes a conflict when ffmpeg is started from a terminal.
>
> The attached patch fixes it by renaming SRT's "streamid" to "srt_streamid"
>
> Best Regards,
> Sergey
>
diff mbox series

Patch

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index c1e96f700e..10dfc9e9c9 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -133,7 +133,7 @@  static const AVOption libsrt_options[] = {
     { "rcvbuf",         "Receive buffer size (in bytes)",                                       OFFSET(rcvbuf),           AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
     { "lossmaxttl",     "Maximum possible packet reorder tolerance",                            OFFSET(lossmaxttl),       AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
     { "minversion",     "The minimum SRT version that is required from the peer",               OFFSET(minversion),       AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
-    { "streamid",       "A string of up to 512 characters that an Initiator can pass to a Responder",  OFFSET(streamid),  AV_OPT_TYPE_STRING,   { .str = NULL },              .flags = D|E },
+    { "srt_streamid",   "A string of up to 512 characters that an Initiator can pass to a Responder",  OFFSET(streamid),  AV_OPT_TYPE_STRING,   { .str = NULL },              .flags = D|E },
     { "smoother",       "The type of Smoother used for the transmission for that socket",       OFFSET(smoother),         AV_OPT_TYPE_STRING,   { .str = NULL },              .flags = D|E },
     { "messageapi",     "Enable message API",                                                   OFFSET(messageapi),       AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
     { "transtype",      "The transmission type for the socket",                                 OFFSET(transtype),        AV_OPT_TYPE_INT,      { .i64 = SRTT_INVALID }, SRTT_LIVE, SRTT_INVALID, .flags = D|E, "transtype" },
@@ -608,7 +608,7 @@  static int libsrt_open(URLContext *h, const char *uri, int flags)
         if (av_find_info_tag(buf, sizeof(buf), "minversion", p)) {
             s->minversion = strtol(buf, NULL, 0);
         }
-        if (av_find_info_tag(buf, sizeof(buf), "streamid", p)) {
+        if (av_find_info_tag(buf, sizeof(buf), "srt_streamid", p)) {
             av_freep(&s->streamid);
             s->streamid = av_strdup(buf);
             if (!s->streamid) {