comparison udp.c @ 5757:b1a108ca71c5 libavformat

Don't explicitly initialize networking in the tcp and udp protocols Networking is always initialized when opening protocols.
author mstorsjo
date Fri, 05 Mar 2010 22:38:48 +0000
parents c5a662ed3ab5
children 7a123cc24a81
comparison
equal deleted inserted replaced
5756:7c7fe75728dd 5757:b1a108ca71c5
317 317
318 h->is_streamed = 1; 318 h->is_streamed = 1;
319 h->max_packet_size = 1472; 319 h->max_packet_size = 1472;
320 320
321 is_output = (flags & URL_WRONLY); 321 is_output = (flags & URL_WRONLY);
322
323 if(!ff_network_init())
324 return AVERROR(EIO);
325 322
326 s = av_mallocz(sizeof(UDPContext)); 323 s = av_mallocz(sizeof(UDPContext));
327 if (!s) 324 if (!s)
328 return AVERROR(ENOMEM); 325 return AVERROR(ENOMEM);
329 326
480 UDPContext *s = h->priv_data; 477 UDPContext *s = h->priv_data;
481 478
482 if (s->is_multicast && !(h->flags & URL_WRONLY)) 479 if (s->is_multicast && !(h->flags & URL_WRONLY))
483 udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); 480 udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
484 closesocket(s->udp_fd); 481 closesocket(s->udp_fd);
485 ff_network_close();
486 av_free(s); 482 av_free(s);
487 return 0; 483 return 0;
488 } 484 }
489 485
490 URLProtocol udp_protocol = { 486 URLProtocol udp_protocol = {