[FFmpeg-cvslog] libavfilter/vf_blend: do not unconditionally compile both filters
ffmpeg | branch: master | Paul B Mahol | Sun Jan 4 12:27:56 2015 +| [91bdb244009c7d33d547bf7901ef1ae4538a51df] | committer: Paul B Mahol libavfilter/vf_blend: do not unconditionally compile both filters Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91bdb244009c7d33d547bf7901ef1ae4538a51df --- libavfilter/vf_blend.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index 538774b..a29cabc 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -373,6 +373,20 @@ static int query_formats(AVFilterContext *ctx) return 0; } +static av_cold void uninit(AVFilterContext *ctx) +{ +BlendContext *b = ctx->priv; +int i; + +ff_dualinput_uninit(&b->dinput); +av_freep(&b->prev_frame); + +for (i = 0; i < FF_ARRAY_ELEMS(b->params); i++) +av_expr_free(b->params[i].e); +} + +#if CONFIG_BLEND_FILTER + static int config_output(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; @@ -418,18 +432,6 @@ static int config_output(AVFilterLink *outlink) return 0; } -static av_cold void uninit(AVFilterContext *ctx) -{ -BlendContext *b = ctx->priv; -int i; - -ff_dualinput_uninit(&b->dinput); -av_freep(&b->prev_frame); - -for (i = 0; i < FF_ARRAY_ELEMS(b->params); i++) -av_expr_free(b->params[i].e); -} - static int request_frame(AVFilterLink *outlink) { BlendContext *b = outlink->src->priv; @@ -478,6 +480,10 @@ AVFilter ff_vf_blend = { .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, }; +#endif + +#if CONFIG_TBLEND_FILTER + static int tblend_config_output(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; @@ -545,3 +551,5 @@ AVFilter ff_vf_tblend = { .outputs = tblend_outputs, .flags = AVFILTER_FLAG_SLICE_THREADS, }; + +#endif ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] cmdutils: update copyright year to 2015.
ffmpeg | branch: master | Johan Andersson | Sat Jan 3 17:31:36 2015 +0100| [3e160652219ff4da433f5672ae1e5f4956abb815] | committer: Martin Storsjö cmdutils: update copyright year to 2015. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e160652219ff4da433f5672ae1e5f4956abb815 --- cmdutils.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdutils.c b/cmdutils.c index f074dd0..e01ad24 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -58,7 +58,7 @@ struct SwsContext *sws_opts; AVDictionary *format_opts, *codec_opts, *resample_opts; -static const int this_year = 2014; +static const int this_year = 2015; void init_opts(void) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Factorize avpriv_mirror() out
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 04:15:01 2015 +0100| [0f931b29f7e969a3c6159cb7173226e806f26f39] | committer: Michael Niedermayer Factorize avpriv_mirror() out Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f931b29f7e969a3c6159cb7173226e806f26f39 --- libavcodec/dirac_dwt.c | 30 +++ libavcodec/snow_dwt.c | 70 +++- libavfilter/transform.c| 14 ++--- libavfilter/vf_owdenoise.c | 17 +++ libavfilter/vf_sab.c | 19 ++-- libavutil/internal.h | 13 6 files changed, 62 insertions(+), 101 deletions(-) diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c index 96d8bae..da2da75 100644 --- a/libavcodec/dirac_dwt.c +++ b/libavcodec/dirac_dwt.c @@ -26,16 +26,6 @@ #include "libavcodec/x86/dirac_dwt.h" -static inline int mirror(int v, int m) -{ -while ((unsigned)v > (unsigned)m) { -v = -v; -if (v < 0) -v += 2 * m; -} -return v; -} - static void vertical_compose53iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width) { @@ -307,8 +297,8 @@ static void spatial_compose_dirac53i_dy(DWTContext *d, int level, int width, int int y= cs->y; IDWTELEM *b[4] = { cs->b[0], cs->b[1] }; -b[2] = d->buffer + mirror(y+1, height-1)*stride; -b[3] = d->buffer + mirror(y+2, height-1)*stride; +b[2] = d->buffer + avpriv_mirror(y+1, height-1)*stride; +b[3] = d->buffer + avpriv_mirror(y+2, height-1)*stride; if(y+1<(unsigned)height) vertical_compose_l0(b[1], b[2], b[3], width); if(y+0<(unsigned)height) vertical_compose_h0(b[0], b[1], b[2], width); @@ -400,8 +390,8 @@ static void spatial_compose_daub97i_dy(DWTContext *d, int level, int width, int IDWTELEM *b[6]; for (i = 0; i < 4; i++) b[i] = cs->b[i]; -b[4] = d->buffer + mirror(y+3, height-1)*stride; -b[5] = d->buffer + mirror(y+4, height-1)*stride; +b[4] = d->buffer + avpriv_mirror(y+3, height-1)*stride; +b[5] = d->buffer + avpriv_mirror(y+4, height-1)*stride; if(y+3<(unsigned)height) vertical_compose_l1(b[3], b[4], b[5], width); if(y+2<(unsigned)height) vertical_compose_h1(b[2], b[3], b[4], width); @@ -419,17 +409,17 @@ static void spatial_compose_daub97i_dy(DWTContext *d, int level, int width, int static void spatial_compose97i_init2(DWTCompose *cs, IDWTELEM *buffer, int height, int stride) { -cs->b[0] = buffer + mirror(-3-1, height-1)*stride; -cs->b[1] = buffer + mirror(-3 , height-1)*stride; -cs->b[2] = buffer + mirror(-3+1, height-1)*stride; -cs->b[3] = buffer + mirror(-3+2, height-1)*stride; +cs->b[0] = buffer + avpriv_mirror(-3-1, height-1)*stride; +cs->b[1] = buffer + avpriv_mirror(-3 , height-1)*stride; +cs->b[2] = buffer + avpriv_mirror(-3+1, height-1)*stride; +cs->b[3] = buffer + avpriv_mirror(-3+2, height-1)*stride; cs->y = -3; } static void spatial_compose53i_init2(DWTCompose *cs, IDWTELEM *buffer, int height, int stride) { -cs->b[0] = buffer + mirror(-1-1, height-1)*stride; -cs->b[1] = buffer + mirror(-1 , height-1)*stride; +cs->b[0] = buffer + avpriv_mirror(-1-1, height-1)*stride; +cs->b[1] = buffer + avpriv_mirror(-1 , height-1)*stride; cs->y = -1; } diff --git a/libavcodec/snow_dwt.c b/libavcodec/snow_dwt.c index 986a6b9..ecba0ea 100644 --- a/libavcodec/snow_dwt.c +++ b/libavcodec/snow_dwt.c @@ -112,16 +112,6 @@ void ff_slice_buffer_destroy(slice_buffer *buf) av_freep(&buf->line); } -static inline int mirror(int v, int m) -{ -while ((unsigned)v > (unsigned)m) { -v = -v; -if (v < 0) -v += 2 * m; -} -return v; -} - static av_always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, @@ -223,12 +213,12 @@ static void spatial_decompose53i(DWTELEM *buffer, DWTELEM *temp, int width, int height, int stride) { int y; -DWTELEM *b0 = buffer + mirror(-2 - 1, height - 1) * stride; -DWTELEM *b1 = buffer + mirror(-2, height - 1) * stride; +DWTELEM *b0 = buffer + avpriv_mirror(-2 - 1, height - 1) * stride; +DWTELEM *b1 = buffer + avpriv_mirror(-2, height - 1) * stride; for (y = -2; y < height; y += 2) { -DWTELEM *b2 = buffer + mirror(y + 1, height - 1) * stride; -DWTELEM *b3 = buffer + mirror(y + 2, height - 1) * stride; +DWTELEM *b2 = buffer + avpriv_mirror(y + 1, height - 1) * stride; +DWTELEM *b3 = buffer + avpriv_mirror(y + 2, height - 1) * stride; if (y + 1 < (unsigned)height) horizontal_decompose53i(b2, temp, width); @@ -296,14 +286,14 @@ static void spatial_decompose97i(DWTELEM *buffer,
[FFmpeg-cvslog] avfilter/vf_sab: fix filtering tiny images
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 01:03:26 2015 +0100| [9bff052b51f27f6cce04e8d7d8b405c710d7ad67] | committer: Michael Niedermayer avfilter/vf_sab: fix filtering tiny images Fixes out of array reads Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9bff052b51f27f6cce04e8d7d8b405c710d7ad67 --- libavfilter/vf_sab.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_sab.c b/libavfilter/vf_sab.c index aa38b53..b8af27c 100644 --- a/libavfilter/vf_sab.c +++ b/libavfilter/vf_sab.c @@ -220,6 +220,19 @@ static int config_props(AVFilterLink *inlink) #define NB_PLANES 4 +static inline int mirror(int x, int w) +{ +if (!w) +return 0; + +while ((unsigned)x > (unsigned)w) { +x = -x; +if (x < 0) +x += 2 * w; +} +return x; +} + static void blur(uint8_t *dst, const int dst_linesize, const uint8_t *src, const int src_linesize, const int w, const int h, FilterParam *fp) @@ -253,8 +266,7 @@ static void blur(uint8_t *dst, const int dst_linesize, for (dy = 0; dy < radius*2 + 1; dy++) { int dx; int iy = y+dy - radius; -if (iy < 0) iy = -iy; -else if (iy >= h) iy = h+h-iy-1; +iy = mirror(iy, h-1); for (dx = 0; dx < radius*2 + 1; dx++) { const int ix = x+dx - radius; @@ -265,13 +277,11 @@ static void blur(uint8_t *dst, const int dst_linesize, for (dy = 0; dy < radius*2+1; dy++) { int dx; int iy = y+dy - radius; -if (iy < 0) iy = -iy; -else if (iy >= h) iy = h+h-iy-1; +iy = mirror(iy, h-1); for (dx = 0; dx < radius*2 + 1; dx++) { int ix = x+dx - radius; -if (ix < 0) ix = -ix; -else if (ix >= w) ix = w+w-ix-1; +ix = mirror(ix, w-1); UPDATE_FACTOR; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] movenc: Enable editlists by default if delay_moov is enabled
ffmpeg | branch: master | Martin Storsjö | Sat Jan 3 01:44:38 2015 +0200| [46808fdf04ab113df374157b90b506eb3110daf2] | committer: Martin Storsjö movenc: Enable editlists by default if delay_moov is enabled Being able to write editlists properly is one of the main points in the delay_moov flag. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46808fdf04ab113df374157b90b506eb3110daf2 --- libavformat/dashenc.c |1 - libavformat/movenc.c |3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 5e06e35..1432fc3 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -627,7 +627,6 @@ static int dash_write_header(AVFormatContext *s) os->init_start_pos = 0; av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 0); -av_dict_set(&opts, "use_editlist", "1", 0); if ((ret = avformat_write_header(ctx, &opts)) < 0) { goto fail; } diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 75c2d27..72da010 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3696,7 +3696,8 @@ static int mov_write_header(AVFormatContext *s) if (mov->use_editlist < 0) { mov->use_editlist = 1; -if (mov->flags & FF_MOV_FLAG_FRAGMENT) { +if (mov->flags & FF_MOV_FLAG_FRAGMENT && +!(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) { // If we can avoid needing an edit list by shifting the // tracks, prefer that over (trying to) write edit lists // in fragmented output. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavformat: Remove a misleading/incorrect comment
ffmpeg | branch: master | Martin Storsjö | Sat Jan 3 21:22:31 2015 +0200| [c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28] | committer: Martin Storsjö libavformat: Remove a misleading/incorrect comment This comment can be traced back to the initial commit from 2001, and it seemed to be misleading/incorect already back then. (It was used for normal, non-raw file formats already then.) Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28 --- libavformat/avformat.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ade5d2f..df9a602 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -577,8 +577,8 @@ typedef struct AVInputFormat { /** * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. + * structure. Return 0 if OK. 'avformat_new_stream' should be + * called to create new streams. */ int (*read_header)(struct AVFormatContext *); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/flvenc: omit more metadata elements with specific meaning
ffmpeg | branch: master | Michael Niedermayer | Sat Jan 3 23:03:55 2015 +0100| [58721388b89bc1f8ecdc304ca86462fb7202527f] | committer: Michael Niedermayer avformat/flvenc: omit more metadata elements with specific meaning Reviewed-by: Thilo Borgmann Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58721388b89bc1f8ecdc304ca86462fb7202527f --- libavformat/flvenc.c |8 1 file changed, 8 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 5468c4d..5e27ed0 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -288,6 +288,14 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) ||!strcmp(tag->key, "audiocodecid") ||!strcmp(tag->key, "duration") ||!strcmp(tag->key, "onMetaData") +||!strcmp(tag->key, "datasize") +||!strcmp(tag->key, "lasttimestamp") +||!strcmp(tag->key, "totalframes") +||!strcmp(tag->key, "hasAudio") +||!strcmp(tag->key, "hasVideo") +||!strcmp(tag->key, "hasCuePoints") +||!strcmp(tag->key, "hasMetadata") +||!strcmp(tag->key, "hasKeyframes") ){ av_log(s, AV_LOG_DEBUG, "Ignoring metadata for %s\n", tag->key); continue; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/rawdec: Make ff_raw_data_read_header() non static
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 23:18:43 2015 +0100| [dc265e2b6b6b8a1f461e6db3bbd4568dd6971e56] | committer: Michael Niedermayer avformat/rawdec: Make ff_raw_data_read_header() non static This is similar to the raw video read header Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc265e2b6b6b8a1f461e6db3bbd4568dd6971e56 --- libavformat/rawdec.c |2 +- libavformat/rawdec.h |2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index bbb76b6..b903e63 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -92,7 +92,7 @@ fail: return ret; } -static int ff_raw_data_read_header(AVFormatContext *s) +int ff_raw_data_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 328a4fb..835b42d 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -41,6 +41,8 @@ int ff_raw_audio_read_header(AVFormatContext *s); int ff_raw_video_read_header(AVFormatContext *s); +int ff_raw_data_read_header(AVFormatContext *s); + #define FF_RAWVIDEO_DEMUXER_CLASS(name)\ static const AVClass name ## _demuxer_class = {\ .class_name = #name " demuxer",\ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavformat: Check for malloc failures in avformat_new_stream
ffmpeg | branch: master | Martin Storsjö | Sat Jan 3 21:27:21 2015 +0200| [9f810a9b374e0ff8e2a19fd8a7347afe2933e229] | committer: Martin Storsjö libavformat: Check for malloc failures in avformat_new_stream CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f810a9b374e0ff8e2a19fd8a7347afe2933e229 --- libavformat/utils.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 3ea0ebd..ce715f7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2525,6 +2525,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) } st->codec = avcodec_alloc_context3(c); +if (!st->codec) { +av_free(st->info); +av_free(st); +return NULL; +} if (s->iformat) { /* no default bitrate if decoding */ st->codec->bit_rate = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Remap -L to -libpath for msvc
ffmpeg | branch: master | Martin Storsjö | Fri Jan 2 23:29:27 2015 +0200| [f4d4e66a24a5c9497a5b6d3c089ac58089a87428] | committer: Martin Storsjö configure: Remap -L to -libpath for msvc This allows using libraries that are detected via pkg-config with msvc. (The libraries themselves may have to be built with MSVC though.) Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f4d4e66a24a5c9497a5b6d3c089ac58089a87428 --- configure |1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 48669a0..6648035 100755 --- a/configure +++ b/configure @@ -2702,6 +2702,7 @@ msvc_common_flags(){ -lavifil32) echo vfw32.lib ;; -lavicap32) echo vfw32.lib user32.lib ;; -l*) echo ${flag#-l}.lib ;; +-L*) echo -libpath:${flag#-L} ;; *)echo $flag ;; esac done ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: add dvbsub demuxer
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 23:20:52 2015 +0100| [e313735d7d7d0217540eb596904075f3d2e31c33] | committer: Michael Niedermayer avformat: add dvbsub demuxer This is needed for probing some dvbsub streams in mpegts Fixes part of ticket4221 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e313735d7d7d0217540eb596904075f3d2e31c33 --- libavformat/Makefile |1 + libavformat/allformats.c |1 + libavformat/dvbsub.c | 66 ++ libavformat/version.h|2 +- 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 7e4beac..5eb834e 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -130,6 +130,7 @@ OBJS-$(CONFIG_DTS_DEMUXER) += dtsdec.o rawdec.o OBJS-$(CONFIG_DTS_MUXER) += rawenc.o OBJS-$(CONFIG_DV_DEMUXER)+= dv.o OBJS-$(CONFIG_DV_MUXER) += dvenc.o +OBJS-$(CONFIG_DVBSUB_DEMUXER)+= dvbsub.o OBJS-$(CONFIG_DXA_DEMUXER) += dxa.o OBJS-$(CONFIG_EA_CDATA_DEMUXER) += eacdata.o OBJS-$(CONFIG_EA_DEMUXER)+= electronicarts.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index a55e209..bc033ef 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -113,6 +113,7 @@ void av_register_all(void) REGISTER_MUXDEMUX(DTS, dts); REGISTER_DEMUXER (DTSHD,dtshd); REGISTER_MUXDEMUX(DV, dv); +REGISTER_DEMUXER (DVBSUB, dvbsub); REGISTER_DEMUXER (DXA, dxa); REGISTER_DEMUXER (EA, ea); REGISTER_DEMUXER (EA_CDATA, ea_cdata); diff --git a/libavformat/dvbsub.c b/libavformat/dvbsub.c new file mode 100644 index 000..73d9c3e --- /dev/null +++ b/libavformat/dvbsub.c @@ -0,0 +1,66 @@ +/* + * RAW dvbsub demuxer + * Copyright (c) 2015 Michael Niedermayer + * + * 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 + */ + +#include "libavutil/intreadwrite.h" + +#include "avformat.h" +#include "rawdec.h" + + +static int dvbsub_probe(AVProbeData *p) +{ +int i, j, k; +const uint8_t *end = p->buf + p->buf_size; +int type, page_id, len; +int max_score = 0; + +for(i=0; ibuf_size; i++){ +const uint8_t *ptr = p->buf + i; +uint8_t histogram[6] = {0}; +int min = 255; +for(j=0; ptr + 6 < end; j++) { +if (*ptr != 0x0f) +break; +type= ptr[1]; +page_id = AV_RB16(ptr + 2); +len = AV_RB16(ptr + 4); +if (type == 0x80) { +; +} else if (type >= 0x10 && type <= 0x14) { +histogram[type - 0x10] ++; +} else +break; +ptr += 6 + len; +} +for (k=0; k < 4; k++) { +min = FFMIN(min, histogram[k]); +} +if (min && j > max_score) +max_score = j; +} + +if (max_score > 5) +return AVPROBE_SCORE_EXTENSION/2; + +return 0; +} + +FF_DEF_RAWSUB_DEMUXER(dvbsub, "raw dvbsub", dvbsub_probe, NULL, AV_CODEC_ID_DVB_SUBTITLE, AVFMT_GENERIC_INDEX) diff --git a/libavformat/version.h b/libavformat/version.h index 9c12164..d5c8f6b 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 56 -#define LIBAVFORMAT_VERSION_MINOR 17 +#define LIBAVFORMAT_VERSION_MINOR 18 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '3e160652219ff4da433f5672ae1e5f4956abb815'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 02:10:17 2015 +0100| [1d41571bbf0dc1624f8e3b667e9225d43b04019c] | committer: Michael Niedermayer Merge commit '3e160652219ff4da433f5672ae1e5f4956abb815' * commit '3e160652219ff4da433f5672ae1e5f4956abb815': cmdutils: update copyright year to 2015. Conflicts: cmdutils.c See: b8db25a3338b67186837c49580fe538d63dd73c7 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d41571bbf0dc1624f8e3b667e9225d43b04019c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9f810a9b374e0ff8e2a19fd8a7347afe2933e229'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 02:33:55 2015 +0100| [e7521d9771eac5ba07558b2b2dba1155e57b9670] | committer: Michael Niedermayer Merge commit '9f810a9b374e0ff8e2a19fd8a7347afe2933e229' * commit '9f810a9b374e0ff8e2a19fd8a7347afe2933e229': libavformat: Check for malloc failures in avformat_new_stream See: a66893ac949864352b36b39e48c4cd72bbd81e54 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e7521d9771eac5ba07558b2b2dba1155e57b9670 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '46808fdf04ab113df374157b90b506eb3110daf2'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 02:45:29 2015 +0100| [fb22e5ae4585c31fcf4ebe1d255f6eeb24d600e3] | committer: Michael Niedermayer Merge commit '46808fdf04ab113df374157b90b506eb3110daf2' * commit '46808fdf04ab113df374157b90b506eb3110daf2': movenc: Enable editlists by default if delay_moov is enabled Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb22e5ae4585c31fcf4ebe1d255f6eeb24d600e3 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f4d4e66a24a5c9497a5b6d3c089ac58089a87428'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 02:19:47 2015 +0100| [1ed5912e819d4ecf60c9cbe15f3787062d39873e] | committer: Michael Niedermayer Merge commit 'f4d4e66a24a5c9497a5b6d3c089ac58089a87428' * commit 'f4d4e66a24a5c9497a5b6d3c089ac58089a87428': configure: Remap -L to -libpath for msvc Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ed5912e819d4ecf60c9cbe15f3787062d39873e --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 02:26:37 2015 +0100| [dd4de4a987f33cb33c9f4aae59e70522ed0982e2] | committer: Michael Niedermayer Merge commit 'c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28' * commit 'c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28': libavformat: Remove a misleading/incorrect comment Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd4de4a987f33cb33c9f4aae59e70522ed0982e2 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge remote-tracking branch 'origin/master'
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 15:55:40 2015 +0100| [0e1c827e842c0a86eb32de853162d97e214e2b23] | committer: Michael Niedermayer Merge remote-tracking branch 'origin/master' * origin/master: libavfilter/vf_blend: do not unconditionally compile both filters Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e1c827e842c0a86eb32de853162d97e214e2b23 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/rawdec: Add FF_DEF_RAWSUB_DEMUXER
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 23:19:49 2015 +0100| [d1781fd786debb4f41964afd07ba7ae92bd5565b] | committer: Michael Niedermayer avformat/rawdec: Add FF_DEF_RAWSUB_DEMUXER This is similar to the corresponding audio and video macros Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1781fd786debb4f41964afd07ba7ae92bd5565b --- libavformat/rawdec.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 835b42d..a464bbb 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -69,4 +69,27 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\ #define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\ FF_DEF_RAWVIDEO_DEMUXER2(shortname, longname, probe, ext, id, AVFMT_GENERIC_INDEX) +#define FF_RAWSUB_DEMUXER_CLASS(name)\ +static const AVClass name ## _demuxer_class = {\ +.class_name = #name " demuxer",\ +.item_name = av_default_item_name,\ +.option = NULL,\ +.version= LIBAVUTIL_VERSION_INT,\ +}; + +#define FF_DEF_RAWSUB_DEMUXER(shortname, longname, probe, ext, id, flag)\ +FF_RAWVIDEO_DEMUXER_CLASS(shortname)\ +AVInputFormat ff_ ## shortname ## _demuxer = {\ +.name = #shortname,\ +.long_name = NULL_IF_CONFIG_SMALL(longname),\ +.read_probe = probe,\ +.read_header= ff_raw_data_read_header,\ +.read_packet= ff_raw_read_partial_packet,\ +.extensions = ext,\ +.flags = flag,\ +.raw_codec_id = id,\ +.priv_data_size = 0,\ +.priv_class = &shortname ## _demuxer_class,\ +}; + #endif /* AVFORMAT_RAWDEC_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dvdsubdec: fix out of bounds accesses
ffmpeg | branch: master | wm4 | Mon Jan 5 04:45:26 2015 +0100| [c9151de7c42553bb145be608df8513c1287f1f24] | committer: Michael Niedermayer avcodec/dvdsubdec: fix out of bounds accesses The code blindly trusted buffer offsets read from the file in the RLE decoder. Explicitly check the offset. Also error out on other RLE decoding errors. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9151de7c42553bb145be608df8513c1287f1f24 --- libavcodec/dvdsubdec.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index c7d85a6..2423cad 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -108,6 +108,9 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, int x, y, len, color; uint8_t *d; +if (start >= buf_size) +return -1; + bit_len = (buf_size - start) * 8; init_get_bits(&gb, buf + start, bit_len); @@ -359,10 +362,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect)); sub_header->num_rects = 1; sub_header->rects[0]->pict.data[0] = bitmap; -decode_rle(bitmap, w * 2, w, (h + 1) / 2, - buf, offset1, buf_size, is_8bit); -decode_rle(bitmap + w, w * 2, w, h / 2, - buf, offset2, buf_size, is_8bit); +if (decode_rle(bitmap, w * 2, w, (h + 1) / 2, + buf, offset1, buf_size, is_8bit) < 0) +goto fail; +if (decode_rle(bitmap + w, w * 2, w, h / 2, + buf, offset2, buf_size, is_8bit) < 0) +goto fail; sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE); if (is_8bit) { if (!yuv_palette) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: add dvbsub to set_codec_from_probe_data()
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 4 23:21:54 2015 +0100| [ce1e10aa24ccf9682ede2f08cffbb3e96ebbd299] | committer: Michael Niedermayer avformat/utils: add dvbsub to set_codec_from_probe_data() Fixes part of ticket 4221 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce1e10aa24ccf9682ede2f08cffbb3e96ebbd299 --- libavformat/utils.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 752270d..63a8616 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -273,6 +273,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, { "aac", AV_CODEC_ID_AAC,AVMEDIA_TYPE_AUDIO }, { "ac3", AV_CODEC_ID_AC3,AVMEDIA_TYPE_AUDIO }, { "dts", AV_CODEC_ID_DTS,AVMEDIA_TYPE_AUDIO }, +{ "dvbsub",AV_CODEC_ID_DVB_SUBTITLE,AVMEDIA_TYPE_SUBTITLE }, { "eac3", AV_CODEC_ID_EAC3, AVMEDIA_TYPE_AUDIO }, { "h264", AV_CODEC_ID_H264, AVMEDIA_TYPE_VIDEO }, { "hevc", AV_CODEC_ID_HEVC, AVMEDIA_TYPE_VIDEO }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/ffmpeg: mention both ffpreset/avpreset in documentation, remove superfluous example
ffmpeg | branch: master | Werner Robitza | Fri Jan 2 11:11:48 2015 +0100| [beedeb4399fe5f6d3a9c9fcc4f0d5e856bfd7581] | committer: Michael Niedermayer doc/ffmpeg: mention both ffpreset/avpreset in documentation, remove superfluous example ffmpeg looks for both .ffpreset and .avpreset files depending on whether the -[avsf]pre or -pre option is used. Added two sections for each type of preset including the rules according to which files are searched. (Notably, the lookup order is swapped for avpreset files, because it first looks for _.avpreset and then for .avpreset.) This removes the section explaining -pre only, which was under "Examples", where it did not really make sense. Signed-off-by: Werner Robitza Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=beedeb4399fe5f6d3a9c9fcc4f0d5e856bfd7581 --- doc/ffmpeg.texi | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 6de5004..396c623 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1214,7 +1214,10 @@ awkward to specify on the command line. Lines starting with the hash ('#') character are ignored and are used to provide comments. Check the @file{presets} directory in the FFmpeg source tree for examples. -Preset files are specified with the @code{vpre}, @code{apre}, +There are two types of preset files: ffpreset and avpreset files. + +@subsection ffpreset files +ffpreset files are specified with the @code{vpre}, @code{apre}, @code{spre}, and @code{fpre} options. The @code{fpre} option takes the filename of the preset instead of a preset name as input and can be used for any kind of codec. For the @code{vpre}, @code{apre}, and @@ -1239,6 +1242,26 @@ directories, where @var{codec_name} is the name of the codec to which the preset file options will be applied. For example, if you select the video codec with @code{-vcodec libvpx} and use @code{-vpre 1080p}, then it will search for the file @file{libvpx-1080p.ffpreset}. + +@subsection avpreset files +avpreset files are specified with the @code{pre} option. They work similar to +ffpreset files, but they only allow encoder- specific options. Therefore, an +@var{option}=@var{value} pair specifying an encoder cannot be used. + +When the @code{pre} option is specified, ffmpeg will look for files with the +suffix .avpreset in the directories @file{$AVCONV_DATADIR} (if set), and +@file{$HOME/.avconv}, and in the datadir defined at configuration time (usually +@file{PREFIX/share/ffmpeg}), in that order. + +First ffmpeg searches for a file named @var{codec_name}-@var{arg}.avpreset in +the above-mentioned directories, where @var{codec_name} is the name of the codec +to which the preset file options will be applied. For example, if you select the +video codec with @code{-vcodec libvpx} and use @code{-pre 1080p}, then it will +search for the file @file{libvpx-1080p.avpreset}. + +If no such file is found, then ffmpeg will search for a file named +@var{arg}.avpreset in the same directories. + @c man end OPTIONS @chapter Tips @@ -1285,21 +1308,6 @@ quality). @chapter Examples @c man begin EXAMPLES -@section Preset files - -A preset file contains a sequence of @var{option=value} pairs, one for -each line, specifying a sequence of options which can be specified also on -the command line. Lines starting with the hash ('#') character are ignored and -are used to provide comments. Empty lines are also ignored. Check the -@file{presets} directory in the FFmpeg source tree for examples. - -Preset files are specified with the @code{pre} option, this option takes a -preset name as input. FFmpeg searches for a file named @var{preset_name}.avpreset in -the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in -the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg}) -in that order. For example, if the argument is @code{libx264-max}, it will -search for the file @file{libx264-max.avpreset}. - @section Video and Audio grabbing If you specify the input format and device then ffmpeg can grab video ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/aiffdec: only read codec tag when there is space in header
ffmpeg | branch: master | Peter Ross | Mon Jan 5 08:44:06 2015 +1100| [f1098eb97d3c15640d3473aeba97e2be22ee0d54] | committer: Michael Niedermayer avformat/aiffdec: only read codec tag when there is space in header Signed-off-by: Peter Ross Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1098eb97d3c15640d3473aeba97e2be22ee0d54 --- libavformat/aiffdec.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 91ef2a4..8dbed32 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -116,10 +116,12 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size, size -= 18; /* get codec id for AIFF-C */ -if (version == AIFF_C_VERSION1) { +if (version == AIFF_C_VERSION1 && size >= 4) { codec->codec_tag = avio_rl32(pb); codec->codec_id = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag); size -= 4; +} else { +version = AIFF; } if (version != AIFF_C_VERSION1 || codec->codec_id == AV_CODEC_ID_PCM_S16BE) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/dvbsub: fix indent after previous commit
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 16:22:26 2015 +0100| [b0826b832465084b7aec4b1bfac6c689557343e0] | committer: Michael Niedermayer avformat/dvbsub: fix indent after previous commit Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0826b832465084b7aec4b1bfac6c689557343e0 --- libavformat/dvbsub.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/libavformat/dvbsub.c b/libavformat/dvbsub.c index fc17ccf..b8ee34f 100644 --- a/libavformat/dvbsub.c +++ b/libavformat/dvbsub.c @@ -34,28 +34,28 @@ static int dvbsub_probe(AVProbeData *p) for(i=0; ibuf_size; i++){ if (p->buf[i] == 0x0f) { -const uint8_t *ptr = p->buf + i; -uint8_t histogram[6] = {0}; -int min = 255; -for(j=0; ptr + 6 < end; j++) { -if (*ptr != 0x0f) -break; -type= ptr[1]; -page_id = AV_RB16(ptr + 2); -len = AV_RB16(ptr + 4); -if (type == 0x80) { -; -} else if (type >= 0x10 && type <= 0x14) { -histogram[type - 0x10] ++; -} else -break; -ptr += 6 + len; -} -for (k=0; k < 4; k++) { -min = FFMIN(min, histogram[k]); -} -if (min && j > max_score) -max_score = j; +const uint8_t *ptr = p->buf + i; +uint8_t histogram[6] = {0}; +int min = 255; +for(j=0; ptr + 6 < end; j++) { +if (*ptr != 0x0f) +break; +type= ptr[1]; +page_id = AV_RB16(ptr + 2); +len = AV_RB16(ptr + 4); +if (type == 0x80) { +; +} else if (type >= 0x10 && type <= 0x14) { +histogram[type - 0x10] ++; +} else +break; +ptr += 6 + len; +} +for (k=0; k < 4; k++) { +min = FFMIN(min, histogram[k]); +} +if (min && j > max_score) +max_score = j; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/dvbsub: increase probe score
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 16:28:25 2015 +0100| [d02d4d0457f9657d2b1135dc18c6ce53ca64a742] | committer: Michael Niedermayer avformat/dvbsub: increase probe score Ive not found a single false positive after some moderate testing with probetest Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d02d4d0457f9657d2b1135dc18c6ce53ca64a742 --- libavformat/dvbsub.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dvbsub.c b/libavformat/dvbsub.c index b8ee34f..57edc31 100644 --- a/libavformat/dvbsub.c +++ b/libavformat/dvbsub.c @@ -60,7 +60,7 @@ static int dvbsub_probe(AVProbeData *p) } if (max_score > 5) -return AVPROBE_SCORE_EXTENSION/2; +return AVPROBE_SCORE_EXTENSION; return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/dvbsub: check for 0xf0 earlier in probe, 30% faster
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 16:21:42 2015 +0100| [3bf2b376e64bef231c3f9e52aca60e3aded43e5d] | committer: Michael Niedermayer avformat/dvbsub: check for 0xf0 earlier in probe, 30% faster Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3bf2b376e64bef231c3f9e52aca60e3aded43e5d --- libavformat/dvbsub.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/dvbsub.c b/libavformat/dvbsub.c index 73d9c3e..fc17ccf 100644 --- a/libavformat/dvbsub.c +++ b/libavformat/dvbsub.c @@ -33,6 +33,7 @@ static int dvbsub_probe(AVProbeData *p) int max_score = 0; for(i=0; ibuf_size; i++){ +if (p->buf[i] == 0x0f) { const uint8_t *ptr = p->buf + i; uint8_t histogram[6] = {0}; int min = 255; @@ -55,6 +56,7 @@ static int dvbsub_probe(AVProbeData *p) } if (min && j > max_score) max_score = j; +} } if (max_score > 5) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86/flacdsp: remove unneeded ifdeffery
ffmpeg | branch: master | James Almer | Mon Dec 29 16:44:03 2014 -0300| [08810a8895174231b8cf6eb58c6c2aec4c6db778] | committer: James Almer x86/flacdsp: remove unneeded ifdeffery x86inc can translate r*m into a register or stack on its own Reviewed-by: Michael Niedermayer Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08810a8895174231b8cf6eb58c6c2aec4c6db778 --- libavcodec/x86/flacdsp.asm | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/libavcodec/x86/flacdsp.asm b/libavcodec/x86/flacdsp.asm index 43a2f01..901c440 100644 --- a/libavcodec/x86/flacdsp.asm +++ b/libavcodec/x86/flacdsp.asm @@ -80,14 +80,10 @@ LPC_32 sse4 ;-- %macro FLAC_DECORRELATE_16 3-4 cglobal flac_decorrelate_%1_16, 2, 4, 4, out, in0, in1, len -%if ARCH_X86_32 || WIN64 -movd m3, r4m %if ARCH_X86_32 mov lend, lenm %endif -%else ; UNIX64 -movd m3, r4d -%endif +movd m3, r4m shl lend, 2 mov in1q, [in0q + gprsize] mov in0q, [in0q] @@ -129,14 +125,10 @@ FLAC_DECORRELATE_16 ms, 2, 0, add ;-- %macro FLAC_DECORRELATE_32 5 cglobal flac_decorrelate_%1_32, 2, 4, 4, out, in0, in1, len -%if ARCH_X86_32 || WIN64 -movd m3, r4m %if ARCH_X86_32 mov lend, lenm %endif -%else ; UNIX64 -movd m3, r4d -%endif +movd m3, r4m mov in1q, [in0q + gprsize] mov in0q, [in0q] mov outq, [outq] @@ -183,18 +175,14 @@ FLAC_DECORRELATE_32 ms, 2, 0, 1, add %define REPCOUNT %2/(32/%1) ; 16bits = channels / 2; 32bits = channels cglobal flac_decorrelate_indep%2_%1, 2, %2+2, %3+1, out, in0, in1, len, in2, in3, in4, in5, in6, in7 %if ARCH_X86_32 -movd m%3, r4m %if %2 == 6 DEFINE_ARGS out, in0, in1, in2, in3, in4, in5 %define lend dword r3m %else mov lend, lenm %endif -%elif WIN64 -movd m%3, r4m -%else ; UNIX64 -movd m%3, r4d %endif +movd m%3, r4m %assign %%i 1 %rep %2-1 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/id3v1: strip trailing whitespace
ffmpeg | branch: master | wm4 | Mon Jan 5 18:56:19 2015 +0100| [bd7801040786788433bcb80b713aeb30e0de1ce0] | committer: Michael Niedermayer avformat/id3v1: strip trailing whitespace ID3v1 fields have a fixed size, and they are padded either with zeros, or with spaces. Handle the latter case, instead of putting strings with trailing spaces into the AVDictionary. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd7801040786788433bcb80b713aeb30e0de1ce0 --- libavformat/id3v1.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c index 0617a9c..218ed73 100644 --- a/libavformat/id3v1.c +++ b/libavformat/id3v1.c @@ -179,7 +179,7 @@ static void get_string(AVFormatContext *s, const char *key, const uint8_t *buf, int buf_size) { int i, c; -char *q, str[512]; +char *q, str[512], *first_free_space = NULL; q = str; for(i = 0; i < buf_size; i++) { @@ -188,10 +188,19 @@ static void get_string(AVFormatContext *s, const char *key, break; if ((q - str) >= sizeof(str) - 1) break; +if (c == ' ') { +if (!first_free_space) +first_free_space = q; +} else { +first_free_space = NULL; +} *q++ = c; } *q = '\0'; +if (first_free_space) +*first_free_space = '\0'; + if (*str) av_dict_set(&s->metadata, key, str, 0); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_yadif: detect telecine content
ffmpeg | branch: master | Michael Niedermayer | Mon Jan 5 23:55:59 2015 +0100| [42411a85b78c73897fedf321697fedd61f9c41a6] | committer: Michael Niedermayer avfilter/vf_yadif: detect telecine content Fixes: yadif with interlaced_flag_switch.mpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42411a85b78c73897fedf321697fedd61f9c41a6 --- libavfilter/vf_yadif.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 8b951a4..ea72e62 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -345,7 +345,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) if (!yadif->prev) return 0; -if ((yadif->deint && !yadif->cur->interlaced_frame) || ctx->is_disabled) { +if ((yadif->deint && !yadif->cur->interlaced_frame) || +ctx->is_disabled || +(yadif->deint && !yadif->prev->interlaced_frame && yadif->prev->repeat_pict) || +(yadif->deint && !yadif->next->interlaced_frame && yadif->next->repeat_pict) +) { yadif->out = av_frame_clone(yadif->cur); if (!yadif->out) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_idet: Add analyze_interlaced_flag mode
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 1 02:35:39 2015 +0100| [a79ac73b631a2d8347f45fbdcb666f37e40ab9fe] | committer: Michael Niedermayer avfilter/vf_idet: Add analyze_interlaced_flag mode This should allow us to insert idet before scale and let scale have interl=-1 as default in that case Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a79ac73b631a2d8347f45fbdcb666f37e40ab9fe --- doc/filters.texi |7 +++ libavfilter/vf_idet.c | 41 +++-- libavfilter/vf_idet.h |4 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 1e2567e..f14f6a9 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -5760,6 +5760,13 @@ Number of frames after which a given frame's contribution to the statistics is halved (i.e., it contributes only 0.5 to it's classification). The default of 0 means that all frames seen are given full weight of 1.0 forever. +@item analyze_interlaced_flag +When this is not 0 then idet will use the specified number of frames to determine +if the interlaced flag is accurate, it will not count undetermined frames. +If the flag is found to be accurate it will be used without any further +computations, if it is found to be inaccuarte it will be cleared without any +further computations. This allows inserting the idet filter as a low computational +method to clean up the interlaced flag @end table @section il diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index 56e6e76..4532e48 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -34,6 +34,7 @@ static const AVOption idet_options[] = { { "prog_thres", "set progressive threshold", OFFSET(progressive_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 1.5}, -1, FLT_MAX, FLAGS }, { "rep_thres", "set repeat threshold", OFFSET(repeat_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 3.0}, -1, FLT_MAX, FLAGS }, { "half_life", "half life of cumulative statistics", OFFSET(half_life), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, -1, INT_MAX, FLAGS }, +{ "analyze_interlaced_flag", "set number of frames to use to determine if the interlace flag is accurate", OFFSET(analyze_interlaced_flag), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, FLAGS }, { NULL } }; @@ -235,6 +236,19 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) AVFilterContext *ctx = link->dst; IDETContext *idet = ctx->priv; +// initial frame(s) and not interlaced, just pass through for +// the analyze_interlaced_flag mode +if (idet->analyze_interlaced_flag && +!picref->interlaced_frame && +!idet->next) { +return ff_filter_frame(ctx->outputs[0], picref); +} +if (idet->analyze_interlaced_flag_done) { +if (picref->interlaced_frame && idet->interlaced_flag_accuracy < 0) +picref->interlaced_frame = 0; +return ff_filter_frame(ctx->outputs[0], picref); +} + if (idet->prev) av_frame_free(&idet->prev); idet->prev = idet->cur; @@ -256,7 +270,30 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) ff_idet_init_x86(idet, 1); } -filter(ctx); +if (idet->analyze_interlaced_flag) { +if (idet->cur->interlaced_frame) { +idet->cur->interlaced_frame = 0; +filter(ctx); +if (idet->last_type == PROGRESSIVE) { +idet->interlaced_flag_accuracy --; +idet->analyze_interlaced_flag --; +} else if (idet->last_type != UNDETERMINED) { +idet->interlaced_flag_accuracy ++; +idet->analyze_interlaced_flag --; +} +if (idet->analyze_interlaced_flag == 1) { +ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur)); + +if (idet->next->interlaced_frame && idet->interlaced_flag_accuracy < 0) +idet->next->interlaced_frame = 0; +idet->analyze_interlaced_flag_done = 1; +av_log(ctx, AV_LOG_INFO, "Final flag accuracy %d\n", idet->interlaced_flag_accuracy); +return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->next)); +} +} +} else { +filter(ctx); +} return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur)); } @@ -274,7 +311,7 @@ static int request_frame(AVFilterLink *link) ret = ff_request_frame(link->src->inputs[0]); -if (ret == AVERROR_EOF && idet->cur) { +if (ret == AVERROR_EOF && idet->cur && !idet->analyze_interlaced_flag_done) { AVFrame *next = av_frame_clone(idet->next); if (!next) diff --git a/libavfilter/vf_idet.h b/libavfilter/vf_idet.h index af759b4..47e3d9c 100644 --- a/libavfilter/vf_idet.h +++ b/libavfilter/vf_idet.h @@ -63,6 +63,10 @@ typedef struct { AVFrame *prev; ff_idet_filter_
[FFmpeg-cvslog] mov: Fix overflow and error handling in read_tfra().
ffmpeg | branch: master | Dale Curtis | Tue Jan 6 04:00:43 2015 +0100| [db42d93a61be26873be6115c57f5921b4dfdec14] | committer: Michael Niedermayer mov: Fix overflow and error handling in read_tfra(). Under abnormal conditions the item_count may exceed the max allocation size on 32-bit systems, this causes the allocated size to overflow and become too small for the given count. Additionally, if av_reallocp() fails its allocation, the fragment_index_count is not correctly decremented. Ensuring further havoc may be wrought, the error code for read_tfra() is not checked upon return. Found-by: Paul Mehta positive return code and use of _array functions by commiter Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db42d93a61be26873be6115c57f5921b4dfdec14 --- libavformat/mov.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index f2d4fa0..ba79378 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3823,35 +3823,39 @@ static void export_orphan_timecode(AVFormatContext *s) static int read_tfra(MOVContext *mov, AVIOContext *f) { MOVFragmentIndex* index = NULL; -int version, fieldlength, i, j, err; +int version, fieldlength, i, j; int64_t pos = avio_tell(f); uint32_t size = avio_rb32(f); +void *tmp; + if (avio_rb32(f) != MKBETAG('t', 'f', 'r', 'a')) { -return -1; +return 1; } av_log(mov->fc, AV_LOG_VERBOSE, "found tfra\n"); index = av_mallocz(sizeof(MOVFragmentIndex)); if (!index) { return AVERROR(ENOMEM); } -mov->fragment_index_count++; -if ((err = av_reallocp(&mov->fragment_index_data, - mov->fragment_index_count * - sizeof(MOVFragmentIndex*))) < 0) { + +tmp = av_realloc_array(mov->fragment_index_data, + mov->fragment_index_count + 1, + sizeof(MOVFragmentIndex*)); +if (!tmp) { av_freep(&index); -return err; +return AVERROR(ENOMEM); } -mov->fragment_index_data[mov->fragment_index_count - 1] = -index; +mov->fragment_index_data = tmp; +mov->fragment_index_data[mov->fragment_index_count++] = index; version = avio_r8(f); avio_rb24(f); index->track_id = avio_rb32(f); fieldlength = avio_rb32(f); index->item_count = avio_rb32(f); -index->items = av_mallocz( -index->item_count * sizeof(MOVFragmentIndexItem)); +index->items = av_mallocz_array( +index->item_count, sizeof(MOVFragmentIndexItem)); if (!index->items) { +index->item_count = 0; return AVERROR(ENOMEM); } for (i = 0; i < index->item_count; i++) { @@ -3905,11 +3909,13 @@ static int mov_read_mfra(MOVContext *c, AVIOContext *f) av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n"); goto fail; } -ret = 0; av_log(c->fc, AV_LOG_VERBOSE, "stream has mfra\n"); -while (!read_tfra(c, f)) { -/* Empty */ -} +do { +ret = read_tfra(c, f); +if (ret < 0) +goto fail; +} while (!ret); +ret = 0; fail: seek_ret = avio_seek(f, original_pos, SEEK_SET); if (seek_ret < 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mov: fix integer overflow in mov_read_udta_string()
ffmpeg | branch: master | Michael Niedermayer | Tue Jan 6 04:29:10 2015 +0100| [3859868c75313e318ebc5d0d33baada62d45dd75] | committer: Michael Niedermayer avformat/mov: fix integer overflow in mov_read_udta_string() Found-by: Paul Mehta Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3859868c75313e318ebc5d0d33baada62d45dd75 --- libavformat/mov.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index ba79378..f2a66b8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -375,7 +375,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (!key) return 0; -if (atom.size < 0) +if (atom.size < 0 || str_size >= INT_MAX/2) return AVERROR_INVALIDDATA; // worst-case requirement for output string in case of utf8 coded input ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mov: Fix negative size calculation in mov_read_default().
ffmpeg | branch: master | Dale Curtis | Mon Jan 5 16:34:17 2015 -0800| [3ebd76a9c57558e284e94da367dd23b435e6a6d0] | committer: Michael Niedermayer mov: Fix negative size calculation in mov_read_default(). The previous code assumed if an atom was marked with a 64-bit size extension, it actually had that data available. The new code verfies there's enough data in the atom for this to be done. Failure to verify causes total_size > atom.size which will result in negative size calculations later on. Found-by: Paul Mehta Signed-off-by: Dale Curtis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ebd76a9c57558e284e94da367dd23b435e6a6d0 --- libavformat/mov.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index f2a66b8..a157d60 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3471,7 +3471,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) } } total_size += 8; -if (a.size == 1) { /* 64 bit extended size */ +if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */ a.size = avio_rb64(pb) - 8; total_size += 8; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog