[FFmpeg-cvslog] udp: add missing mutex unlock

Michael Niedermayer git at videolan.org
Sat Oct 20 23:49:16 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 20 23:31:32 2012 +0200| [044c0e62eaea07c2649d821dadd4d875d3fb9ec7] | committer: Michael Niedermayer

udp: add missing mutex unlock

Fixes CID703688
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=044c0e62eaea07c2649d821dadd4d875d3fb9ec7
---

 libavformat/udp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 433f961..c6f0a1f 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -766,8 +766,10 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
                 int64_t t = av_gettime() + 100000;
                 struct timespec tv = { .tv_sec  =  t / 1000000,
                                        .tv_nsec = (t % 1000000) * 1000 };
-                if (pthread_cond_timedwait(&s->cond, &s->mutex, &tv) < 0)
+                if (pthread_cond_timedwait(&s->cond, &s->mutex, &tv) < 0) {
+                    pthread_mutex_unlock(&s->mutex);
                     return AVERROR(errno == ETIMEDOUT ? EAGAIN : errno);
+                }
                 nonblock = 1;
             }
         } while( 1);



More information about the ffmpeg-cvslog mailing list