Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtmp: rtmp_parse_result() add case for video and audio packets to avoid undesired debug output.
  configure: Move the getaddrinfo function check into the network block
  configure: Remove an unused 'have' item
  mpeg: remove disabled code
  libfdk-aac: Check if cutoff value is valid
  network: Always use our version of gai_strerror on windows
  network: Undefine existing gai_strerror definitions
  network: Extend the fallback gai_strerror implementation to handle more error codes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-16 20:45:35 +02:00
commit 9db747b2a3
6 changed files with 44 additions and 48 deletions

5
configure vendored
View File

@ -1190,7 +1190,6 @@ HAVE_LIST="
clock_gettime
closesocket
cmov
CommandLineToArgvW
cpuid
dcbzl
dev_bktr_ioctl_bt848_h
@ -3155,6 +3154,7 @@ if enabled network; then
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_header netinet/sctp.h
check_func getaddrinfo $network_extralibs
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
@ -3163,6 +3163,7 @@ if enabled network; then
network_extralibs="-lws2" || \
{ check_func_headers winsock2.h closesocket -lws2_32 && \
network_extralibs="-lws2_32"; }
check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
check_type ws2tcpip.h socklen_t
check_type ws2tcpip.h "struct addrinfo"
check_type ws2tcpip.h "struct group_source_req"
@ -3183,8 +3184,6 @@ check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
check_func fcntl
check_func fork
check_func getaddrinfo $network_extralibs ||
check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
check_func gethrtime
check_func getopt
check_func getrusage

View File

@ -231,6 +231,11 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
}
if (avctx->cutoff > 0) {
if (avctx->cutoff < (avctx->sample_rate + 255) >> 8) {
av_log(avctx, AV_LOG_ERROR, "cutoff valid range is %d-20000\n",
(avctx->sample_rate + 255) >> 8);
goto error;
}
if ((err = aacEncoder_SetParam(s->handle, AACENC_BANDWIDTH,
avctx->cutoff)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwith to %d: %s\n",

View File

@ -167,41 +167,6 @@ static int find_next_start_code(AVIOContext *pb, int *size_ptr,
return val;
}
#if 0 /* unused, remove? */
/* XXX: optimize */
static int find_prev_start_code(AVIOContext *pb, int *size_ptr)
{
int64_t pos, pos_start;
int max_size, start_code;
max_size = *size_ptr;
pos_start = avio_tell(pb);
/* in order to go faster, we fill the buffer */
pos = pos_start - 16386;
if (pos < 0)
pos = 0;
avio_seek(pb, pos, SEEK_SET);
avio_r8(pb);
pos = pos_start;
for(;;) {
pos--;
if (pos < 0 || (pos_start - pos) >= max_size) {
start_code = -1;
goto the_end;
}
avio_seek(pb, pos, SEEK_SET);
start_code = avio_rb32(pb);
if ((start_code & 0xffffff00) == 0x100)
break;
}
the_end:
*size_ptr = pos_start - pos;
return start_code;
}
#endif
/**
* Extract stream types from a program stream map
* According to ISO/IEC 13818-1 ('MPEG-2 Systems') table 2-35
@ -331,12 +296,6 @@ static int mpegps_read_pes_header(AVFormatContext *s,
}
} else if ((c & 0xc0) == 0x80) {
/* mpeg 2 PES */
#if 0 /* some streams have this field set for no apparent reason */
if ((c & 0x30) != 0) {
/* Encrypted multiplex not handled */
goto redo;
}
#endif
flags = avio_r8(s->pb);
header_len = avio_r8(s->pb);
len -= 2;

View File

@ -110,17 +110,33 @@ struct addrinfo {
#endif
/* getaddrinfo constants */
#ifndef EAI_AGAIN
#define EAI_AGAIN 2
#endif
#ifndef EAI_BADFLAGS
#define EAI_BADFLAGS 3
#endif
#ifndef EAI_FAIL
#define EAI_FAIL 4
#endif
#ifndef EAI_FAMILY
#define EAI_FAMILY 5
#endif
#ifndef EAI_MEMORY
#define EAI_MEMORY 6
#endif
#ifndef EAI_NODATA
#define EAI_NODATA 7
#endif
#ifndef EAI_NONAME
#define EAI_NONAME 8
#endif
#ifndef EAI_SERVICE
#define EAI_SERVICE 9
#endif
#ifndef EAI_SOCKTYPE
#define EAI_SOCKTYPE 10
#endif
#ifndef AI_PASSIVE
#define AI_PASSIVE 1
@ -161,10 +177,13 @@ void ff_freeaddrinfo(struct addrinfo *res);
int ff_getnameinfo(const struct sockaddr *sa, int salen,
char *host, int hostlen,
char *serv, int servlen, int flags);
const char *ff_gai_strerror(int ecode);
#define getaddrinfo ff_getaddrinfo
#define freeaddrinfo ff_freeaddrinfo
#define getnameinfo ff_getnameinfo
#endif
#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
const char *ff_gai_strerror(int ecode);
#undef gai_strerror
#define gai_strerror ff_gai_strerror
#endif

View File

@ -240,18 +240,28 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
return 0;
}
#endif /* !HAVE_GETADDRINFO */
#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
const char *ff_gai_strerror(int ecode)
{
switch(ecode) {
case EAI_AGAIN : return "Temporary failure in name resolution";
case EAI_BADFLAGS: return "Invalid flags for ai_flags";
case EAI_FAIL : return "A non-recoverable error occurred";
case EAI_FAMILY : return "The address family was not recognized or the address length was invalid for the specified family";
case EAI_MEMORY : return "Memory allocation failure";
#if EAI_NODATA != EAI_NONAME
case EAI_NODATA : return "No address associated with hostname";
#endif
case EAI_NONAME : return "The name does not resolve for the supplied parameters";
case EAI_SERVICE: return "servname not supported for ai_socktype";
case EAI_SOCKTYPE: return "ai_socktype not supported";
}
return "Unknown error";
}
#endif
#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */
int ff_socket_nonblock(int socket, int enable)
{

View File

@ -959,6 +959,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
return ret;
}
break;
case RTMP_PT_VIDEO:
case RTMP_PT_AUDIO:
/* Audio and Video packets are parsed in get_packet() */
break;
default:
av_log(s, AV_LOG_VERBOSE, "Unknown packet type received 0x%02X\n", pkt->type);
break;