[FFmpeg-cvslog] avformat/udp: remove setting cancel state from the TX thread

Marton Balint git at videolan.org
Sun Feb 2 21:01:40 EET 2020


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Jan 26 21:11:53 2020 +0100| [c2b6493bf7ccbd34c2b28c53093fa6902673a8cd] | committer: Marton Balint

avformat/udp: remove setting cancel state from the TX thread

Write mode does not use cancellation.

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavformat/udp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index dce4cf76c7..85c9e3a900 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -520,14 +520,12 @@ static void *circular_buffer_task_tx( void *_URLContext)
 {
     URLContext *h = _URLContext;
     UDPContext *s = h->priv_data;
-    int old_cancelstate;
     int64_t target_timestamp = av_gettime_relative();
     int64_t start_timestamp = av_gettime_relative();
     int64_t sent_bits = 0;
     int64_t burst_interval = s->bitrate ? (s->burst_bits * 1000000 / s->bitrate) : 0;
     int64_t max_delay = s->bitrate ?  ((int64_t)h->max_packet_size * 8 * 1000000 / s->bitrate + 1) : 0;
 
-    pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate);
     pthread_mutex_lock(&s->mutex);
 
     if (ff_socket_nonblock(s->udp_fd, 0) < 0) {
@@ -562,7 +560,6 @@ static void *circular_buffer_task_tx( void *_URLContext)
         av_fifo_generic_read(s->fifo, s->tmp, len, NULL);
 
         pthread_mutex_unlock(&s->mutex);
-        pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancelstate);
 
         if (s->bitrate) {
             timestamp = av_gettime_relative();
@@ -608,7 +605,6 @@ static void *circular_buffer_task_tx( void *_URLContext)
             }
         }
 
-        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate);
         pthread_mutex_lock(&s->mutex);
     }
 



More information about the ffmpeg-cvslog mailing list