diff --git a/doc/APIchanges b/doc/APIchanges index ae980c258b..97a5c0068d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -22,14 +22,14 @@ API changes, most recent first: 2011-10-20 - b35e9e1 - lavu 51.22.0 Add av_strtok() to avstring.h. -2011-xx-xx - xxxxxxx - lavu 51.18.0 +2011-11-23 - bbb46f3 - lavu 51.18.0 Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and av_samples_alloc(), to samplefmt.h. -2011-xx-xx - xxxxxxx - lavu 51.17.0 +2011-11-23 - 8889cc4 - lavu 51.17.0 Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h. -2011-xx-xx - xxxxxxx - lavc 53.21.0 +2011-11-19 - f3a29b7 - lavc 53.21.0 Move some AVCodecContext fields to a new private struct, AVCodecInternal, which is accessed from a new field, AVCodecContext.internal. - fields moved: @@ -37,6 +37,9 @@ API changes, most recent first: AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count AVCodecContext.is_copy --> AVCodecInternal.is_copy +2011-11-16 - 6270671 - lavu 51.16.0 + Add av_timegm() + 2011-11-13 - lavf 53.15.0 New interrupt callback API, allowing per-AVFormatContext/AVIOContext interrupt callbacks. @@ -47,9 +50,6 @@ API changes, most recent first: This will allow passing AVOptions to protocols after lavf 54.0. -2011-11-xx - xxxxxxx - lavu 51.16.0 - Add av_timegm() - 2011-11-06 - ba04ecf - lavu 51.14.0 Add av_strcasecmp() and av_strncasecmp() to avstring.h. diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 07a9c0a484..edafb967b4 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -519,7 +519,7 @@ static int dca_parse_frame_header(DCAContext * s) init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8); /* Sync code */ - get_bits(&s->gb, 32); + skip_bits_long(&s->gb, 32); /* Frame header */ s->frame_type = get_bits(&s->gb, 1); @@ -1257,7 +1257,7 @@ static int dca_subframe_footer(DCAContext * s, int base_channel) /* presumably optional information only appears in the core? */ if (!base_channel) { if (s->timestamp) - get_bits(&s->gb, 32); + skip_bits_long(&s->gb, 32); if (s->aux_data) aux_data_count = get_bits(&s->gb, 6); diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index a707e63a54..af91e02188 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -443,7 +443,6 @@ AVHWAccel ff_h264_dxva2_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .pix_fmt = PIX_FMT_DXVA2_VLD, - .capabilities = 0, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index 6ac1cda4ed..951305d00f 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -265,7 +265,6 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MPEG2VIDEO, .pix_fmt = PIX_FMT_DXVA2_VLD, - .capabilities = 0, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index 82be918c22..0ae9685208 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -269,7 +269,6 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_WMV3, .pix_fmt = PIX_FMT_DXVA2_VLD, - .capabilities = 0, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, @@ -282,7 +281,6 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VC1, .pix_fmt = PIX_FMT_DXVA2_VLD, - .capabilities = 0, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 80003a6c3e..1bb73fe790 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -759,7 +759,7 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "SkipCell procedure not implemented yet!\n"); CHECK_CELL - if(!curr_cell.mv_ptr) + if (!curr_cell.mv_ptr) return AVERROR_INVALIDDATA; copy_cell(ctx, plane, &curr_cell); return 0; diff --git a/libavcodec/mjpeg2jpeg_bsf.c b/libavcodec/mjpeg2jpeg_bsf.c index 855f24add3..c0f2db973b 100644 --- a/libavcodec/mjpeg2jpeg_bsf.c +++ b/libavcodec/mjpeg2jpeg_bsf.c @@ -108,6 +108,5 @@ static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc, AVBitStreamFilter ff_mjpeg2jpeg_bsf = { .name = "mjpeg2jpeg", - .priv_data_size = 0, .filter = mjpeg2jpeg_filter, }; diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 4db18eb2d0..713d80f5d9 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -144,7 +144,6 @@ AVCodec ff_s302m_decoder = { .name = "s302m", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_S302M, - .priv_data_size = 0, .decode = s302m_decode_frame, .long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), }; diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 1b9755cc19..ca07b6ce17 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -116,7 +116,8 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } else if (depth == 16) { switch (d3d_format) { case 0: - if (!flags&1) goto unsupported; + if (!(flags & 1)) + goto unsupported; case FF_S3TC_DXT1: if (buf_end - cur < (w/4) * (h/4) * 8) return AVERROR_INVALIDDATA; diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 01c42f5af1..753deaf5ca 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -342,9 +342,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = start_frame, .end_frame = end_frame, .decode_slice = decode_slice, - .priv_data_size = 0, }; diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index dbe1d1296c..762c53c4eb 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -143,9 +143,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MPEG2VIDEO, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = vaapi_mpeg2_start_frame, .end_frame = vaapi_mpeg2_end_frame, .decode_slice = vaapi_mpeg2_decode_slice, - .priv_data_size = 0, }; diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index f6e26d4130..b3dcc14457 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -155,11 +155,9 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MPEG4, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = vaapi_mpeg4_start_frame, .end_frame = vaapi_mpeg4_end_frame, .decode_slice = vaapi_mpeg4_decode_slice, - .priv_data_size = 0, }; #endif @@ -169,10 +167,8 @@ AVHWAccel ff_h263_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H263, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = vaapi_mpeg4_start_frame, .end_frame = vaapi_mpeg4_end_frame, .decode_slice = vaapi_mpeg4_decode_slice, - .priv_data_size = 0, }; #endif diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 09bef4a5f9..ad5a89fe6f 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -346,11 +346,9 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_WMV3, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = vaapi_vc1_start_frame, .end_frame = vaapi_vc1_end_frame, .decode_slice = vaapi_vc1_decode_slice, - .priv_data_size = 0, }; #endif @@ -359,9 +357,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VC1, .pix_fmt = PIX_FMT_VAAPI_VLD, - .capabilities = 0, .start_frame = vaapi_vc1_start_frame, .end_frame = vaapi_vc1_end_frame, .decode_slice = vaapi_vc1_decode_slice, - .priv_data_size = 0, }; diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c index 6ea5e0fdd7..254268f558 100644 --- a/libavcodec/vda_h264.c +++ b/libavcodec/vda_h264.c @@ -86,7 +86,6 @@ AVHWAccel ff_h264_vda_hwaccel = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .pix_fmt = PIX_FMT_VDA_VLD, - .capabilities = 0, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavformat/a64.c b/libavformat/a64.c index edab918129..4c8a942471 100644 --- a/libavformat/a64.c +++ b/libavformat/a64.c @@ -166,7 +166,6 @@ static int a64_write_trailer(struct AVFormatContext *s) AVOutputFormat ff_a64_muxer = { .name = "a64", .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"), - .mime_type = NULL, .extensions = "a64, A64", .priv_data_size = sizeof (A64Context), .video_codec = CODEC_ID_A64_MULTI, diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 4b14b95ef4..ed1d913347 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -27,6 +27,8 @@ #include "avformat.h" #include "adts.h" +#define ADTS_MAX_FRAME_BYTES ((1 << 13) - 1) + int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size) { GetBitContext gb; @@ -93,6 +95,13 @@ int ff_adts_write_frame_header(ADTSContext *ctx, { PutBitContext pb; + unsigned full_frame_size = (unsigned)ADTS_HEADER_SIZE + size + pce_size; + if (full_frame_size > ADTS_MAX_FRAME_BYTES) { + av_log(NULL, AV_LOG_ERROR, "ADTS frame size too large: %u (max %d)\n", + full_frame_size, ADTS_MAX_FRAME_BYTES); + return AVERROR_INVALIDDATA; + } + init_put_bits(&pb, buf, ADTS_HEADER_SIZE); /* adts_fixed_header */ @@ -110,7 +119,7 @@ int ff_adts_write_frame_header(ADTSContext *ctx, /* adts_variable_header */ put_bits(&pb, 1, 0); /* copyright_identification_bit */ put_bits(&pb, 1, 0); /* copyright_identification_start */ - put_bits(&pb, 13, ADTS_HEADER_SIZE + size + pce_size); /* aac_frame_length */ + put_bits(&pb, 13, full_frame_size); /* aac_frame_length */ put_bits(&pb, 11, 0x7ff); /* adts_buffer_fullness */ put_bits(&pb, 2, 0); /* number_of_raw_data_blocks_in_frame */ @@ -128,7 +137,10 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) if (!pkt->size) return 0; if (adts->write_adts) { - ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size); + int err = ff_adts_write_frame_header(adts, buf, pkt->size, + adts->pce_size); + if (err < 0) + return err; avio_write(pb, buf, ADTS_HEADER_SIZE); if (adts->pce_size) { avio_write(pb, adts->pce_data, adts->pce_size); diff --git a/libavformat/amr.c b/libavformat/amr.c index 8c3b1416c8..c2c56cc8c2 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -176,7 +176,6 @@ static int amr_read_packet(AVFormatContext *s, AVInputFormat ff_amr_demuxer = { .name = "amr", .long_name = NULL_IF_CONFIG_SMALL("3GPP AMR file format"), - .priv_data_size = 0, /*priv_data_size*/ .read_probe = amr_probe, .read_header = amr_read_header, .read_packet = amr_read_packet, diff --git a/libavformat/md5proto.c b/libavformat/md5proto.c index 4e041b020f..05ee9d366a 100644 --- a/libavformat/md5proto.c +++ b/libavformat/md5proto.c @@ -36,7 +36,7 @@ static int md5_open(URLContext *h, const char *filename, int flags) return -1; } - if (!flags & AVIO_FLAG_WRITE) + if (!(flags & AVIO_FLAG_WRITE)) return AVERROR(EINVAL); av_md5_init(h->priv_data); diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c index 47cfea020b..bc93722f1a 100644 --- a/libavformat/mmsh.c +++ b/libavformat/mmsh.c @@ -406,7 +406,6 @@ URLProtocol ff_mmsh_protocol = { .name = "mmsh", .url_open = mmsh_open, .url_read = mmsh_read, - .url_write = NULL, .url_seek = mmsh_seek, .url_close = mmsh_close, .url_read_seek = mmsh_read_seek, diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 5b72c93c2c..de2dd9dfbe 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -620,7 +620,6 @@ AVInputFormat ff_mpegps_demuxer = { .read_probe = mpegps_probe, .read_header = mpegps_read_header, .read_packet = mpegps_read_packet, - .read_seek = NULL, //mpegps_read_seek, .read_timestamp = mpegps_read_dts, .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, }; diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index f072f80d80..abdbb5d1d1 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -1006,7 +1006,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) return -1; if ((AV_RB16(pkt->data) & 0xfff0) != 0xfff0) { ADTSContext *adts = ts_st->adts; - int new_size; + int new_size, err; if (!adts) { av_log(s, AV_LOG_ERROR, "aac bitstream not in adts format " "and extradata missing\n"); @@ -1018,7 +1018,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) data = av_malloc(new_size); if (!data) return AVERROR(ENOMEM); - ff_adts_write_frame_header(adts, data, pkt->size, adts->pce_size); + err = ff_adts_write_frame_header(adts, data, pkt->size, + adts->pce_size); + if (err < 0) { + av_free(data); + return err; + } if (adts->pce_size) { memcpy(data+ADTS_HEADER_SIZE, adts->pce_data, adts->pce_size); adts->pce_size = 0; diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c index 14adc04b4b..0888eca217 100644 --- a/libavformat/rsodec.c +++ b/libavformat/rsodec.c @@ -92,11 +92,8 @@ AVInputFormat ff_rso_demuxer = { .name = "rso", .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"), .extensions = "rso", - .priv_data_size = 0, - .read_probe = NULL, /* no magic value in this format */ .read_header = rso_read_header, .read_packet = rso_read_packet, - .read_close = NULL, .read_seek = pcm_read_seek, .codec_tag = (const AVCodecTag* const []){ff_codec_rso_tags, 0}, }; diff --git a/libavformat/rsoenc.c b/libavformat/rsoenc.c index ca9985b070..ef4350b970 100644 --- a/libavformat/rsoenc.c +++ b/libavformat/rsoenc.c @@ -104,7 +104,6 @@ AVOutputFormat ff_rso_muxer = { .name = "rso", .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"), .extensions = "rso", - .priv_data_size = 0, .audio_codec = CODEC_ID_PCM_U8, .video_codec = CODEC_ID_NONE, .write_header = rso_write_header, diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c index 4548bc7981..f6547bc70e 100644 --- a/libavformat/rtpdec_mpeg4.c +++ b/libavformat/rtpdec_mpeg4.c @@ -234,9 +234,6 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = { .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_MPEG4, .parse_sdp_a_line = parse_sdp_line, - .alloc = NULL, - .free = NULL, - .parse_packet = NULL }; RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = { diff --git a/libavformat/tls.c b/libavformat/tls.c index 339b799322..26f5ee5106 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -246,7 +246,6 @@ URLProtocol ff_tls_protocol = { .url_open = tls_open, .url_read = tls_read, .url_write = tls_write, - .url_seek = NULL, .url_close = tls_close, .priv_data_size = sizeof(TLSContext), }; diff --git a/libavutil/timer.h b/libavutil/timer.h index 8a0cad56ca..63576c95bf 100644 --- a/libavutil/timer.h +++ b/libavutil/timer.h @@ -61,7 +61,7 @@ tend= AV_READ_TIME();\ }else\ tskip_count++;\ if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\ - av_log(NULL, AV_LOG_ERROR, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n",\ + av_log(NULL, AV_LOG_ERROR, "%"PRIu64" decicycles in %s, %d runs, %d skips\n",\ tsum*10/tcount, id, tcount, tskip_count);\ }\ }