diff options
author | Stefan Huehner <stefan@huehner.org> | 2006-06-18 11:33:14 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2006-06-18 11:33:14 +0000 |
commit | 7b49ce2e344a5f8864d8365d57f3c6c743f0c8f7 (patch) | |
tree | 12c908af01e95ca2df7f4ca20be592871527577e /libavformat | |
parent | 3b9bee88891d1c170eb42d1ef51c5cd7f19b5ba5 (diff) | |
download | ffmpeg-7b49ce2e344a5f8864d8365d57f3c6c743f0c8f7.tar.gz |
Add const to (mostly) char* and make some functions static, which aren't used
outside their declaring source file and which have no corresponding prototype.
patch by Stefan Huehner stefan^^@^^huehner^^.^^org
Originally committed as revision 5497 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aiff.c | 2 | ||||
-rw-r--r-- | libavformat/movenc.c | 2 | ||||
-rw-r--r-- | libavformat/mpegts.c | 12 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 4 | ||||
-rw-r--r-- | libavformat/rtsp.c | 6 | ||||
-rw-r--r-- | libavformat/udp.c | 14 |
6 files changed, 20 insertions, 20 deletions
diff --git a/libavformat/aiff.c b/libavformat/aiff.c index 3dbe6b1524..0e7152ca70 100644 --- a/libavformat/aiff.c +++ b/libavformat/aiff.c @@ -110,7 +110,7 @@ static int fix_bps(int codec_id) } /* Returns the number of sound data frames or negative on error */ -unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, +static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, int size, unsigned version) { AVExtFloat ext; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index cc24e314ab..5920141173 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1341,7 +1341,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov, return updateSize(pb, pos); } -int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov) +static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov) { put_be32(pb, 8); // placeholder for extended size field (64 bit) put_tag(pb, "wide"); diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 54e7043089..5575cccda4 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -151,7 +151,7 @@ static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1, } } -MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid, +static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid, SectionCallback *section_cb, void *opaque, int check_crc) @@ -183,7 +183,7 @@ MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid, return filter; } -MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid, +static MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid, PESCallback *pes_cb, void *opaque) { @@ -205,7 +205,7 @@ MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid, return filter; } -void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter) +static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter) { int pid; @@ -609,7 +609,7 @@ static void pat_scan_cb(void *opaque, const uint8_t *section, int section_len) ts->pat_filter = NULL; } -void mpegts_set_service(MpegTSContext *ts, int sid, +static void mpegts_set_service(MpegTSContext *ts, int sid, SetServiceCallback *set_service_cb, void *opaque) { ts->set_service_cb = set_service_cb; @@ -696,7 +696,7 @@ static void sdt_cb(void *opaque, const uint8_t *section, int section_len) } /* scan services in a transport stream by looking at the SDT */ -void mpegts_scan_sdt(MpegTSContext *ts) +static void mpegts_scan_sdt(MpegTSContext *ts) { ts->sdt_filter = mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1); @@ -704,7 +704,7 @@ void mpegts_scan_sdt(MpegTSContext *ts) /* scan services in a transport stream by looking at the PAT (better than nothing !) */ -void mpegts_scan_pat(MpegTSContext *ts) +static void mpegts_scan_pat(MpegTSContext *ts) { ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID, pat_scan_cb, ts, 1); diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 7086b5dc89..ad19516b46 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -34,7 +34,7 @@ typedef struct MpegTSSection { } MpegTSSection; /* NOTE: 4 bytes must be left at the end for the crc32 */ -void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) +static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) { unsigned int crc; unsigned char packet[TS_PACKET_SIZE]; @@ -89,7 +89,7 @@ static inline void put16(uint8_t **q_ptr, int val) *q_ptr = q; } -int mpegts_write_section1(MpegTSSection *s, int tid, int id, +static int mpegts_write_section1(MpegTSSection *s, int tid, int id, int version, int sec_num, int last_sec_num, uint8_t *buf, int len) { diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 31af3c9c89..a4bd40f25a 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -145,7 +145,7 @@ static int sdp_parse_rtpmap(AVCodecContext *codec, int payload_type, const char char buf[256]; int i; AVCodec *c; - char *c_name; + const char *c_name; /* Loop into AVRtpDynamicPayloadTypes[] and AVRtpPayloadTypes[] and see if we can handle this kind of payload */ @@ -169,7 +169,7 @@ static int sdp_parse_rtpmap(AVCodecContext *codec, int payload_type, const char c = avcodec_find_decoder(codec->codec_id); if (c && c->name) - c_name = (char *)c->name; + c_name = c->name; else c_name = (char *)NULL; @@ -255,7 +255,7 @@ static void sdp_parse_fmtp_config(AVCodecContext *codec, char *attr, char *value typedef struct attrname_map { - char *str; + const char *str; uint16_t type; uint32_t offset; } attrname_map_t; diff --git a/libavformat/udp.c b/libavformat/udp.c index ee4f67d654..fb72096db5 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -51,7 +51,7 @@ typedef struct { #ifdef CONFIG_IPV6 -int udp_ipv6_is_multicast_address(const struct sockaddr *addr) { +static int udp_ipv6_is_multicast_address(const struct sockaddr *addr) { if (addr->sa_family == AF_INET) return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr)); if (addr->sa_family == AF_INET6) @@ -59,7 +59,7 @@ int udp_ipv6_is_multicast_address(const struct sockaddr *addr) { return -1; } -int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr) { +static int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr) { if (addr->sa_family == AF_INET) { if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, sizeof(mcastTTL)) < 0) { perror("setsockopt(IP_MULTICAST_TTL)"); @@ -75,7 +75,7 @@ int udp_ipv6_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr) return 0; } -int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) { +static int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) { struct ip_mreq mreq; struct ipv6_mreq mreq6; if (addr->sa_family == AF_INET) { @@ -97,7 +97,7 @@ int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) { return 0; } -int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) { +static int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) { struct ip_mreq mreq; struct ipv6_mreq mreq6; if (addr->sa_family == AF_INET) { @@ -119,7 +119,7 @@ int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) { return 0; } -struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) { +static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) { struct addrinfo hints, *res = 0; int error; char sport[16]; @@ -144,7 +144,7 @@ struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, return res; } -int udp_ipv6_set_remote_url(URLContext *h, const char *uri) { +static int udp_ipv6_set_remote_url(URLContext *h, const char *uri) { UDPContext *s = h->priv_data; char hostname[256]; int port; @@ -158,7 +158,7 @@ int udp_ipv6_set_remote_url(URLContext *h, const char *uri) { return 0; } -int udp_ipv6_set_local(URLContext *h) { +static int udp_ipv6_set_local(URLContext *h) { UDPContext *s = h->priv_data; int udp_fd = -1; struct sockaddr_storage clientaddr; |