diff mbox series

[FFmpeg-devel] avformat/udp: fix check for pthread_cond_wait return value

Message ID tencent_3B5234F78136353D3EB356A79C96E14E5A09@qq.com
State Accepted
Commit 30ca9980ffb885bfdf433302e5338021eef578fe
Headers show
Series [FFmpeg-devel] avformat/udp: fix check for pthread_cond_wait return value | 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

Zhao Zhili June 21, 2021, 2:32 p.m. UTC
POSIX errno is positive. We have strict_pthread_cond_wait to handle
error code during development.
---
 libavformat/udp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jun Zhao June 23, 2021, 3:38 a.m. UTC | #1
LGTM, check the negative return value/errno  is wrong before this patch

On Mon, Jun 21, 2021 at 10:33 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> POSIX errno is positive. We have strict_pthread_cond_wait to handle
> error code during development.
> ---
>  libavformat/udp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 9b9d3de197..bbe5aecc46 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -550,9 +550,7 @@ static void *circular_buffer_task_tx( void *_URLContext)
>          while (len<4) {
>              if (s->close_req)
>                  goto end;
> -            if (pthread_cond_wait(&s->cond, &s->mutex) < 0) {
> -                goto end;
> -            }
> +            pthread_cond_wait(&s->cond, &s->mutex);
>              len = av_fifo_size(s->fifo);
>          }
>
> --
> 2.31.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 9b9d3de197..bbe5aecc46 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -550,9 +550,7 @@  static void *circular_buffer_task_tx( void *_URLContext)
         while (len<4) {
             if (s->close_req)
                 goto end;
-            if (pthread_cond_wait(&s->cond, &s->mutex) < 0) {
-                goto end;
-            }
+            pthread_cond_wait(&s->cond, &s->mutex);
             len = av_fifo_size(s->fifo);
         }