Skip to content

Commit

Permalink
avformat/udp: Close the socket after destroying the thread using the …
Browse files Browse the repository at this point in the history
…socket

for send() this cannot work and even for recv() it feels very wrong and hackish

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed May 24, 2016
1 parent 9b7a8bd commit 9591ca7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,6 @@ static int udp_close(URLContext *h)

if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage);
closesocket(s->udp_fd);
#if HAVE_PTHREAD_CANCEL
if (s->thread_started) {
int ret;
Expand All @@ -1123,6 +1122,7 @@ static int udp_close(URLContext *h)
pthread_cond_destroy(&s->cond);
}
#endif
closesocket(s->udp_fd);
av_fifo_freep(&s->fifo);
return 0;
}
Expand Down

0 comments on commit 9591ca7

Please sign in to comment.