summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2005-02-24 19:08:50 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-02-24 19:08:50 +0000
commit88730be65153f4a59916d971842fdaed3e0fd72b (patch)
tree1f49c5812d2382abb53df216aab8cabc3c3f56b9 /libavformat
parent53513831da58cae7603dc01270c1cf8e4252eba0 (diff)
kill warnings patch by (Måns Rullgård <mru inprovide com>)
Originally committed as revision 3977 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/ffm.c1
-rw-r--r--libavformat/flvdec.c1
-rw-r--r--libavformat/http.c4
-rw-r--r--libavformat/img2.c10
-rw-r--r--libavformat/mov.c4
-rw-r--r--libavformat/movenc.c2
-rw-r--r--libavformat/mpeg.c6
-rw-r--r--libavformat/nsvdec.c22
-rw-r--r--libavformat/nut.c2
-rw-r--r--libavformat/psxstr.c2
-rw-r--r--libavformat/tcp.c3
-rw-r--r--libavformat/udp.c17
-rw-r--r--libavformat/utils.c1
13 files changed, 33 insertions, 42 deletions
diff --git a/libavformat/ffm.c b/libavformat/ffm.c
index 2867d11e0f..7640d656c9 100644
--- a/libavformat/ffm.c
+++ b/libavformat/ffm.c
@@ -261,7 +261,6 @@ static int ffm_write_trailer(AVFormatContext *s)
{
ByteIOContext *pb = &s->pb;
FFMContext *ffm = s->priv_data;
- int i;
/* flush packets */
if (ffm->packet_ptr > ffm->packet)
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 157b50dc64..f9f4fbe40b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -44,7 +44,6 @@ static int flv_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
int offset, flags;
- AVStream *st;
s->ctx_flags |= AVFMTCTX_NOHEADER; //ok we have a header but theres no fps, codec type, sample_rate, ...
diff --git a/libavformat/http.c b/libavformat/http.c
index 85b1f319bd..2198cd548d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -49,7 +49,7 @@ typedef struct {
static int http_connect(URLContext *h, const char *path, const char *hoststr,
const char *auth);
static int http_write(URLContext *h, uint8_t *buf, int size);
-static char *b64_encode( unsigned char *src );
+static char *b64_encode(const unsigned char *src );
/* return non zero if error */
@@ -287,7 +287,7 @@ URLProtocol http_protocol = {
* b64_encode: stolen from VLC's http.c
*****************************************************************************/
-static char *b64_encode( unsigned char *src )
+static char *b64_encode( const unsigned char *src )
{
static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
unsigned int len= strlen(src);
diff --git a/libavformat/img2.c b/libavformat/img2.c
index fcf7310208..4cfd9eb6ba 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -97,16 +97,6 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
return CODEC_ID_NONE;
}
-static const char *av_id2str(const IdStrMap *tags, enum CodecID id)
-{
- while (tags->id) {
- if(tags->id == id)
- return tags->str;
- tags++;
- }
- return NULL;
-}
-
/* return -1 if no image found */
static int find_image_range(int *pfirst_index, int *plast_index,
const char *path)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1378b97ec5..87acdd419f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -415,12 +415,12 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
static int mov_read_ctab(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
- unsigned int len;
- MOV_ctab_t *t;
#if 1
url_fskip(pb, atom.size); // for now
#else
VERY VERY BROKEN, NEVER execute this, needs rewrite
+ unsigned int len;
+ MOV_ctab_t *t;
c->ctab = av_realloc(c->ctab, ++c->ctab_size);
t = c->ctab[c->ctab_size];
t->seed = get_be32(pb);
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 85965786f9..84ddb466ec 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -793,6 +793,7 @@ static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize(pb, pos);
}
+#if 0
/* TODO: Not sorted out, but not necessary either */
static int mov_write_iods_tag(ByteIOContext *pb, MOVContext *mov)
{
@@ -806,6 +807,7 @@ static int mov_write_iods_tag(ByteIOContext *pb, MOVContext *mov)
put_be16(pb, 0x01ff);
return 0x15;
}
+#endif
static int mov_write_mvhd_tag(ByteIOContext *pb, MOVContext *mov)
{
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 6399cf3062..acb33dde6c 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -530,6 +530,7 @@ static int get_vcd_padding_size(AVFormatContext *ctx, int64_t pts)
}
+#if 0 /* unused, remove? */
/* return the exact available payload size for the next packet for
stream 'stream_index'. 'pts' and 'dts' are only used to know if
timestamps are needed in the packet header. */
@@ -613,6 +614,7 @@ static int get_packet_payload_size(AVFormatContext *ctx, int stream_index,
}
return s->packet_size - buf_index;
}
+#endif
/* Write an MPEG padding packet header. */
static void put_padding_packet(AVFormatContext *ctx, ByteIOContext *pb,int packet_bytes)
@@ -979,6 +981,7 @@ static void put_vcd_padding_sector(AVFormatContext *ctx)
s->packet_number++;
}
+#if 0 /* unused, remove? */
static int64_t get_vcd_scr(AVFormatContext *ctx,int stream_index,int64_t pts)
{
MpegMuxContext *s = ctx->priv_data;
@@ -998,6 +1001,7 @@ static int64_t get_vcd_scr(AVFormatContext *ctx,int stream_index,int64_t pts)
return scr;
}
+#endif
static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){
// MpegMuxContext *s = ctx->priv_data;
@@ -1319,6 +1323,7 @@ static int find_next_start_code(ByteIOContext *pb, int *size_ptr,
return val;
}
+#if 0 /* unused, remove? */
/* XXX: optimize */
static int find_prev_start_code(ByteIOContext *pb, int *size_ptr)
{
@@ -1351,6 +1356,7 @@ static int find_prev_start_code(ByteIOContext *pb, int *size_ptr)
*size_ptr = pos_start - pos;
return start_code;
}
+#endif
/* read the next PES header. Return its position in ppos
(if not NULL), and its start code, pts and dts.
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 555a71a2ed..66a5647af4 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -280,16 +280,11 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
{
NSVContext *nsv = s->priv_data;
ByteIOContext *pb = &s->pb;
- uint32_t tag, tag1, handler;
- int codec_type, stream_index, frame_period, bit_rate, scale, rate;
- unsigned int file_size, size, nb_frames;
+ unsigned int file_size, size;
int64_t duration;
int strings_size;
int table_entries;
int table_entries_used;
- int i, n;
- AVStream *st;
- NSVStream *ast;
PRINT(("%s()\n", __FUNCTION__));
@@ -501,14 +496,7 @@ fail:
static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
NSVContext *nsv = s->priv_data;
- ByteIOContext *pb = &s->pb;
- uint32_t tag, tag1, handler;
- int codec_type, stream_index, frame_period, bit_rate, scale, rate;
- unsigned int size, nb_frames;
- int table_entries;
- int i, n, err;
- AVStream *st;
- NSVStream *ast;
+ int i, err;
PRINT(("%s()\n", __FUNCTION__));
PRINT(("filename '%s'\n", s->filename));
@@ -543,7 +531,6 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header)
AVStream *st[2] = {NULL, NULL};
NSVStream *nst;
AVPacket *pkt;
- uint32_t v = 0;
int i, err = 0;
uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */
uint32_t vsize;
@@ -667,7 +654,6 @@ null_chunk_retry:
static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
{
NSVContext *nsv = s->priv_data;
- ByteIOContext *pb = &s->pb;
int i, err = 0;
PRINT(("%s()\n", __FUNCTION__));
@@ -695,18 +681,20 @@ static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
+#if 0
NSVContext *avi = s->priv_data;
AVStream *st;
NSVStream *ast;
int frame_number, i;
int64_t pos;
+#endif
return -1;
}
static int nsv_read_close(AVFormatContext *s)
{
- int i;
+/* int i; */
NSVContext *nsv = s->priv_data;
if (nsv->index_entries)
diff --git a/libavformat/nut.c b/libavformat/nut.c
index f43797582d..2592d320f2 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -1051,7 +1051,7 @@ static int decode_info_header(NUTContext *nut){
}
if(!strcmp(type, "v")){
- int value= get_v(bc);
+ get_v(bc);
}else{
if(!strcmp(name, "Author"))
get_str(bc, s->author, sizeof(s->author));
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index 57fc97d3a2..eca6316f6c 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -107,6 +107,7 @@ static int str_probe(AVProbeData *p)
return 50;
}
+#if 0
static void dump(unsigned char *buf,size_t len)
{
int i;
@@ -117,6 +118,7 @@ static void dump(unsigned char *buf,size_t len)
}
av_log(NULL, AV_LOG_DEBUG, "\n");
}
+#endif
static int str_read_header(AVFormatContext *s,
AVFormatParameters *ap)
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 8ec84ec4b6..33702e0ec0 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -57,8 +57,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
struct sockaddr_in dest_addr;
char hostname[1024], *q;
int port, fd = -1;
- TCPContext *s;
- const char *p;
+ TCPContext *s = NULL;
fd_set wfds;
int fd_max, ret;
struct timeval tv;
diff --git a/libavformat/udp.c b/libavformat/udp.c
index b95f238d26..8b5fc32a2c 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -160,14 +160,14 @@ int udp_ipv6_set_local(URLContext *h) {
socklen_t addrlen;
char sbuf[NI_MAXSERV];
char hbuf[NI_MAXHOST];
- struct addrinfo *res0;
+ struct addrinfo *res0 = NULL;
int family;
if (s->local_port != 0) {
res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, AF_UNSPEC, AI_PASSIVE);
- if (res0 == 0) return -1;
+ if (res0 == 0)
+ goto fail;
family = res0->ai_family;
- freeaddrinfo(res0);
} else {
family = s->dest_addr.ss_family;
}
@@ -183,6 +183,8 @@ int udp_ipv6_set_local(URLContext *h) {
perror("bind");
goto fail;
}
+ freeaddrinfo(res0);
+ res0 = NULL;
}
addrlen = sizeof(clientaddr);
@@ -207,6 +209,8 @@ int udp_ipv6_set_local(URLContext *h) {
#else
close(udp_fd);
#endif
+ if(res0)
+ freeaddrinfo(res0);
return -1;
}
@@ -274,13 +278,16 @@ int udp_get_file_handle(URLContext *h)
/* return non zero if error */
static int udp_open(URLContext *h, const char *uri, int flags)
{
- struct sockaddr_in my_addr, my_addr1;
char hostname[1024];
int port, udp_fd = -1, tmp;
UDPContext *s = NULL;
- int is_output, len;
+ int is_output;
const char *p;
char buf[256];
+#ifndef CONFIG_IPV6
+ struct sockaddr_in my_addr, my_addr1;
+ int len;
+#endif
h->is_streamed = 1;
h->max_packet_size = 1472;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3f74ed529b..0e008da974 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1275,7 +1275,6 @@ av_log(s, AV_LOG_DEBUG, "%Ld %Ld %Ld / %Ld %Ld %Ld target:%Ld limit:%Ld start:%L
}
static int av_seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
- AVInputFormat *avif= s->iformat;
int64_t pos_min, pos_max;
#if 0
AVStream *st;