From 06deaf8ad33a996c8ad606e29197ec9712960067 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 1 Aug 2012 16:13:04 -0400 Subject: [PATCH 1/4] idcin: return 0 from idcin_read_packet() on success. This matches the AVInputFormat.read_packet() API. --- libavformat/idcin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 87117eba91..b7e87a719a 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -341,7 +341,7 @@ static int idcin_read_packet(AVFormatContext *s, if (idcin->audio_present) idcin->next_chunk_is_video ^= 1; - return ret; + return 0; } static int idcin_read_seek(AVFormatContext *s, int stream_index, From fba8e5b608577fc660989d0057a55818254a3744 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 9 Jan 2013 20:49:34 +0100 Subject: [PATCH 2/4] oggdec: fix faulty cleanup prototype --- libavformat/oggparsevorbis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index fbe6c4fb41..bb41b52ca2 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -192,7 +192,7 @@ fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv, return offset; } -static int vorbis_cleanup(AVFormatContext *s, int idx) +static void vorbis_cleanup(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; From a800fd5fc797b8bdfc943b0c7bbfccac3d2ea30a Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 9 Jan 2013 20:50:06 +0100 Subject: [PATCH 3/4] yuv4mpeg: do not use deprecated functions Use the libavutil replacement. --- libavformat/yuv4mpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index a8077a00f0..699a63a681 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -18,6 +18,8 @@ * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include "libavutil/pixdesc.h" #include "avformat.h" #include "internal.h" @@ -128,8 +130,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) { // Adjust for smaller Cb and Cr planes - avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift, - &v_chroma_shift); + av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift, + &v_chroma_shift); width >>= h_chroma_shift; height >>= v_chroma_shift; From ed79093222ceb42f0c3a39095a69af0b32be5450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 9 Jan 2013 19:41:21 +0200 Subject: [PATCH 4/4] rtpdec: Add a terminating null byte at the end of the SDES/CNAME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required by RFC 3550 (section 6.5): The list of items in each chunk MUST be terminated by one or more null octets, the first of which is interpreted as an item type of zero to denote the end of the list. This was implicitly added as padding before, unless the host name length matched up so no padding was added. This makes wireshark parse the packets properly if other RTCP items are appended to the same packet. Signed-off-by: Martin Storsjö --- libavformat/rtpdec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 4064e70192..9734ecf16b 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -307,13 +307,14 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, avio_w8(pb, (RTP_VERSION << 6) + 1); /* 1 report block */ avio_w8(pb, RTCP_SDES); len = strlen(s->hostname); - avio_wb16(pb, (6 + len + 3) / 4); /* length in words - 1 */ + avio_wb16(pb, (7 + len + 3) / 4); /* length in words - 1 */ avio_wb32(pb, s->ssrc + 1); avio_w8(pb, 0x01); avio_w8(pb, len); avio_write(pb, s->hostname, len); + avio_w8(pb, 0); /* END */ // padding - for (len = (6 + len) % 4; len % 4; len++) + for (len = (7 + len) % 4; len % 4; len++) avio_w8(pb, 0); avio_flush(pb);