diff mbox series

[FFmpeg-devel,3/3] librist: set logsocket config to -1

Message ID 20210928082241.918233-3-gijs@peskens.net
State New
Headers show
Series [FFmpeg-devel,1/3] librist: replace deprecated functions. | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Gijs Peskens Sept. 28, 2021, 8:22 a.m. UTC
Signed-off-by: Gijs Peskens <gijs@peskens.net>
---
 libavformat/librist.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Marton Balint Oct. 10, 2021, 3:57 p.m. UTC | #1
On Tue, 28 Sep 2021, Gijs Peskens wrote:

> Signed-off-by: Gijs Peskens <gijs@peskens.net>
> ---
> libavformat/librist.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libavformat/librist.c b/libavformat/librist.c
> index 47c01a8432..987056ccd1 100644
> --- a/libavformat/librist.c
> +++ b/libavformat/librist.c
> @@ -245,6 +245,7 @@ static int librist_open(URLContext *h, const char *uri, int flags)
>     if ((flags & AVIO_FLAG_READ_WRITE) == AVIO_FLAG_READ_WRITE)
>         return AVERROR(EINVAL);
>
> +    s->logging_settings.log_socket = -1;
>     ret = rist_logging_set(&logging_settings, s->log_level, log_cb, h, NULL, NULL);

Shouldn't rist_logging_set initialize ALL fields of logging_settings? It 
is just seems wrong to pre-initialize a specific field.

If we must pre-initialize, then shouldn't something like

s->logging_settings = (struct rist_logging_settings)LOGGING_SETTINGS_INITIALIZER;

would be more clean? As far as I see the initializer is already available 
in 0.2.0, so no #ifdef is required.

Thanks,
Marton
diff mbox series

Patch

diff --git a/libavformat/librist.c b/libavformat/librist.c
index 47c01a8432..987056ccd1 100644
--- a/libavformat/librist.c
+++ b/libavformat/librist.c
@@ -245,6 +245,7 @@  static int librist_open(URLContext *h, const char *uri, int flags)
     if ((flags & AVIO_FLAG_READ_WRITE) == AVIO_FLAG_READ_WRITE)
         return AVERROR(EINVAL);
 
+    s->logging_settings.log_socket = -1;
     ret = rist_logging_set(&logging_settings, s->log_level, log_cb, h, NULL, NULL);
     if (ret < 0)
         return risterr2ret(ret);