From a6f7fc8f3b1a878de3d3f7c054eba555ed7918e4 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Sat, 4 May 2013 10:54:20 +0200 Subject: [PATCH 1/4] Prepare for 9.6 Release --- RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE b/RELEASE index 592f36ef3a..c026ac828d 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -9.5 +9.6 From 5772cbb3435e06672a5c882c6f36101f407db818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 6 May 2013 14:48:25 +0300 Subject: [PATCH 2/4] swscale: Use alpha from the right row in yuva2rgba_c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every other pixel had the alpha channel taken from the wrong row. This fixes bug 504. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit 6e293d111fcad27d52a2ef5ad77b1009f1743396) Signed-off-by: Martin Storsjö --- libswscale/yuv2rgb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 1dbd0d8e10..2ffbf5b5d6 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -264,16 +264,16 @@ YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) PUTRGBA(dst_2, py_2, pa_2, 0, 24); LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_1, 1, 24); - PUTRGBA(dst_1, py_1, pa_2, 1, 24); + PUTRGBA(dst_2, py_2, pa_2, 1, 24); + PUTRGBA(dst_1, py_1, pa_1, 1, 24); LOADCHROMA(2); PUTRGBA(dst_1, py_1, pa_1, 2, 24); PUTRGBA(dst_2, py_2, pa_2, 2, 24); LOADCHROMA(3); - PUTRGBA(dst_2, py_2, pa_1, 3, 24); - PUTRGBA(dst_1, py_1, pa_2, 3, 24); + PUTRGBA(dst_2, py_2, pa_2, 3, 24); + PUTRGBA(dst_1, py_1, pa_1, 3, 24); pa_1 += 8; \ pa_2 += 8; \ ENDYUV2RGBLINE(8, 0) @@ -282,8 +282,8 @@ ENDYUV2RGBLINE(8, 0) PUTRGBA(dst_2, py_2, pa_2, 0, 24); LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_1, 1, 24); - PUTRGBA(dst_1, py_1, pa_2, 1, 24); + PUTRGBA(dst_2, py_2, pa_2, 1, 24); + PUTRGBA(dst_1, py_1, pa_1, 1, 24); pa_1 += 4; \ pa_2 += 4; \ ENDYUV2RGBLINE(8, 1) From 52ab9e898485b370a4da46febb91e1ba50a1c357 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 4 May 2013 12:18:57 +0200 Subject: [PATCH 3/4] wav: Always seek to an even offset RIFF chunks are aligned to 16bit according to the specification. Bug-Id:500 CC:libav-stable@libav.org (cherry picked from commit ac87eaf856e0fb51917266b899bb15d19b907baf) Signed-off-by: Reinhard Tartler --- libavformat/wavdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index c9f7abbbcf..e9dda92f0b 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -50,6 +50,12 @@ static int64_t next_tag(AVIOContext *pb, uint32_t *tag) return avio_rl32(pb); } +/* RIFF chunks are always on a even offset. */ +static int64_t wav_seek_tag(AVIOContext *s, int64_t offset, int whence) +{ + return avio_seek(s, offset + (offset & 1), whence); +} + /* return the size of the found tag */ static int64_t find_tag(AVIOContext *pb, uint32_t tag1) { @@ -62,7 +68,7 @@ static int64_t find_tag(AVIOContext *pb, uint32_t tag1) size = next_tag(pb, &tag); if (tag == tag1) break; - avio_skip(pb, size); + wav_seek_tag(pb, size, SEEK_CUR); } return size; } @@ -301,7 +307,7 @@ static int wav_read_header(AVFormatContext *s) /* seek to next tag unless we know that we'll run into EOF */ if ((avio_size(pb) > 0 && next_tag_ofs >= avio_size(pb)) || - avio_seek(pb, next_tag_ofs, SEEK_SET) < 0) { + wav_seek_tag(pb, next_tag_ofs, SEEK_SET) < 0) { break; } } From 1ab4578c88dc3e1407da15471bd323ba40c3ebbb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 14 Jan 2013 00:02:50 +0100 Subject: [PATCH 4/4] lavc: Fix assignments in if() when calling ff_af_queue_add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö (cherry picked from commit 1d7ffd06e41e44d8932d0dd62caa2da17947d8c4) Signed-off-by: Luca Barbato --- libavcodec/aacenc.c | 2 +- libavcodec/libfaac.c | 2 +- libavcodec/libfdk-aacenc.c | 2 +- libavcodec/libmp3lame.c | 2 +- libavcodec/libopencore-amr.c | 2 +- libavcodec/libspeexenc.c | 2 +- libavcodec/libvo-aacenc.c | 2 +- libavcodec/libvorbis.c | 2 +- libavcodec/nellymoserenc.c | 2 +- libavcodec/ra144enc.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 5558e39d17..6f582ca8aa 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -518,7 +518,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, /* add current frame to queue */ if (frame) { - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c index 745fee2674..d32e776678 100644 --- a/libavcodec/libfaac.c +++ b/libavcodec/libfaac.c @@ -200,7 +200,7 @@ static int Faac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, /* add current frame to the queue */ if (frame) { - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index 00397d58ed..c40bcedba5 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -334,7 +334,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in_buf.bufElSizes = &in_buffer_element_size; /* add current frame to the queue */ - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 8746573224..2e501cac0b 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -236,7 +236,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, /* add current frame to the queue */ if (frame) { - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index fdd7de9c53..be98b1f93b 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -265,7 +265,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (frame->nb_samples < avctx->frame_size - avctx->delay) s->enc_last_frame = -1; } - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) { + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) { av_freep(&flush_buf); return ret; } diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index e30185a758..4277e62e4c 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -287,7 +287,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, speex_encode_stereo_int(samples, s->header.frame_size, &s->bits); speex_encode_int(s->enc_state, samples, &s->bits); s->pkt_frame_count++; - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } else { /* handle end-of-stream */ diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c index d09f1ed109..31822b5d73 100644 --- a/libavcodec/libvo-aacenc.c +++ b/libavcodec/libvo-aacenc.c @@ -157,7 +157,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, samples = (VO_PBYTE)frame->data[0]; } /* add current frame to the queue */ - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c index a31d476c74..092cbbc0a7 100644 --- a/libavcodec/libvorbis.c +++ b/libavcodec/libvorbis.c @@ -279,7 +279,7 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, av_log(avctx, AV_LOG_ERROR, "error in vorbis_analysis_wrote()\n"); return vorbis_error_to_averror(ret); } - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } else { if (!s->eof) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 487cffd2dc..122282623c 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -397,7 +397,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (frame->nb_samples >= NELLY_BUF_LEN) s->last_frame = 1; } - if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; } else { memset(s->buf + NELLY_BUF_LEN, 0, NELLY_SAMPLES * sizeof(*s->buf)); diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index 5b5de76434..b9473ac197 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -537,7 +537,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, for (; i < frame->nb_samples; i++) ractx->curr_block[i] = samples[i] >> 2; - if ((ret = ff_af_queue_add(&ractx->afq, frame) < 0)) + if ((ret = ff_af_queue_add(&ractx->afq, frame)) < 0) return ret; } else ractx->last_frame = 1;