diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpeg.c | 41 | ||||
-rw-r--r-- | libavformat/network.h | 25 | ||||
-rw-r--r-- | libavformat/os_support.c | 12 | ||||
-rw-r--r-- | libavformat/rtmpproto.c | 4 |
4 files changed, 37 insertions, 45 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 2ade85ad52..ec04022241 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -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; diff --git a/libavformat/network.h b/libavformat/network.h index 33cd517b51..cce188f464 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -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 diff --git a/libavformat/os_support.c b/libavformat/os_support.c index a5f51e5845..1024704579 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -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) { diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 4bdda4d097..1290b7e5cf 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -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; |