diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-17 01:58:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-17 01:58:54 +0100 |
commit | 52cea9ce9209bf4ee0af6475b7db880e962cb924 (patch) | |
tree | 43eb6d367ddce28829376d36ebffd7eed53c2a39 | |
parent | 4fc22e85c0117fc6f1596ff4bfd89ac00c17cfea (diff) | |
parent | 01a4e7f623a2e6dc95862f9a56c777f058d7bfaf (diff) | |
download | ffmpeg-52cea9ce9209bf4ee0af6475b7db880e962cb924.tar.gz |
Merge commit '01a4e7f623a2e6dc95862f9a56c777f058d7bfaf' into release/0.10
* commit '01a4e7f623a2e6dc95862f9a56c777f058d7bfaf':
lavf: Bump minor version to distinguish branch and master version numbers
vp6: properly fail on unsupported feature
mp3: properly forward mp_decode_frame errors
mpeg12: do not decode extradata more than once.
indeo3: when freeing buffers, set pointers referencing them to NULL as well
indeo3: ensure that decoded cell data is in 7-bit range as presumed by decoder
avconv: fix copying per-stream metadata.
id3v2: fix reading unsynchronized frames.
h264: Fix parameters to ff_er_add_slice() call
build: fix 'clean' target
Conflicts:
avconv.c
libavcodec/mpeg12.h
libavformat/id3v2.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | common.mak | 9 | ||||
-rw-r--r-- | doc/APIchanges | 2 | ||||
-rw-r--r-- | libavcodec/h264.c | 7 | ||||
-rw-r--r-- | libavcodec/indeo3.c | 31 | ||||
-rw-r--r-- | libavcodec/mpeg12.c | 3 | ||||
-rw-r--r-- | libavcodec/mpeg12.h | 1 | ||||
-rw-r--r-- | libavcodec/mpegaudiodec.c | 32 | ||||
-rw-r--r-- | libavcodec/vp6.c | 4 | ||||
-rw-r--r-- | library.mak | 3 |
10 files changed, 57 insertions, 36 deletions
@@ -137,7 +137,6 @@ uninstall-data: clean:: $(RM) $(ALLPROGS) $(ALLPROGS_G) $(RM) $(CLEANSUFFIXES) - $(RM) $(TOOLS) $(RM) $(CLEANSUFFIXES:%=tools/%) $(RM) coverage.info $(RM) -r coverage-html diff --git a/common.mak b/common.mak index b7786c5c67..c21bff3d1c 100644 --- a/common.mak +++ b/common.mak @@ -117,4 +117,13 @@ CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver *.gcno *.gcda DISTCLEANSUFFIXES = *.pc LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp +define RULES +clean:: + $(RM) $(OBJS) $(OBJS:.o=.d) + $(RM) $(HOSTPROGS) + $(RM) $(TOOLS) +endef + +$(eval $(RULES)) + -include $(wildcard $(OBJS:.o=.d) $(TESTOBJS:.o=.d)) diff --git a/doc/APIchanges b/doc/APIchanges index 010fee5f8e..ed13f21bd9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -25,7 +25,7 @@ API changes, most recent first: 2012-03-04 - xxxxxxx - lavu 51.22.1 - error.h Add AVERROR_UNKNOWN -2012-02-29 - xxxxxxx - lavf 53.21.0 +2012-02-29 - xxxxxxx - lavf 53.21.1 Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags(). 2012-02-29 - xxxxxxx - lavu 51.22.0 - intfloat.h diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7632e95a86..1630235ee0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3773,9 +3773,10 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask); return 0; - }else{ - ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask); - + } else { + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, + s->mb_x, s->mb_y, + ER_MB_END & part_mask); return -1; } } diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 5479c55a32..82563d896b 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -207,6 +207,7 @@ static av_cold void free_frame_buffers(Indeo3DecodeContext *ctx) for (p = 0; p < 3; p++) { av_freep(&ctx->planes[p].buffers[0]); av_freep(&ctx->planes[p].buffers[1]); + ctx->planes[p].pixels[0] = ctx->planes[p].pixels[1] = 0; } } @@ -347,8 +348,10 @@ if (*data_ptr >= last_ptr) \ fill_64(dst, pix64, num_lines << 1, row_offset) #define APPLY_DELTA_4 \ - AV_WN16A(dst + line_offset , AV_RN16A(ref ) + delta_tab->deltas[dyad1]);\ - AV_WN16A(dst + line_offset + 2, AV_RN16A(ref + 2) + delta_tab->deltas[dyad2]);\ + AV_WN16A(dst + line_offset ,\ + (AV_RN16A(ref ) + delta_tab->deltas[dyad1]) & 0x7F7F);\ + AV_WN16A(dst + line_offset + 2,\ + (AV_RN16A(ref + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\ if (mode >= 3) {\ if (is_top_of_cell && !cell->ypos) {\ AV_COPY32(dst, dst + row_offset);\ @@ -361,14 +364,14 @@ if (*data_ptr >= last_ptr) \ /* apply two 32-bit VQ deltas to next even line */\ if (is_top_of_cell) { \ AV_WN32A(dst + row_offset , \ - replicate32(AV_RN32A(ref )) + delta_tab->deltas_m10[dyad1]);\ + (replicate32(AV_RN32A(ref )) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\ AV_WN32A(dst + row_offset + 4, \ - replicate32(AV_RN32A(ref + 4)) + delta_tab->deltas_m10[dyad2]);\ + (replicate32(AV_RN32A(ref + 4)) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\ } else { \ AV_WN32A(dst + row_offset , \ - AV_RN32A(ref ) + delta_tab->deltas_m10[dyad1]);\ + (AV_RN32A(ref ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\ AV_WN32A(dst + row_offset + 4, \ - AV_RN32A(ref + 4) + delta_tab->deltas_m10[dyad2]);\ + (AV_RN32A(ref + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\ } \ /* odd lines are not coded but rather interpolated/replicated */\ /* first line of the cell on the top of image? - replicate */\ @@ -382,22 +385,22 @@ if (*data_ptr >= last_ptr) \ #define APPLY_DELTA_1011_INTER \ if (mode == 10) { \ AV_WN32A(dst , \ - AV_RN32A(dst ) + delta_tab->deltas_m10[dyad1]);\ + (AV_RN32A(dst ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\ AV_WN32A(dst + 4 , \ - AV_RN32A(dst + 4 ) + delta_tab->deltas_m10[dyad2]);\ + (AV_RN32A(dst + 4 ) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\ AV_WN32A(dst + row_offset , \ - AV_RN32A(dst + row_offset ) + delta_tab->deltas_m10[dyad1]);\ + (AV_RN32A(dst + row_offset ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\ AV_WN32A(dst + row_offset + 4, \ - AV_RN32A(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]);\ + (AV_RN32A(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\ } else { \ AV_WN16A(dst , \ - AV_RN16A(dst ) + delta_tab->deltas[dyad1]);\ + (AV_RN16A(dst ) + delta_tab->deltas[dyad1]) & 0x7F7F);\ AV_WN16A(dst + 2 , \ - AV_RN16A(dst + 2 ) + delta_tab->deltas[dyad2]);\ + (AV_RN16A(dst + 2 ) + delta_tab->deltas[dyad2]) & 0x7F7F);\ AV_WN16A(dst + row_offset , \ - AV_RN16A(dst + row_offset ) + delta_tab->deltas[dyad1]);\ + (AV_RN16A(dst + row_offset ) + delta_tab->deltas[dyad1]) & 0x7F7F);\ AV_WN16A(dst + row_offset + 2, \ - AV_RN16A(dst + row_offset + 2) + delta_tab->deltas[dyad2]);\ + (AV_RN16A(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\ } diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 6a3f6d99bd..70daf68789 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2282,8 +2282,9 @@ static int mpeg_decode_frame(AVCodecContext *avctx, s->slice_count = 0; - if (avctx->extradata && !avctx->frame_number) { + if (avctx->extradata && !s->extradata_decoded) { int ret = decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size); + s->extradata_decoded = 1; if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) return ret; } diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index 9a9cc85dee..6e60c8695f 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -42,6 +42,7 @@ typedef struct Mpeg1Context { AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator int sync; ///< Did we reach a sync point like a GOP/SEQ/KEYFrame? int tmpgexs; + int extradata_decoded; } Mpeg1Context; extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 15d2c4e687..fbd1bcf5fa 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1630,7 +1630,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; - int out_size; + int ret; if (buf_size < HEADER_SIZE) return AVERROR_INVALIDDATA; @@ -1661,21 +1661,22 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, buf_size= s->frame_size; } - out_size = mp_decode_frame(s, NULL, buf, buf_size); - if (out_size >= 0) { + ret = mp_decode_frame(s, NULL, buf, buf_size); + if (ret >= 0) { *got_frame_ptr = 1; *(AVFrame *)data = s->frame; avctx->sample_rate = s->sample_rate; //FIXME maybe move the other codec info stuff from above here too } else { av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n"); - /* Only return an error if the bad frame makes up the whole packet. - If there is more data in the packet, just consume the bad frame - instead of returning an error, which would discard the whole - packet. */ + /* Only return an error if the bad frame makes up the whole packet or + * the error is related to buffer management. + * If there is more data in the packet, just consume the bad frame + * instead of returning an error, which would discard the whole + * packet. */ *got_frame_ptr = 0; - if (buf_size == avpkt->size) - return out_size; + if (buf_size == avpkt->size || ret != AVERROR_INVALIDDATA) + return ret; } s->frame_size = 0; return buf_size; @@ -1696,7 +1697,7 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; - int len, out_size; + int len, out_size, ret = 0; len = buf_size; @@ -1733,7 +1734,11 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, out_size = buf_size; else #endif - out_size = mp_decode_frame(s, NULL, buf, buf_size); + ret = mp_decode_frame(s, NULL, buf, buf_size); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n"); + return ret; + } *got_frame_ptr = 1; *(AVFrame *)data = s->frame; @@ -1940,7 +1945,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, } ch += m->nb_channels; - out_size += mp_decode_frame(m, outptr, buf, fsize); + if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0) + return ret; + + out_size += ret; buf += fsize; len -= fsize; diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index ca6878a8be..0cc7a785ff 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -64,8 +64,8 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, return AVERROR_INVALIDDATA; s->filter_header = buf[1] & 0x06; if (buf[1] & 1) { - av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n"); - return 0; + av_log_missing_feature(s->avctx, "Interlacing", 0); + return AVERROR_PATCHWELCOME; } if (separated_coeff || !s->filter_header) { coeff_offset = AV_RB16(buf+2) - 2; diff --git a/library.mak b/library.mak index cc71f9df82..53b35eb020 100644 --- a/library.mak +++ b/library.mak @@ -51,8 +51,7 @@ endif clean:: $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ - $(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \ - $(HOSTOBJS) $(HOSTPROGS) + $(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) distclean:: clean $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \ |