[FFmpeg-cvslog] avformat/avidec: fix handling dv in avi
ffmpeg | branch: release/2.1 | Michael Niedermayer | Fri Nov 21 03:08:20 2014 +0100| [2d0b2db27e84f978801a81e9ce542f4b544992a8] | committer: Carl Eugen Hoyos avformat/avidec: fix handling dv in avi Fixes Ticket4086 Signed-off-by: Michael Niedermayer (cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d0b2db27e84f978801a81e9ce542f4b544992a8 --- libavformat/avidec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 449c065..86bea76 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1081,7 +1081,7 @@ start_sync: goto start_sync; } -n = avi->dv_demux ? 0 : get_stream_idx(d); +n = get_stream_idx(d); if (!((i - avi->last_pkt_pos) & 1) && get_stream_idx(d + 1) < s->nb_streams) @@ -1093,6 +1093,9 @@ start_sync: goto start_sync; } +if (avi->dv_demux && n != 0) +continue; + // parse ##dc/##wb if (n < s->nb_streams) { AVStream *st; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avidec: fix handling dv in avi
ffmpeg | branch: release/2.4 | Michael Niedermayer | Fri Nov 21 03:08:20 2014 +0100| [944570906b7433846352cbb14730e96e94d232ab] | committer: Carl Eugen Hoyos avformat/avidec: fix handling dv in avi Fixes Ticket4086 Signed-off-by: Michael Niedermayer (cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=944570906b7433846352cbb14730e96e94d232ab --- libavformat/avidec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 5b260e2..a73bf98 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1141,7 +1141,7 @@ start_sync: goto start_sync; } -n = avi->dv_demux ? 0 : get_stream_idx(d); +n = get_stream_idx(d); if (!((i - avi->last_pkt_pos) & 1) && get_stream_idx(d + 1) < s->nb_streams) @@ -1153,6 +1153,9 @@ start_sync: goto start_sync; } +if (avi->dv_demux && n != 0) +continue; + // parse ##dc/##wb if (n < s->nb_streams) { AVStream *st; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avidec: fix handling dv in avi
ffmpeg | branch: release/2.2 | Michael Niedermayer | Fri Nov 21 03:08:20 2014 +0100| [bf219a564c421b9c9ce8f0c6c0e6ad549cbbdcd3] | committer: Carl Eugen Hoyos avformat/avidec: fix handling dv in avi Fixes Ticket4086 Signed-off-by: Michael Niedermayer (cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf219a564c421b9c9ce8f0c6c0e6ad549cbbdcd3 --- libavformat/avidec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index a7e1c5b..7512622 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1046,7 +1046,7 @@ start_sync: goto start_sync; } -n = avi->dv_demux ? 0 : get_stream_idx(d); +n = get_stream_idx(d); if (!((i - avi->last_pkt_pos) & 1) && get_stream_idx(d + 1) < s->nb_streams) @@ -1058,6 +1058,9 @@ start_sync: goto start_sync; } +if (avi->dv_demux && n != 0) +continue; + // parse ##dc/##wb if (n < s->nb_streams) { AVStream *st; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avidec: fix handling dv in avi
ffmpeg | branch: release/2.3 | Michael Niedermayer | Fri Nov 21 03:08:20 2014 +0100| [b6ff3acafcc90a21f9927e23752efcde56a1ebad] | committer: Carl Eugen Hoyos avformat/avidec: fix handling dv in avi Fixes Ticket4086 Signed-off-by: Michael Niedermayer (cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b6ff3acafcc90a21f9927e23752efcde56a1ebad --- libavformat/avidec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 8c70649..6536991 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1141,7 +1141,7 @@ start_sync: goto start_sync; } -n = avi->dv_demux ? 0 : get_stream_idx(d); +n = get_stream_idx(d); if (!((i - avi->last_pkt_pos) & 1) && get_stream_idx(d + 1) < s->nb_streams) @@ -1153,6 +1153,9 @@ start_sync: goto start_sync; } +if (avi->dv_demux && n != 0) +continue; + // parse ##dc/##wb if (n < s->nb_streams) { AVStream *st; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate ()
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 12:37:59 2014 +0100| [367c9d33d6dd1e8a85b63e14464e7e08ee1315cc] | committer: Michael Niedermayer avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate() Fixes Ticket4012 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=367c9d33d6dd1e8a85b63e14464e7e08ee1315cc --- libavformat/avformat.h |2 +- libavformat/utils.c | 12 +--- libavformat/version.h|2 +- tests/ref/fate/cdxl-bitline-ham6 |2 +- tests/ref/fate/cdxl-ham8 |2 +- tests/ref/fate/cdxl-pal8 |2 +- tests/ref/fate/vcr2 |2 +- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7b5de4f..3d99f37 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -916,7 +916,7 @@ typedef struct AVStream { /** * Stream information used internally by av_find_stream_info() */ -#define MAX_STD_TIMEBASES (60*12+6) +#define MAX_STD_TIMEBASES (30*12+7+6) struct { int64_t last_dts; int64_t duration_gcd; diff --git a/libavformat/utils.c b/libavformat/utils.c index 6278668..693b033 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2787,10 +2787,16 @@ static void compute_chapters_end(AVFormatContext *s) static int get_std_framerate(int i) { -if (i < 60 * 12) +if (i < 30*12) return (i + 1) * 1001; -else -return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i - 60 * 12] * 1000 * 12; +i -= 30*12; + +if (i < 7) +return ((const int[]) { 40, 48, 50, 60, 80, 120, 240})[i] * 1001 * 12; + +i -= 7; + +return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i] * 1000 * 12; } /* Is the time base unreliable? diff --git a/libavformat/version.h b/libavformat/version.h index a9e0ac2..8f14d19 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 56 #define LIBAVFORMAT_VERSION_MINOR 14 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/tests/ref/fate/cdxl-bitline-ham6 b/tests/ref/fate/cdxl-bitline-ham6 index 8060f06..9ba7404 100644 --- a/tests/ref/fate/cdxl-bitline-ham6 +++ b/tests/ref/fate/cdxl-bitline-ham6 @@ -1,4 +1,4 @@ -#tb 0: 12/601 +#tb 0: 1/50 0, 0, 0,1,63180, 0xcda82c16 0, 1, 1,1,63180, 0xa6097bf9 0, 2, 2,1,63180, 0x4c2fb091 diff --git a/tests/ref/fate/cdxl-ham8 b/tests/ref/fate/cdxl-ham8 index 269f1f3..1eebea3 100644 --- a/tests/ref/fate/cdxl-ham8 +++ b/tests/ref/fate/cdxl-ham8 @@ -1,2 +1,2 @@ -#tb 0: 3/158 +#tb 0: 12/281 0, 0, 0,1,67584, 0xce0cade5 diff --git a/tests/ref/fate/cdxl-pal8 b/tests/ref/fate/cdxl-pal8 index 82d4d63..b2fb045 100644 --- a/tests/ref/fate/cdxl-pal8 +++ b/tests/ref/fate/cdxl-pal8 @@ -1,4 +1,4 @@ -#tb 0: 12/601 +#tb 0: 1/50 0, 0, 0,1,67584, 0x5eae629b 0, 1, 1,1,67584, 0x32591227 0, 2, 2,1,67584, 0x4e4424c7 diff --git a/tests/ref/fate/vcr2 b/tests/ref/fate/vcr2 index 521e55f..f7e1540 100644 --- a/tests/ref/fate/vcr2 +++ b/tests/ref/fate/vcr2 @@ -1,4 +1,4 @@ -#tb 0: 16701/25 +#tb 0: 1001/15000 0, 0, 0,1,38016, 0x50e93e0d 0, 1, 1,1,38016, 0x6ac8627d 0, 2, 2,1,38016, 0x6f38661e ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/apngdec: add APNG demuxer.
ffmpeg | branch: master | Benoit Fouet | Thu Nov 20 15:07:18 2014 +0100| [5d37d70b0b7ca88f27b99dc7fc3a83b4999318eb] | committer: Michael Niedermayer avformat/apngdec: add APNG demuxer. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d37d70b0b7ca88f27b99dc7fc3a83b4999318eb --- libavformat/Makefile |1 + libavformat/allformats.c |1 + libavformat/apngdec.c| 409 ++ libavformat/version.h|4 +- 4 files changed, 413 insertions(+), 2 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 38730c5..c1b5ace 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -76,6 +76,7 @@ OBJS-$(CONFIG_AMR_MUXER) += amr.o OBJS-$(CONFIG_ANM_DEMUXER) += anm.o OBJS-$(CONFIG_APC_DEMUXER) += apc.o OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o img2.o +OBJS-$(CONFIG_APNG_DEMUXER) += apngdec.o OBJS-$(CONFIG_AQTITLE_DEMUXER) += aqtitledec.o subtitles.o OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o \ avlanguage.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 3f60d7d..81aab56 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -74,6 +74,7 @@ void av_register_all(void) REGISTER_DEMUXER (ANM, anm); REGISTER_DEMUXER (APC, apc); REGISTER_DEMUXER (APE, ape); +REGISTER_DEMUXER (APNG, apng); REGISTER_DEMUXER (AQTITLE, aqtitle); REGISTER_MUXDEMUX(ASF, asf); REGISTER_MUXDEMUX(ASS, ass); diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c new file mode 100644 index 000..54fbd29 --- /dev/null +++ b/libavformat/apngdec.c @@ -0,0 +1,409 @@ +/* + * APNG demuxer + * Copyright (c) 2014 Benoit Fouet + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * APNG demuxer. + * @see https://wiki.mozilla.org/APNG_Specification + * @see http://www.w3.org/TR/PNG + * + * Not supported (yet): + * - streams with chunks other than fcTL / fdAT / IEND after the first fcTL + * - streams with multiple fdAT chunks after an fcTL one + */ + +#include "avformat.h" +#include "avio_internal.h" +#include "internal.h" +#include "libavutil/imgutils.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/opt.h" +#include "libavcodec/png.h" +#include "libavcodec/bytestream.h" + +#define DEFAULT_APNG_FPS 15 + +typedef struct APNGDemuxContext { +const AVClass *class; + +int max_fps; +int default_fps; + +int is_key_frame; + +/* + * loop options + */ +int ignore_loop; +uint32_t num_frames; +uint32_t num_play; +uint32_t cur_loop; +} APNGDemuxContext; + +/* + * To be a valid APNG file, we mandate, in this order: + * PNGSIG + * IHDR + * ... + * acTL + * ... + * IDAT + */ +static int apng_probe(AVProbeData *p) +{ +GetByteContext gb; +int state = 0; +uint32_t len, tag; + +bytestream2_init(&gb, p->buf, p->buf_size); + +if (bytestream2_get_be64(&gb) != PNGSIG) +return 0; + +for (;;) { +len = bytestream2_get_be32(&gb); +if (len > 0x7fff) +return 0; + +tag = bytestream2_get_le32(&gb); +/* we don't check IDAT size, as this is the last tag + * we check, and it may be larger than the probe buffer */ +if (tag != MKTAG('I', 'D', 'A', 'T') && +len > bytestream2_get_bytes_left(&gb)) +return 0; + +switch (tag) { +case MKTAG('I', 'H', 'D', 'R'): +if (len != 13) +return 0; +if (av_image_check_size(bytestream2_get_be32(&gb), bytestream2_get_be32(&gb), 0, NULL)) +return 0; +bytestream2_skip(&gb, 9); +state++; +break; +case MKTAG('a', 'c', 'T', 'L'): +if (state != 1 || +len != 8 || +bytestream2_get_be32(&gb) == 0) /* 0 is not a valid value for number of frames */ +return 0; +bytestream2_skip(&gb, 8); +sta
[FFmpeg-cvslog] avcodec/pngdec: add APNG support.
ffmpeg | branch: master | Benoit Fouet | Fri Nov 21 12:05:47 2014 +0100| [33acebd3ccfca1a2762c152ee998e82a8d0a746c] | committer: Michael Niedermayer avcodec/pngdec: add APNG support. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33acebd3ccfca1a2762c152ee998e82a8d0a746c --- configure |1 + libavcodec/Makefile |1 + libavcodec/allcodecs.c |1 + libavcodec/avcodec.h|1 + libavcodec/codec_desc.c |8 +++ libavcodec/pngdec.c | 139 ++- libavcodec/version.h|4 +- 7 files changed, 150 insertions(+), 5 deletions(-) diff --git a/configure b/configure index c013c50..b3c3e5b 100755 --- a/configure +++ b/configure @@ -2068,6 +2068,7 @@ amrwb_decoder_select="lsp" amv_decoder_select="sp5x_decoder exif" amv_encoder_select="aandcttables mpegvideoenc" ape_decoder_select="bswapdsp llauddsp" +apng_decoder_select="zlib" asv1_decoder_select="blockdsp bswapdsp idctdsp" asv1_encoder_select="bswapdsp fdctdsp pixblockdsp" asv2_decoder_select="blockdsp bswapdsp idctdsp" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 6c625ce..fa0f53d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -136,6 +136,7 @@ OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpeg.o mjpegenc_common.o \ OBJS-$(CONFIG_ANM_DECODER) += anm.o OBJS-$(CONFIG_ANSI_DECODER)+= ansi.o cga_data.o OBJS-$(CONFIG_APE_DECODER) += apedec.o +OBJS-$(CONFIG_APNG_DECODER)+= png.o pngdec.o pngdsp.o OBJS-$(CONFIG_SSA_DECODER) += assdec.o ass.o ass_split.o OBJS-$(CONFIG_SSA_ENCODER) += assenc.o ass.o OBJS-$(CONFIG_ASS_DECODER) += assdec.o ass.o ass_split.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index d08abd8..0d39d33 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -105,6 +105,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (AMV, amv); REGISTER_DECODER(ANM, anm); REGISTER_DECODER(ANSI, ansi); +REGISTER_DECODER(APNG, apng); REGISTER_ENCDEC (ASV1, asv1); REGISTER_ENCDEC (ASV2, asv2); REGISTER_DECODER(AURA, aura); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index eac3fc7..3323284 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -319,6 +319,7 @@ enum AVCodecID { AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'), #define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC AV_CODEC_ID_VP7= MKBETAG('V','P','7','0'), +AV_CODEC_ID_APNG = MKBETAG('A','P','N','G'), /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the start of audio codecs diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index eeb4505..0af66f4 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1440,6 +1440,14 @@ static const AVCodecDescriptor codec_descriptors[] = { .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, .mime_types= MT("image/x-xwindowdump"), }, +{ +.id= AV_CODEC_ID_APNG, +.type = AVMEDIA_TYPE_VIDEO, +.name = "apng", +.long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), +.props = AV_CODEC_PROP_LOSSLESS, +.mime_types= MT("image/png"), +}, /* various PCM "codecs" */ { diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 57b73c1..ee6a2ba 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -786,15 +786,55 @@ static void handle_small_bpp(PNGDecContext *s, AVFrame *p) } } +static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, + uint32_t length) +{ +uint32_t sequence_number, width, height, x_offset, y_offset; + +if (length != 26) +return AVERROR_INVALIDDATA; + +sequence_number = bytestream2_get_be32(&s->gb); +width = bytestream2_get_be32(&s->gb); +height = bytestream2_get_be32(&s->gb); +x_offset= bytestream2_get_be32(&s->gb); +y_offset= bytestream2_get_be32(&s->gb); +bytestream2_skip(&s->gb, 10); /* delay_num (2) + * delay_den (2) + * dispose_op (1) + * blend_op (1) + * crc(4) + */ + +if (width != s->width || height != s->height || +x_offset != 0 || y_offset != 0) { +if (sequence_number == 0) +return AVERROR_INVALIDDATA; +avpriv_request_sample(avctx, "non key frames"); +return AVERROR_PATCHWELCOME; +} + +return 0; +} + static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
[FFmpeg-cvslog] avdevice/fbdev_common: Use av_freep(), avoid leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 18:02:01 2014 +0100| [883f85fa8ffd534b1fe04fc34883ab96ac5c784e] | committer: Michael Niedermayer avdevice/fbdev_common: Use av_freep(), avoid leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=883f85fa8ffd534b1fe04fc34883ab96ac5c784e --- libavdevice/fbdev_common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/fbdev_common.c b/libavdevice/fbdev_common.c index 713e4fd..98f96de 100644 --- a/libavdevice/fbdev_common.c +++ b/libavdevice/fbdev_common.c @@ -121,8 +121,8 @@ int ff_fbdev_get_device_list(AVDeviceInfoList *device_list) fail_device: if (device) { -av_free(device->device_name); -av_free(device->device_description); +av_freep(&device->device_name); +av_freep(&device->device_description); av_freep(&device); } if (fd >= 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp6: Use av_freep(), avoid leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 18:02:01 2014 +0100| [2ae2c60554c2731e21a41c3f32a225f0a9fb9b26] | committer: Michael Niedermayer avcodec/vp6: Use av_freep(), avoid leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ae2c60554c2731e21a41c3f32a225f0a9fb9b26 --- libavcodec/vp6.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index a18b8ff..e97ef76 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -651,7 +651,7 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx) if (s->alpha_context) { ff_vp56_free_context(s->alpha_context); vp6_decode_free_context(s->alpha_context); -av_free(s->alpha_context); +av_freep(&s->alpha_context); } return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avdevice/pulse_audio_common: Use av_freep(), avoid leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 18:02:01 2014 +0100| [c05310d4699c3190c713aa9c9fc1d9f8b1a15ee8] | committer: Michael Niedermayer avdevice/pulse_audio_common: Use av_freep(), avoid leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c05310d4699c3190c713aa9c9fc1d9f8b1a15ee8 --- libavdevice/pulse_audio_common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/pulse_audio_common.c b/libavdevice/pulse_audio_common.c index 5a2568b..4046641 100644 --- a/libavdevice/pulse_audio_common.c +++ b/libavdevice/pulse_audio_common.c @@ -163,8 +163,8 @@ static void pulse_add_detected_device(PulseAudioDeviceList *info, return; fail: -av_free(new_device->device_description); -av_free(new_device->device_name); +av_freep(&new_device->device_description); +av_freep(&new_device->device_name); av_free(new_device); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avdevice/avdevice.c: Use av_freep(), avoid leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 18:02:01 2014 +0100| [6995be43aee561b04e13b60d65d5503fbe5d2647] | committer: Michael Niedermayer avdevice/avdevice.c: Use av_freep(), avoid leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6995be43aee561b04e13b60d65d5503fbe5d2647 --- libavdevice/avdevice.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 6a75bd7..755f251 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -219,11 +219,11 @@ void avdevice_free_list_devices(AVDeviceInfoList **device_list) for (i = 0; i < list->nb_devices; i++) { dev = list->devices[i]; if (dev) { -av_free(dev->device_name); -av_free(dev->device_description); +av_freep(&dev->device_name); +av_freep(&dev->device_description); av_free(dev); } } -av_free(list->devices); +av_freep(&list->devices); av_freep(device_list); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libspeexdec: support zygoaudio
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 20:08:05 2014 +0100| [d96d8e121f1e423ba31dca972c07613cf32076c6] | committer: Michael Niedermayer avcodec/libspeexdec: support zygoaudio Fixes Ticket1873 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d96d8e121f1e423ba31dca972c07613cf32076c6 --- libavcodec/libspeexdec.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 5e149a5..1e4c05a 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -33,6 +33,7 @@ typedef struct { SpeexStereoState stereo; void *dec_state; int frame_size; +int pktsize; } LibSpeexContext; @@ -50,14 +51,20 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_WARNING, "Invalid Speex header\n"); } if (avctx->codec_tag == MKTAG('S', 'P', 'X', 'N')) { +int quality; if (!avctx->extradata || avctx->extradata && avctx->extradata_size < 47) { av_log(avctx, AV_LOG_ERROR, "Missing or invalid extradata.\n"); return AVERROR_INVALIDDATA; } -if (avctx->extradata[37] != 10) { + +quality = avctx->extradata[37]; +if (quality > 10) { av_log(avctx, AV_LOG_ERROR, "Unsupported quality mode.\n"); return AVERROR_PATCHWELCOME; } + +s->pktsize = ((int[]){5,10,15,20,20,28,28,38,38,46,62})[quality]; + spx_mode = 0; } else if (header) { avctx->sample_rate = header->rate; @@ -143,9 +150,11 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data, *got_frame_ptr = 0; return buf_size; } +if (s->pktsize && buf_size == 62) +buf_size = s->pktsize; /* set new buffer */ speex_bits_read_from(&s->bits, buf, buf_size); -consumed = buf_size; +consumed = avpkt->size; } /* decode a single frame */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libspeexdec: more verbose error message
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 20:08:56 2014 +0100| [018ce902840a16447ca049046e558b56e60484b2] | committer: Michael Niedermayer avcodec/libspeexdec: more verbose error message Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=018ce902840a16447ca049046e558b56e60484b2 --- libavcodec/libspeexdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 1e4c05a..479c010 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -59,7 +59,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) quality = avctx->extradata[37]; if (quality > 10) { -av_log(avctx, AV_LOG_ERROR, "Unsupported quality mode.\n"); +av_log(avctx, AV_LOG_ERROR, "Unsupported quality mode %d.\n", quality); return AVERROR_PATCHWELCOME; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] avcodec/libspeexdec: support zygoaudio
On Fri, Nov 21, 2014 at 08:20:42PM +0100, Michael Niedermayer wrote: > +s->pktsize = ((int[]){5,10,15,20,20,28,28,38,38,46,62})[quality]; nit: shouldn't it be "const int"? It doesn't really matter currently since all compilers seem to be unable to put this construct in .rodata even if you mark it const :( ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Changelog: add zygoaudio
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 20:21:56 2014 +0100| [0c3ebbf6a54dc2b422c0c75b468a9979c097fd87] | committer: Michael Niedermayer Changelog: add zygoaudio Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c3ebbf6a54dc2b422c0c75b468a9979c097fd87 --- Changelog |1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 5f38aea..486c127 100644 --- a/Changelog +++ b/Changelog @@ -15,6 +15,7 @@ version : - ffserver supports codec private options - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - WebP muxer with animated WebP support +- zygoaudio decoding support version 2.4: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'aa8b39d999589154f79300de9038994d0093cd34'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 21:02:17 2014 +0100| [5af0a701a1c0356fd1a79671de1cf06974e78d76] | committer: Michael Niedermayer Merge commit 'aa8b39d999589154f79300de9038994d0093cd34' * commit 'aa8b39d999589154f79300de9038994d0093cd34': lavc: Move the libtwolame encoder registration to the list for external libraries Conflicts: libavcodec/allcodecs.c See: f5f98727b361c62d3962cef37a100db95d62b702 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5af0a701a1c0356fd1a79671de1cf06974e78d76 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: Move the libtwolame encoder registration to the list for external libraries
ffmpeg | branch: master | Martin Storsjö | Fri Nov 21 14:23:02 2014 +0200| [aa8b39d999589154f79300de9038994d0093cd34] | committer: Vittorio Giovara lavc: Move the libtwolame encoder registration to the list for external libraries This makes sure the default behaviour of using the internal encoder stays the same regardless if libtwolame is enabled or not (as for any external library). This fixes fate-lavf-mpg if libav is built with libtwolame enabled. CC: libav-sta...@libav.org Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa8b39d999589154f79300de9038994d0093cd34 --- libavcodec/allcodecs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index bd74e0b..6a71b2c 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -240,7 +240,6 @@ void avcodec_register_all(void) REGISTER_DECODER(SVQ3, svq3); REGISTER_ENCDEC (TARGA, targa); REGISTER_DECODER(THEORA,theora); -REGISTER_ENCODER(LIBTWOLAME,libtwolame); REGISTER_DECODER(THP, thp); REGISTER_DECODER(TIERTEXSEQVIDEO, tiertexseqvideo); REGISTER_ENCDEC (TIFF, tiff); @@ -448,6 +447,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger); REGISTER_ENCDEC (LIBSPEEX, libspeex); REGISTER_ENCODER(LIBTHEORA, libtheora); +REGISTER_ENCODER(LIBTWOLAME,libtwolame); REGISTER_ENCODER(LIBVO_AACENC, libvo_aacenc); REGISTER_ENCODER(LIBVO_AMRWBENC,libvo_amrwbenc); REGISTER_ENCODER(LIBVORBIS, libvorbis); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] xwma: Do not leak on failure path
ffmpeg | branch: master | Luca Barbato | Mon Nov 17 00:22:21 2014 +0100| [fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6] | committer: Vittorio Giovara xwma: Do not leak on failure path CC: libav-sta...@libav.org Bug-Id: CID 1087092 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6 --- libavformat/xwma.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 45d74de..af916ad 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -44,7 +44,7 @@ static int xwma_probe(AVProbeData *p) static int xwma_read_header(AVFormatContext *s) { int64_t size; -int ret; +int ret = 0; uint32_t dpds_table_size = 0; uint32_t *dpds_table = 0; unsigned int tag; @@ -130,8 +130,10 @@ static int xwma_read_header(AVFormatContext *s) /* parse the remaining RIFF chunks */ for (;;) { -if (pb->eof_reached) -return -1; +if (pb->eof_reached) { +ret = AVERROR_INVALIDDATA; +goto fail; +} /* read next chunk tag */ tag = avio_rl32(pb); size = avio_rl32(pb); @@ -152,7 +154,8 @@ static int xwma_read_header(AVFormatContext *s) /* Error out if there is more than one dpds chunk. */ if (dpds_table) { av_log(s, AV_LOG_ERROR, "two dpds chunks present\n"); -return -1; +ret = AVERROR_INVALIDDATA; +goto fail; } /* Compute the number of entries in the dpds chunk. */ @@ -184,8 +187,10 @@ static int xwma_read_header(AVFormatContext *s) } /* Determine overall data length */ -if (size < 0) -return -1; +if (size < 0) { +ret = AVERROR_INVALIDDATA; +goto fail; +} if (!size) { xwma->data_end = INT64_MAX; } else @@ -204,7 +209,8 @@ static int xwma_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Invalid bits_per_coded_sample %d for %d channels\n", st->codec->bits_per_coded_sample, st->codec->channels); -return AVERROR_INVALIDDATA; +ret = AVERROR_INVALIDDATA; +goto fail; } st->duration = total_decoded_bytes / bytes_per_sample; @@ -239,9 +245,10 @@ static int xwma_read_header(AVFormatContext *s) st->duration = (size<<3) * st->codec->sample_rate / st->codec->bit_rate; } +fail: av_free(dpds_table); -return 0; +return ret; } static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 21:30:01 2014 +0100| [15ed7ca437a89796759390956f117555e703043e] | committer: Michael Niedermayer Merge commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6' * commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6': xwma: Do not leak on failure path Conflicts: libavformat/xwma.c See: 375a0c03a9a401a328a94b3d9f5338ab1524f7ef Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15ed7ca437a89796759390956f117555e703043e --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/formats: Alloc NULL fmts in SET_COMMON_FORMATS()
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 22:15:32 2014 +0100| [b9ffafbfcc0f8aaffc9de3919a1d295dbe6d53f7] | committer: Michael Niedermayer avfilter/formats: Alloc NULL fmts in SET_COMMON_FORMATS() This avoids null pointer dereferences in case memory allocation has failed Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9ffafbfcc0f8aaffc9de3919a1d295dbe6d53f7 --- libavfilter/formats.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 42afcf4..eb3b87a 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -494,7 +494,7 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref) } #define SET_COMMON_FORMATS(ctx, fmts, in_fmts, out_fmts, ref, list) \ -{ \ +if (fmts) { \ int count = 0, i; \ \ for (i = 0; i < ctx->nb_inputs; i++) { \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/formats: free the correct pointer in ADD_FORMAT()
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 22:13:44 2014 +0100| [75819fafd8213875af2bfbe5ea821ae5b8d419f9] | committer: Michael Niedermayer avfilter/formats: free the correct pointer in ADD_FORMAT() Also only free it when it was not previously allocated to return to the state prior to the failing function call Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75819fafd8213875af2bfbe5ea821ae5b8d419f9 --- libavfilter/formats.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 2fc07eb..42afcf4 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -314,6 +314,7 @@ AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts) #define ADD_FORMAT(f, fmt, type, list, nb) \ do {\ type *fmts; \ +void *oldf = *f;\ \ if (!(*f) && !(*f = av_mallocz(sizeof(**f \ return AVERROR(ENOMEM); \ @@ -321,7 +322,8 @@ do { \ fmts = av_realloc((*f)->list, \ sizeof(*(*f)->list) * ((*f)->nb + 1));\ if (!fmts) {\ -av_freep(&f); \ +if (!oldf) \ +av_freep(f);\ return AVERROR(ENOMEM); \ } \ \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavfi: clean memory on error in ADD_FORMAT()
ffmpeg | branch: master | Vittorio Giovara | Mon Nov 17 00:22:20 2014 +0100| [863ee8a855b8ce27ffef41479eb66da58763faed] | committer: Vittorio Giovara lavfi: clean memory on error in ADD_FORMAT() CC: libav-sta...@libav.org Bug-Id: CID 1250334 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=863ee8a855b8ce27ffef41479eb66da58763faed --- libavfilter/formats.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 24a4fab..ea61ed2 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -188,8 +188,10 @@ do { \ \ fmts = av_realloc((*f)->list, \ sizeof(*(*f)->list) * ((*f)->nb + 1));\ -if (!fmts) \ +if (!fmts) {\ +av_freep(&f); \ return AVERROR(ENOMEM); \ +} \ \ (*f)->list = fmts; \ (*f)->list[(*f)->nb++] = fmt; \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '863ee8a855b8ce27ffef41479eb66da58763faed'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 21:39:26 2014 +0100| [42f3cb419aa0903eb11ac69ea94e636992a170ca] | committer: Michael Niedermayer Merge commit '863ee8a855b8ce27ffef41479eb66da58763faed' * commit '863ee8a855b8ce27ffef41479eb66da58763faed': lavfi: clean memory on error in ADD_FORMAT() Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42f3cb419aa0903eb11ac69ea94e636992a170ca --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 22:33:23 2014 +0100| [ac967ad8724ee860085cd108f822b3f830b89767] | committer: Michael Niedermayer Merge commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3' * commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3': dvdsubdec: Do not leak on failure path Conflicts: libavcodec/dvdsubdec.c See: 7fa9f7ef1c2f0cee81ec6ea6a4ff10af4c4fc62c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac967ad8724ee860085cd108f822b3f830b89767 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 22:25:09 2014 +0100| [ad2424e6b2984b253769040a2f2d7fb1344098b8] | committer: Michael Niedermayer Merge commit 'a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b' * commit 'a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b': libtwolame: prevent a NULL pointer dereference See: a586b3d9b1df9099c18d3e15c9b261f6612ad2ac Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad2424e6b2984b253769040a2f2d7fb1344098b8 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dvdsubdec: Do not leak on failure path
ffmpeg | branch: master | Luca Barbato | Sun Nov 9 08:48:47 2014 +0100| [d466d82faaf6e0e57a3a4be5e38e3902ef251ac3] | committer: Vittorio Giovara dvdsubdec: Do not leak on failure path CC: libav-sta...@libav.org Bug-Id: CID 1198262 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d466d82faaf6e0e57a3a4be5e38e3902ef251ac3 --- libavcodec/dvdsubdec.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 5d6db41..15abac0 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -503,6 +503,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx) { DVDSubContext *ctx = avctx->priv_data; char *data, *cur; +int ret = 0; if (!avctx->extradata || !avctx->extradata_size) return 0; @@ -527,16 +528,18 @@ static av_cold int dvdsub_init(AVCodecContext *avctx) } else if (!strncmp("size:", cur, 5)) { int w, h; if (sscanf(cur + 5, "%dx%d", &w, &h) == 2) { - int ret = ff_set_dimensions(avctx, w, h); + ret = ff_set_dimensions(avctx, w, h); if (ret < 0) - return ret; + goto fail; } } cur += strcspn(cur, "\n\r"); cur += strspn(cur, "\n\r"); } + +fail: av_free(data); -return 0; +return ret; } AVCodec ff_dvdsub_decoder = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libtwolame: prevent a NULL pointer dereference
ffmpeg | branch: master | Vittorio Giovara | Fri Nov 21 11:56:59 2014 +| [a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b] | committer: Vittorio Giovara libtwolame: prevent a NULL pointer dereference CC: libav-sta...@libav.org Bug-Id: CID 1250330 / CID 1250335 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b --- libavcodec/libtwolame.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c index 400985a..ce32941 100644 --- a/libavcodec/libtwolame.c +++ b/libavcodec/libtwolame.c @@ -148,8 +148,8 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (ret < 0) // twolame error return AVERROR_UNKNOWN; -avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); if (frame) { +avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); if (frame->pts != AV_NOPTS_VALUE) avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding); } else { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '312daa15891dc7abb77a404fe927d5ee35c52a71'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 23:18:30 2014 +0100| [a82f3de053a7c398418b92ee048cf1e5e83d417d] | committer: Michael Niedermayer Merge commit '312daa15891dc7abb77a404fe927d5ee35c52a71' * commit '312daa15891dc7abb77a404fe927d5ee35c52a71': vp9: Use the correct upper bound for seg_id Conflicts: libavcodec/vp9.h libavcodec/vp9block.c Not merged, the value was correct before as far as i can see Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a82f3de053a7c398418b92ee048cf1e5e83d417d --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vp9: Use the correct upper bound for seg_id
ffmpeg | branch: master | Luca Barbato | Tue Nov 11 13:27:01 2014 +0100| [312daa15891dc7abb77a404fe927d5ee35c52a71] | committer: Vittorio Giovara vp9: Use the correct upper bound for seg_id And use a macro to make apparent why the value. Bug-Id: CID 1108595 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=312daa15891dc7abb77a404fe927d5ee35c52a71 --- libavcodec/vp9.h |3 ++- libavcodec/vp9block.c |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp9.h b/libavcodec/vp9.h index 0a6c6ee..724288d 100644 --- a/libavcodec/vp9.h +++ b/libavcodec/vp9.h @@ -313,6 +313,7 @@ typedef struct VP9Context { uint8_t temporal; uint8_t absolute_vals; uint8_t update_map; +#define MAX_SEGMENT 8 struct { uint8_t q_enabled; uint8_t lf_enabled; @@ -323,7 +324,7 @@ typedef struct VP9Context { int8_t lf_val; int16_t qmul[2][2]; uint8_t lflvl[4][2]; -} feat[8]; +} feat[MAX_SEGMENT]; } segmentation; struct { unsigned log2_tile_cols, log2_tile_rows; diff --git a/libavcodec/vp9block.c b/libavcodec/vp9block.c index caf3bcc..a92c794 100644 --- a/libavcodec/vp9block.c +++ b/libavcodec/vp9block.c @@ -71,7 +71,8 @@ static void decode_mode(VP9Context *s, VP9Block *const b) vp56_rac_get_prob_branchy(&s->c, s->prob.segpred[s->above_segpred_ctx[col] + s->left_segpred_ctx[row7]]))) { -int pred = 8, x; +int pred = MAX_SEGMENT - 1; +int x; for (y = 0; y < h4; y++) for (x = 0; x < w4; x++) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '1f80742f49a9a4e846c9f099387881abc87150b2'
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 21 23:45:26 2014 +0100| [70e3fae88d5993b69016c82d4528ad343cc19e3b] | committer: Michael Niedermayer Merge commit '1f80742f49a9a4e846c9f099387881abc87150b2' * commit '1f80742f49a9a4e846c9f099387881abc87150b2': qdm2: avoid integer overflow See: ccfd8cffe867d534447dbc5beb96ff39e65e2791 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70e3fae88d5993b69016c82d4528ad343cc19e3b --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] qdm2: avoid integer overflow
ffmpeg | branch: master | Vittorio Giovara | Wed Nov 12 19:10:44 2014 +0100| [1f80742f49a9a4e846c9f099387881abc87150b2] | committer: Vittorio Giovara qdm2: avoid integer overflow CC: libav-sta...@libav.org Bug-Id: CID 700555 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f80742f49a9a4e846c9f099387881abc87150b2 --- libavcodec/qdm2.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 94bda91..4718b34 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -730,7 +730,7 @@ static void fill_coding_method_array(sb_int8_array tone_level_idx, for (j = 0; j < 64; j++) acc += tone_level_idx_temp[ch][sb][j]; -multres = 0x6667 * (acc * 10); +multres = 0x6667LL * (acc * 10); esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31); for (ch = 0; ch < nb_channels; ch++) for (sb = 0; sb < 30; sb++) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'cd975d5658a1cbe99939df75db59d5ae9fbcb4e0'
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 22 01:23:42 2014 +0100| [148506c965dde46ca8166c04f398bd8e85f81f3c] | committer: Michael Niedermayer Merge commit 'cd975d5658a1cbe99939df75db59d5ae9fbcb4e0' * commit 'cd975d5658a1cbe99939df75db59d5ae9fbcb4e0': hevc: Spin the mv_mpv_mode calls in a stand alone function Conflicts: libavcodec/hevc.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=148506c965dde46ca8166c04f398bd8e85f81f3c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hevc: Spin the mv_mpv_mode calls in a stand alone function
ffmpeg | branch: master | Luca Barbato | Sun Nov 16 11:29:41 2014 +0100| [cd975d5658a1cbe99939df75db59d5ae9fbcb4e0] | committer: Luca Barbato hevc: Spin the mv_mpv_mode calls in a stand alone function Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd975d5658a1cbe99939df75db59d5ae9fbcb4e0 --- libavcodec/hevc.c | 86 - 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 3dcbe60..08bed86 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -1621,6 +1621,50 @@ static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref, ff_thread_await_progress(&ref->tf, y, 0); } +static void hevc_luma_mv_mpv_mode(HEVCContext *s, int x0, int y0, int nPbW, + int nPbH, int log2_cb_size, int part_idx, + int merge_idx, MvField *mv) +{ +HEVCLocalContext *lc = &s->HEVClc; +enum InterPredIdc inter_pred_idc = PRED_L0; +int mvp_flag; + +ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH); +if (s->sh.slice_type == B_SLICE) +inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH); + +if (inter_pred_idc != PRED_L1) { +if (s->sh.nb_refs[L0]) +mv->ref_idx[0]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]); + +mv->pred_flag[0] = 1; +hls_mvd_coding(s, x0, y0, 0); +mvp_flag = ff_hevc_mvp_lx_flag_decode(s); +ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + part_idx, merge_idx, mv, mvp_flag, 0); +mv->mv[0].x += lc->pu.mvd.x; +mv->mv[0].y += lc->pu.mvd.y; +} + +if (inter_pred_idc != PRED_L0) { +if (s->sh.nb_refs[L1]) +mv->ref_idx[1]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L1]); + +if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) { +AV_ZERO32(&lc->pu.mvd); +} else { +hls_mvd_coding(s, x0, y0, 1); +} + +mv->pred_flag[1] = 1; +mvp_flag = ff_hevc_mvp_lx_flag_decode(s); +ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + part_idx, merge_idx, mv, mvp_flag, 1); +mv->mv[1].x += lc->pu.mvd.x; +mv->mv[1].y += lc->pu.mvd.y; +} +} + static void hls_prediction_unit(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int partIdx) @@ -1664,46 +1708,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, partIdx, merge_idx, ¤t_mv); } else { -enum InterPredIdc inter_pred_idc = PRED_L0; -int mvp_flag; - -ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH); -if (s->sh.slice_type == B_SLICE) -inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH); - -if (inter_pred_idc != PRED_L1) { -if (s->sh.nb_refs[L0]) { -current_mv.ref_idx[0]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]); -} -current_mv.pred_flag[0] = 1; -hls_mvd_coding(s, x0, y0, 0); -mvp_flag = ff_hevc_mvp_lx_flag_decode(s); -ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, - partIdx, merge_idx, ¤t_mv, - mvp_flag, 0); -current_mv.mv[0].x += lc->pu.mvd.x; -current_mv.mv[0].y += lc->pu.mvd.y; -} - -if (inter_pred_idc != PRED_L0) { -if (s->sh.nb_refs[L1]) { -current_mv.ref_idx[1]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L1]); -} - -if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) { -AV_ZERO32(&lc->pu.mvd); -} else { -hls_mvd_coding(s, x0, y0, 1); -} - -current_mv.pred_flag[1] = 1; -mvp_flag = ff_hevc_mvp_lx_flag_decode(s); -ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, - partIdx, merge_idx, ¤t_mv, - mvp_flag, 1); -current_mv.mv[1].x += lc->pu.mvd.x; -current_mv.mv[1].y += lc->pu.mvd.y; -} +hevc_luma_mv_mpv_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + partIdx, merge_idx, ¤t_mv); } x_pu = x0 >> s->sps->log2_min_pu_size; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc: fix the the typos
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 22 02:09:09 2014 +0100| [230aeee94c279f59b4b206706f6d422c9094e418] | committer: Michael Niedermayer doc: fix the the typos Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=230aeee94c279f59b4b206706f6d422c9094e418 --- doc/examples/transcode_aac.c |2 +- doc/protocols.texi |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index cee447f..e98c217 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -306,7 +306,7 @@ static int decode_audio_frame(AVFrame *frame, /** Read one audio frame from the input file into a temporary packet. */ if ((error = av_read_frame(input_format_context, &input_packet)) < 0) { -/** If we are the the end of the file, flush the decoder below. */ +/** If we are at the end of the file, flush the decoder below. */ if (error == AVERROR_EOF) *finished = 1; else { diff --git a/doc/protocols.texi b/doc/protocols.texi index dc2fdb1..d165bda 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -750,7 +750,7 @@ port will be used for the local RTP and RTCP ports. @item If @option{localrtcpport} (the local RTCP port) is not set it will be -set to the the local RTP port value plus 1. +set to the local RTP port value plus 1. @end enumerate @section rtsp ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/decoders.texi: typo in description for option ifo_palette
ffmpeg | branch: master | TOYAMA Shin-ichi | Sat Nov 22 09:23:43 2014 +0900| [e01acd868b010b9a9fd89202284553c90be1abf5] | committer: Michael Niedermayer doc/decoders.texi: typo in description for option ifo_palette Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e01acd868b010b9a9fd89202284553c90be1abf5 --- doc/decoders.texi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/decoders.texi b/doc/decoders.texi index 2c920e7..01fca9f 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -192,7 +192,7 @@ ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}. @item ifo_palette -Specify the the IFO file from which the global palette is obtained. +Specify the IFO file from which the global palette is obtained. (experimental) @item forced_subs_only ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavformat/mxfdec.c: export source package uids and names as metadata
ffmpeg | branch: master | Mark Reid | Fri Nov 21 17:43:09 2014 -0800| [08d81d0a01e484dca3de0a269d042f151b8aeacd] | committer: Michael Niedermayer libavformat/mxfdec.c: export source package uids and names as metadata Changes since v1: * renamed mxf_read_source_package -> mxf_read_package v1 reviewed-by: Tomas Härdin Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08d81d0a01e484dca3de0a269d042f151b8aeacd --- libavformat/mxfdec.c | 78 ++ 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index fa0a2f4..cc740b5 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -668,22 +668,6 @@ static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, U return 0; } -static int mxf_read_material_package(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) -{ -MXFPackage *package = arg; -switch(tag) { -case 0x4403: -package->tracks_count = avio_rb32(pb); -package->tracks_refs = av_calloc(package->tracks_count, sizeof(UID)); -if (!package->tracks_refs) -return AVERROR(ENOMEM); -avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */ -avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID)); -break; -} -return 0; -} - static int mxf_read_timecode_component(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFTimecodeComponent *mxf_timecode = arg; @@ -779,7 +763,7 @@ static int mxf_read_utf16_string(AVIOContext *pb, int size, char** str) return ret; } -static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) +static int mxf_read_package(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFPackage *package = arg; switch(tag) { @@ -1416,6 +1400,34 @@ static int mxf_is_intra_only(MXFDescriptor *descriptor) &descriptor->essence_codec_ul)->id != AV_CODEC_ID_NONE; } +static int mxf_uid_to_str(UID uid, char **str) +{ +int i; +char *p; +p = *str = av_mallocz(sizeof(UID) * 2 + 4 + 1); +if (!p) +return AVERROR(ENOMEM); +for (i = 0; i < sizeof(UID); i++) { +snprintf(p, 2 + 1, "%.2x", uid[i]); +p += 2; +if (i == 3 || i == 5 || i == 7 || i == 9) { +snprintf(p, 1 + 1, "-"); +p++; +} +} +return 0; +} + +static int mxf_add_uid_metadata(AVDictionary **pm, const char *key, UID uid) +{ +char *str; +int ret; +if ((ret = mxf_uid_to_str(uid, &str)) < 0) +return ret; +av_dict_set(pm, key, str, AV_DICT_DONT_STRDUP_VAL); +return 0; +} + static int mxf_add_timecode_metadata(AVDictionary **pm, const char *key, AVTimecode *tc) { char buf[AV_TIMECODE_STR_SIZE]; @@ -1476,6 +1488,8 @@ static int mxf_parse_physical_source_package(MXFContext *mxf, MXFTrack *source_t if (!physical_package) break; +mxf_add_uid_metadata(&st->metadata, "reel_uid", physical_package->package_uid); + /* the name of physical source package is name of the reel or tape */ if (physical_package->name && physical_package->name[0]) av_dict_set(&st->metadata, "reel_name", physical_package->name, 0); @@ -1532,6 +1546,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) return AVERROR_INVALIDDATA; } +mxf_add_uid_metadata(&mxf->fc->metadata, "material_package_uid", material_package->package_uid); +if (material_package->name && material_package->name[0]) +av_dict_set(&mxf->fc->metadata, "material_package_name", material_package->name, 0); + for (i = 0; i < material_package->tracks_count; i++) { MXFPackage *source_package = NULL; MXFTrack *material_track = NULL; @@ -1712,6 +1730,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } av_log(mxf->fc, AV_LOG_VERBOSE, "\n"); +mxf_add_uid_metadata(&st->metadata, "file_package_uid", source_package->package_uid); +if (source_package->name && source_package->name[0]) +av_dict_set(&st->metadata, "file_package_name", source_package->name, 0); + mxf_parse_physical_source_package(mxf, source_track, st); if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { @@ -1851,24 +1873,6 @@ fail_and_free: return ret; } -static int mxf_uid_to_str(UID uid, char **str) -{ -int i; -char *p; -p = *str = av_mallocz(sizeof(UID) * 2 + 4 + 1); -if (!p) -return AVERROR(ENOMEM); -for (i = 0; i < sizeof(UID); i++) { -snprintf(p, 2 + 1, "%.2x", uid[i]); -p += 2; -if (i == 3 || i == 5 || i == 7 || i == 9) { -snprintf(p, 1 + 1, "-"); -p++; -