diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-10 01:12:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-10 01:12:08 +0100 |
commit | 8e31dbc1dcb56d40bcc1dd45840aaef0d37bae51 (patch) | |
tree | 08342b8eede67521c32c139ebb4d9ddd04e871fa /libavformat | |
parent | 1af9fdc3baa47596757da7c401d58710cef45c75 (diff) | |
parent | ffae713a5b3a0d20ff958d8bd58a052b495c38fd (diff) | |
download | ffmpeg-8e31dbc1dcb56d40bcc1dd45840aaef0d37bae51.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
Fix a bunch of common typos.
build: Skip compiling xvmc.h under the correct condition.
configure: darwin: Change dylib install names to include major version.
mpegts: Always honor a registration descriptor if present and there is no other codec information.
aacdec: Fix SCE parity check.
aacdec: Fix out of array writes (stack).
rtsp: Only set the ttl parameter if the server actually gave a value
udp: Set ttl for read-write streams, too, not only for write-only ones
udp: Only bind to the multicast address if in read-only mode
udp: Clarify the comment about binding the multicast address
udp: Reorder comments
Conflicts:
libavcodec/aacdec.c
tools/patcheck
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegts.c | 3 | ||||
-rw-r--r-- | libavformat/r3d.c | 2 | ||||
-rw-r--r-- | libavformat/rtsp.c | 6 | ||||
-rw-r--r-- | libavformat/udp.c | 14 |
4 files changed, 15 insertions, 10 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 52a6f6e96f..cff970ee4e 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1385,8 +1385,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type case 0x05: /* registration descriptor */ st->codec->codec_tag = bytestream_get_le32(pp); av_dlog(fc, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag); - if (st->codec->codec_id == CODEC_ID_NONE && - stream_type == STREAM_TYPE_PRIVATE_DATA) + if (st->codec->codec_id == CODEC_ID_NONE) mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types); break; case 0x52: /* stream identifier descriptor */ diff --git a/libavformat/r3d.c b/libavformat/r3d.c index b37f065693..757e583213 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -288,7 +288,7 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom) tmp = avio_rb32(s->pb); av_dlog(s, "packet num %d\n", tmp); - tmp = avio_rb16(s->pb); // unkown + tmp = avio_rb16(s->pb); // unknown av_dlog(s, "unknown %d\n", tmp); tmp = avio_r8(s->pb); // major version diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 023411c9f5..f2f69642ec 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1345,7 +1345,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, break; } case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: { - char url[1024], namebuf[50]; + char url[1024], namebuf[50], optbuf[20] = ""; struct sockaddr_storage addr; int port, ttl; @@ -1358,10 +1358,12 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, port = rtsp_st->sdp_port; ttl = rtsp_st->sdp_ttl; } + if (ttl > 0) + snprintf(optbuf, sizeof(optbuf), "?ttl=%d", ttl); getnameinfo((struct sockaddr*) &addr, sizeof(addr), namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, - port, "?ttl=%d", ttl); + port, "%s", optbuf); if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE, &s->interrupt_callback, NULL) < 0) { err = AVERROR_INVALIDDATA; diff --git a/libavformat/udp.c b/libavformat/udp.c index d3e4d906a7..cfc5ae51db 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -473,13 +473,16 @@ static int udp_open(URLContext *h, const char *uri, int flags) goto fail; } - /* the bind is needed to give a port to the socket now */ - /* if multicast, try the multicast address bind first */ - if (s->is_multicast && (h->flags & AVIO_FLAG_READ)) { + /* If multicast, try binding the multicast address first, to avoid + * receiving UDP packets from other sources aimed at the same UDP + * port. This fails on windows. This makes sending to the same address + * using sendto() fail, so only do it if we're opened in read-only mode. */ + if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) { bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len); } /* bind to the local address if not multicast or if the multicast * bind failed */ + /* the bind is needed to give a port to the socket now */ if (bind_ret < 0 && bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0) { av_log(h, AV_LOG_ERROR, "bind failed: %s\n", strerror(errno)); goto fail; @@ -490,11 +493,12 @@ static int udp_open(URLContext *h, const char *uri, int flags) s->local_port = udp_port(&my_addr, len); if (s->is_multicast) { - if (!(h->flags & AVIO_FLAG_READ)) { + if (h->flags & AVIO_FLAG_WRITE) { /* output */ if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0) goto fail; - } else { + } + if (h->flags & AVIO_FLAG_READ) { /* input */ if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0) goto fail; |