[vlc-devel] [PATCH] schedule timer with interval once valid UDP received

Thomas Guillem thomas at gllm.fr
Mon Nov 2 11:38:47 CET 2020


Hello Natalie,

This patch seems fine to me.
Indeed, the timer is disarmed just before this code block. It seems logical to rearm it in case of success.

On Thu, Oct 29, 2020, at 15:50, Natalie Landsberg wrote:
> > The comment seems to imply that the patch reintroduces a data race.
> 
> Looking at the code again…. It seems as though the updateTimer is never actually scheduled on an interval. 
> It’s only called as single shots. I’m not sure whether that was removed, or never there in the first place. 
> And why some streams would happily continue for quite a while without it.
> 
> My suggestion: Add vlc_timer_schedule with interval after it is confirmed 
> that UDP packet can be received on the socket.
> 
> This way, the timer is still disarmed if it was armed before (amt_recv_relay_mem_query has a single shot)
> and it is scheduled on its intended interval.
> 
> I've tested that this indeed works with a stream and sends the membership reports on a 125 interval,
> but will continue testing as well.
> ---
> modules/access/amt.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/modules/access/amt.c b/modules/access/amt.c
> index 52bf0271ef..40caa5e14f 100644
> --- a/modules/access/amt.c
> +++ b/modules/access/amt.c
> @@ -746,6 +746,10 @@ static bool open_amt_tunnel( stream_t *p_access )
>          {
>              block_Release( pkt );
>              msg_Dbg( p_access, "Got UDP packet from multicast group via AMT relay %s, continuing...", relay_ip );
> +            /* Arms the timer again for a single shot from this callback. That way, the
> +            * time spent in amt_send_mem_update() is taken into consideration. */
> +            vlc_timer_schedule( sys->updateTimer, false,
> +                                VLC_TICK_FROM_SEC( sys->relay_igmp_query.qqic ), VLC_TICK_FROM_SEC( sys->relay_igmp_query.qqic ) );
>              break;   /* found an active server sending UDP packets, so exit loop */
>          }
>      }
> -- 
> 2.24.3 (Apple Git-128)
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20201102/7ddb594a/attachment.html>


More information about the vlc-devel mailing list