Commit 8943ad40 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4521645b'

* commit '4521645b':
  avio: fix pointer type mismatches in avio_enum_protocols()
  avserver: use socklen_t where appropriate
  udp: use socklen_t where appropriate
  network: use HAVE_THREADS instead of local hack
  af_channelmap: remove stray enum declaration
  buffersink: remove stray semicolon after function definition

Conflicts:
	libavformat/avio.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents f9f79cb0 4521645b
...@@ -812,7 +812,8 @@ static void http_send_too_busy_reply(int fd) ...@@ -812,7 +812,8 @@ static void http_send_too_busy_reply(int fd)
static void new_connection(int server_fd, int is_rtsp) static void new_connection(int server_fd, int is_rtsp)
{ {
struct sockaddr_in from_addr; struct sockaddr_in from_addr;
int fd, len; socklen_t len;
int fd;
HTTPContext *c = NULL; HTTPContext *c = NULL;
len = sizeof(from_addr); len = sizeof(from_addr);
...@@ -1736,7 +1737,8 @@ static int http_parse_request(HTTPContext *c) ...@@ -1736,7 +1737,8 @@ static int http_parse_request(HTTPContext *c)
case REDIR_SDP: case REDIR_SDP:
{ {
uint8_t *sdp_data; uint8_t *sdp_data;
int sdp_data_size, len; int sdp_data_size;
socklen_t len;
struct sockaddr_in my_addr; struct sockaddr_in my_addr;
snprintf(q, c->buffer_size, snprintf(q, c->buffer_size,
...@@ -3019,7 +3021,8 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url) ...@@ -3019,7 +3021,8 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
char path1[1024]; char path1[1024];
const char *path; const char *path;
uint8_t *content; uint8_t *content;
int content_length, len; int content_length;
socklen_t len;
struct sockaddr_in my_addr; struct sockaddr_in my_addr;
/* find which url is asked */ /* find which url is asked */
......
...@@ -125,7 +125,6 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args) ...@@ -125,7 +125,6 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
ChannelMapContext *s = ctx->priv; ChannelMapContext *s = ctx->priv;
int ret; int ret;
char *mapping; char *mapping;
enum mode;
int map_entries = 0; int map_entries = 0;
char buf[256]; char buf[256];
enum MappingMode mode; enum MappingMode mode;
......
...@@ -85,11 +85,11 @@ const AVClass ffurl_context_class = { ...@@ -85,11 +85,11 @@ const AVClass ffurl_context_class = {
const char *avio_enum_protocols(void **opaque, int output) const char *avio_enum_protocols(void **opaque, int output)
{ {
URLProtocol **p = (URLProtocol **)opaque; URLProtocol *p;
*p = ffurl_protocol_next(*p); *opaque = ffurl_protocol_next(*opaque);
if (!*p) return NULL; if (!(p = *opaque)) return NULL;
if ((output && (*p)->url_write) || (!output && (*p)->url_read)) if ((output && p->url_write) || (!output && p->url_read))
return (*p)->name; return p->name;
return avio_enum_protocols(opaque, output); return avio_enum_protocols(opaque, output);
} }
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "url.h" #include "url.h"
#include "libavutil/time.h" #include "libavutil/time.h"
#define THREADS (HAVE_PTHREADS || (defined(WIN32) && !defined(__MINGW32CE__))) #if HAVE_THREADS
#if THREADS
#if HAVE_PTHREADS #if HAVE_PTHREADS
#include <pthread.h> #include <pthread.h>
#else #else
...@@ -38,7 +36,7 @@ ...@@ -38,7 +36,7 @@
#if CONFIG_OPENSSL #if CONFIG_OPENSSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
static int openssl_init; static int openssl_init;
#if THREADS #if HAVE_THREADS
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
pthread_mutex_t *openssl_mutexes; pthread_mutex_t *openssl_mutexes;
...@@ -59,7 +57,7 @@ static unsigned long openssl_thread_id(void) ...@@ -59,7 +57,7 @@ static unsigned long openssl_thread_id(void)
#endif #endif
#if CONFIG_GNUTLS #if CONFIG_GNUTLS
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#if THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00 #if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
#include <gcrypt.h> #include <gcrypt.h>
#include <errno.h> #include <errno.h>
#undef malloc #undef malloc
...@@ -75,7 +73,7 @@ void ff_tls_init(void) ...@@ -75,7 +73,7 @@ void ff_tls_init(void)
if (!openssl_init) { if (!openssl_init) {
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
#if THREADS #if HAVE_THREADS
if (!CRYPTO_get_locking_callback()) { if (!CRYPTO_get_locking_callback()) {
int i; int i;
openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks()); openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks());
...@@ -91,7 +89,7 @@ void ff_tls_init(void) ...@@ -91,7 +89,7 @@ void ff_tls_init(void)
openssl_init++; openssl_init++;
#endif #endif
#if CONFIG_GNUTLS #if CONFIG_GNUTLS
#if THREADS && GNUTLS_VERSION_NUMBER < 0x020b00 #if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0) if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
#endif #endif
...@@ -106,7 +104,7 @@ void ff_tls_deinit(void) ...@@ -106,7 +104,7 @@ void ff_tls_deinit(void)
#if CONFIG_OPENSSL #if CONFIG_OPENSSL
openssl_init--; openssl_init--;
if (!openssl_init) { if (!openssl_init) {
#if THREADS #if HAVE_THREADS
if (CRYPTO_get_locking_callback() == openssl_lock) { if (CRYPTO_get_locking_callback() == openssl_lock) {
int i; int i;
CRYPTO_set_locking_callback(NULL); CRYPTO_set_locking_callback(NULL);
......
...@@ -312,7 +312,7 @@ static int udp_set_url(struct sockaddr_storage *addr, ...@@ -312,7 +312,7 @@ static int udp_set_url(struct sockaddr_storage *addr,
} }
static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr,
int *addr_len, const char *localaddr) socklen_t *addr_len, const char *localaddr)
{ {
int udp_fd = -1; int udp_fd = -1;
struct addrinfo *res0 = NULL, *res = NULL; struct addrinfo *res0 = NULL, *res = NULL;
...@@ -500,7 +500,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -500,7 +500,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
const char *p; const char *p;
char buf[256]; char buf[256];
struct sockaddr_storage my_addr; struct sockaddr_storage my_addr;
int len; socklen_t len;
int reuse_specified = 0; int reuse_specified = 0;
int i, include = 0, num_sources = 0; int i, include = 0, num_sources = 0;
char *sources[32]; char *sources[32];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment