[FFmpeg-devel] [PATCH 2/2] avformat: unref packet after storing it in internal packet queue

2015-11-01 Thread Hendrik Leppkes
Fixes a memory leak when using genpts --- libavformat/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 3f82659..5c4d452 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1559,6 +1559,7 @@ int av_read_frame(AVFormatContext *s,

[FFmpeg-devel] [PATCH 1/2] avformat: always unref the packet after parsing

2015-11-01 Thread Hendrik Leppkes
This fixes a memory leak when side-data is present. --- libavformat/utils.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 7e4f54f..3f82659 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1285,12 +1285,11

Re: [FFmpeg-devel] [PATCH 1/2] avformat: always unref the packet after parsing

2015-11-01 Thread wm4
On Sun, 1 Nov 2015 13:03:50 +0100 Hendrik Leppkes wrote: > On Sun, Nov 1, 2015 at 12:57 PM, wm4 wrote: > > On Sun, 1 Nov 2015 11:21:26 +0100 > > Hendrik Leppkes wrote: > > > >> This fixes a memory leak when side-data is

Re: [FFmpeg-devel] [PATCH 1/2] avformat: always unref the packet after parsing

2015-11-01 Thread wm4
On Sun, 1 Nov 2015 11:21:26 +0100 Hendrik Leppkes wrote: > This fixes a memory leak when side-data is present. > --- > libavformat/utils.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/libavformat/utils.c b/libavformat/utils.c > index

Re: [FFmpeg-devel] [PATCH 1/2] avformat: always unref the packet after parsing

2015-11-01 Thread Hendrik Leppkes
On Sun, Nov 1, 2015 at 12:57 PM, wm4 wrote: > On Sun, 1 Nov 2015 11:21:26 +0100 > Hendrik Leppkes wrote: > >> This fixes a memory leak when side-data is present. >> --- >> libavformat/utils.c | 9 - >> 1 file changed, 4 insertions(+), 5

[FFmpeg-devel] [PATCH 2/2] Add pixblockdsp checkasm tests

2015-11-01 Thread Timothy Gu
--- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c| 3 ++ tests/checkasm/checkasm.h| 1 + tests/checkasm/pixblockdsp.c | 107 +++ 4 files changed, 112 insertions(+) create mode 100644 tests/checkasm/pixblockdsp.c diff --git

[FFmpeg-devel] [PATCH 1/2] pixblockdsp: x86: Condense diff_pixels_* to a shared macro

2015-11-01 Thread Timothy Gu
--- libavcodec/x86/pixblockdsp.asm | 66 -- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/libavcodec/x86/pixblockdsp.asm b/libavcodec/x86/pixblockdsp.asm index 7c5377b..a7d9816 100644 --- a/libavcodec/x86/pixblockdsp.asm +++

[FFmpeg-devel] [PATCH 3/3] doc/filters: move scattered remark on av_strtod to a common location

2015-11-01 Thread Ganesh Ajjanagadde
All filters now use av_strtod for accepting floating point parameters. There was an isolated remark on this, but the point applies generally now. This moves the comment and suitably elaborates on it for additional clarity. A link to the code for av_strtod is also provided for the user's benefit.

[FFmpeg-devel] [PATCH 2/3] avfilter/vf_frei0r: use av_strtod instead of strtod for added flexibility

2015-11-01 Thread Ganesh Ajjanagadde
This converts the usage of strtod to av_strtod in order to be more free in accepting double parameters. Signed-off-by: Ganesh Ajjanagadde --- libavfilter/vf_frei0r.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_frei0r.c

[FFmpeg-devel] [PATCH 1/2] avutil/common: add FFDIFFSIGN macro

2015-11-01 Thread Ganesh Ajjanagadde
This is of use for defining comparator callbacks. Common approaches like return x-y are not safe due to the risks of overflow. Furthermore, the (x > y) - (x < y) trick is optimized to branchless code. This also documents this macro accordingly. Signed-off-by: Ganesh Ajjanagadde

[FFmpeg-devel] [PATCH 2/2] ffserver: Clear avio context after closing it

2015-11-01 Thread Michael Niedermayer
From: Michael Niedermayer Fixes: ==13287== Invalid read of size 4 ==13287==at 0x45161A: flush_buffer (aviobuf.c:143) ==13287==by 0x451971: avio_flush (aviobuf.c:200) ==13287==by 0x512CCF: av_write_trailer (mux.c:1016) ==13287==by 0x41A5E0: close_connection

[FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
Floating point to integer conversion is well defined when the float lies within the representation bounds of the integer after discarding the fractional part. However, in other cases, unfortunately the standard leaves it undefined. In particular, assuming that it saturates in a sane way is a

[FFmpeg-devel] [PATCH] boxblur: Templatize blur{8,16}

2015-11-01 Thread Timothy Gu
--- libavfilter/vf_boxblur.c | 110 +++ 1 file changed, 44 insertions(+), 66 deletions(-) diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index ef01cf9..6934076 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@

[FFmpeg-devel] [PATCH] avformat/ipmovie: put video decoding_map_size into packet and use it in decoder

2015-11-01 Thread Paul B Mahol
The size of decoding map can differ from one calculated internally, producing artifacts while decoding video. Signed-off-by: Paul B Mahol --- libavcodec/interplayvideo.c | 14 +- libavformat/ipmovie.c | 7 --- 2 files changed, 13 insertions(+), 8

[FFmpeg-devel] [PATCH 0/2] add FFDIFFSIGN for comparators

2015-11-01 Thread Ganesh Ajjanagadde
This patch series draws upon remarks of Mark and Ronald regarding the lack of safety of the common idiom return a - b for qsort comparators. I made an observation that the interesting (x > y) - (x < y) idiom works well: it not only avoids branches commonly not optimized by compilers when the

Re: [FFmpeg-devel] [PATCH 3/4] avutil/eval: check av_expr_parse_and_eval error code in the test build

2015-11-01 Thread Michael Niedermayer
On Sat, Oct 31, 2015 at 10:47:56AM -0400, Ganesh Ajjanagadde wrote: > This returns the error code from main in the test, in this case ENOMEM. > This should not matter, and will ensure that no warnings are triggered > when av_warn_unused_result is added to avutil/eval.h. > > Signed-off-by: Ganesh

Re: [FFmpeg-devel] [PATCH 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Michael Niedermayer
On Sat, Oct 31, 2015 at 10:47:54AM -0400, Ganesh Ajjanagadde wrote: > This function can return ENOMEM that needs to be propagated. > > Signed-off-by: Ganesh Ajjanagadde > --- > libavfilter/vf_pad.c| 10 ++ > libavfilter/vf_rotate.c | 3 +-- >

[FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Ganesh Ajjanagadde
FFDIFFSIGN was created explicitly for this purpose, since the common return a - b idiom is unsafe regarding overflow on signed integers. It optimizes to branchless code on common compilers. FFDIFFSIGN also has the subjective benefit of being easier to read due to lack of ternary operators.

[FFmpeg-devel] [PATCH] hlsenc: Only write PAT/PMT once per segment

2015-11-01 Thread Derek Buitenhuis
This saves a lot of muxing overhead, especially on lower bitrate segments. Signed-off-by: Derek Buitenhuis --- libavformat/hlsenc.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index

[FFmpeg-devel] [PATCH 1/2] avutil/common: add av_clipd64

2015-11-01 Thread Ganesh Ajjanagadde
The rationale for this function is reflected in the documentation for it, and is copied here: Clip a double value into the long long amin-amax range. This function is needed because conversion of floating point to integers when it does not fit in the integer's representation does not necessarily

[FFmpeg-devel] [PATCH 2/2] ffserver_config: replace strtod by av_strtod and correct undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
This uses av_strtod for added flexibility, and av_clipd64 for ensuring that no undefined behavior gets invoked. Signed-off-by: Ganesh Ajjanagadde --- ffserver_config.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git

Re: [FFmpeg-devel] [PATCH] avformat/ipmovie: put video decoding_map_size into packet and use it in decoder

2015-11-01 Thread wm4
On Sun, 1 Nov 2015 17:07:07 +0100 Paul B Mahol wrote: > The size of decoding map can differ from one calculated > internally, producing artifacts while decoding video. > > Signed-off-by: Paul B Mahol > --- > libavcodec/interplayvideo.c | 14 +-

[FFmpeg-devel] [PATCH 1/3] avutil/eval: minor typo

2015-11-01 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde --- libavutil/eval.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/eval.h b/libavutil/eval.h index 6159b0f..dacd22b 100644 --- a/libavutil/eval.h +++ b/libavutil/eval.h @@ -102,7 +102,7 @@ void

[FFmpeg-devel] [PATCH 1/2] ffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxer

2015-11-01 Thread Michael Niedermayer
From: Michael Niedermayer Signed-off-by: Michael Niedermayer --- ffserver.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ffserver.c b/ffserver.c index 526cbfc..8ddc210 100644 --- a/ffserver.c +++ b/ffserver.c @@

Re: [FFmpeg-devel] [PATCH] boxblur: Templatize blur{8,16}

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 1:40 PM, Timothy Gu wrote: > --- > libavfilter/vf_boxblur.c | 110 > +++ > 1 file changed, 44 insertions(+), 66 deletions(-) > > diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c > index

[FFmpeg-devel] [PATCH 2/2] mpegtsenc: Implement writing of Opus trim_start/trim_end control values

2015-11-01 Thread Sebastian Dröge
From: Sebastian Dröge Signed-off-by: Sebastian Dröge --- libavformat/mpegtsenc.c | 47 --- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/libavformat/mpegtsenc.c

[FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
This function can return ENOMEM that needs to be propagated. Signed-off-by: Ganesh Ajjanagadde --- libavfilter/vf_pad.c| 12 +++- libavfilter/vf_rotate.c | 5 +++-- libavfilter/vf_scale.c | 5 +++-- libavfilter/vf_zscale.c | 5 +++-- 4 files changed, 16

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 3:45 PM, Nicolas George wrote: > Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : >> This function can return ENOMEM that needs to be propagated. >> >> Signed-off-by: Ganesh Ajjanagadde >> --- >> libavfilter/vf_pad.c

Re: [FFmpeg-devel] [PATCH 1/2] mpegtsenc: Add support for muxing Opus in MPEG-TS

2015-11-01 Thread Sebastian Dröge
On So, 2015-11-01 at 22:20 +0200, Sebastian Dröge wrote: > +data = av_malloc(pkt->size + 2 + pkt->size / 255 + 1); > [...] > +n = pkt->size; > +i = 2; > +do { > +data[i] = FFMIN(n, 255); > +n -= 255; > +

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ronald S. Bultje
Hi, On Sun, Nov 1, 2015 at 6:15 PM, Ganesh Ajjanagadde wrote: > On Sun, Nov 1, 2015 at 6:12 PM, Ronald S. Bultje > wrote: > > Hi, > > > > On Sun, Nov 1, 2015 at 1:03 PM, Ganesh Ajjanagadde < > gajjanaga...@gmail.com> > > wrote: > >> > >> Floating

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 7:15 PM, Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 06:51:19PM -0500, Ganesh Ajjanagadde wrote: >> On Sun, Nov 1, 2015 at 6:25 PM, Nicolas George wrote: >> > Le primidi 11 brumaire, an CCXXIV, Ronald S. Bultje a écrit : >>

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 7:59 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Nov 1, 2015 at 7:21 PM, Ganesh Ajjanagadde wrote: > >> On Sun, Nov 1, 2015 at 7:15 PM, Michael Niedermayer >> wrote: >> > On Sun, Nov 01, 2015 at 06:51:19PM

Re: [FFmpeg-devel] [PATCH] avutil/opencl_internal: add av_warn_unused_result

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 8:23 PM, highgod0401 wrote: > > From: Ganesh Ajjanagadde > Date: 2015-10-29 10:53 > To: FFmpeg development discussions and patches > CC: Ganesh Ajjanagadde > Subject: Re: [FFmpeg-devel] [PATCH] avutil/opencl_internal: add > av_warn_unused_result > On

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 07:59:08PM -0500, Ronald S. Bultje wrote: > Hi, > > On Sun, Nov 1, 2015 at 7:21 PM, Ganesh Ajjanagadde wrote: > > > On Sun, Nov 1, 2015 at 7:15 PM, Michael Niedermayer > > wrote: > > > On Sun, Nov 01, 2015 at 06:51:19PM -0500,

Re: [FFmpeg-devel] [PATCH] avutil/opencl_internal: add av_warn_unused_result

2015-11-01 Thread highgod0401
From: Ganesh Ajjanagadde Date: 2015-10-29 10:53 To: FFmpeg development discussions and patches CC: Ganesh Ajjanagadde Subject: Re: [FFmpeg-devel] [PATCH] avutil/opencl_internal: add av_warn_unused_result On Thu, Oct 15, 2015 at 6:24 PM, Ganesh Ajjanagadde wrote: >

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ronald S. Bultje
Hi, On Sun, Nov 1, 2015 at 7:21 PM, Ganesh Ajjanagadde wrote: > On Sun, Nov 1, 2015 at 7:15 PM, Michael Niedermayer > wrote: > > On Sun, Nov 01, 2015 at 06:51:19PM -0500, Ganesh Ajjanagadde wrote: > >> On Sun, Nov 1, 2015 at 6:25 PM, Nicolas George

Re: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_frei0r: use av_strtod instead of strtod for added flexibility

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 11:57:54AM -0500, Ganesh Ajjanagadde wrote: > This converts the usage of strtod to av_strtod in order to be more free > in accepting double parameters. "more free" is a bit unclear and confusing the change itself should be ok thanks [...] -- Michael GnuPG

Re: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_frei0r: use av_strtod instead of strtod for added flexibility

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 8:23 PM, Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 11:57:54AM -0500, Ganesh Ajjanagadde wrote: >> This converts the usage of strtod to av_strtod in order to be more free >> in accepting double parameters. > > "more free" is a bit unclear

[FFmpeg-devel] [PATCH] ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

2015-11-01 Thread Rodger Combs
Also rearranged the relevant check to reduce code duplication --- ffmpeg.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index dbb2520..526f094 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1760,7 +1760,6 @@ static void

Re: [FFmpeg-devel] [PATCH] boxblur: Templatize blur{8,16}

2015-11-01 Thread Timothy Gu
On Sun, Nov 1, 2015 at 4:45 PM Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 10:40:03AM -0800, Timothy Gu wrote: > > --- > > libavfilter/vf_boxblur.c | 110 > +++ > > 1 file changed, 44 insertions(+), 66 deletions(-) > >

Re: [FFmpeg-devel] [PATCH] boxblur: Templatize blur{8,16}

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 10:40:03AM -0800, Timothy Gu wrote: > --- > libavfilter/vf_boxblur.c | 110 > +++ > 1 file changed, 44 insertions(+), 66 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Re: [FFmpeg-devel] [PATCH] boxblur: Templatize blur{8,16}

2015-11-01 Thread Timothy Gu
On Sun, Nov 1, 2015 at 11:10 AM Ganesh Ajjanagadde wrote: > Have not tested, but just a general comment. Personally, I follow the > twice repition is ok, thrice means it is good to factor out. I would > have been happier if the diff-stat was better than 44+/66- in terms of >

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 5:46 PM, Nicolas George wrote: > Le primidi 11 brumaire, an CCXXIV, Michael Niedermayer a écrit : >> less fragile could be ret < 0 && ret != the error code generated by NaN >> i dont know what to do about the clutter or if this approuch makes >> sense or if

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:20 PM, Nicolas George wrote: > Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : >> Can't users give arbitrarily long arithmetic expressions? > > They can, and the current code deals gracefully with them. ok, all patches except 2/4 (which

Re: [FFmpeg-devel] [PATCH 2/4] avfilter/vf_rotate: correct log message

2015-11-01 Thread Michael Niedermayer
On Sat, Oct 31, 2015 at 10:47:55AM -0400, Ganesh Ajjanagadde wrote: > There seems to be some typos in the log messages that are fixed by this. probably ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:25 PM, Nicolas George wrote: > Le primidi 11 brumaire, an CCXXIV, Ronald S. Bultje a écrit : >> So, is this a bug in llrint, or is this a failure to use llrint, or is this >> different from llrint? It sounds to me that llrint should be used, not our >>

Re: [FFmpeg-devel] [PATCH] hlsenc: Only write PAT/PMT once per segment

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 05:34:38PM +, Derek Buitenhuis wrote: > This saves a lot of muxing overhead, especially on lower bitrate > segments. > > Signed-off-by: Derek Buitenhuis > --- > libavformat/hlsenc.c | 10 +- > 1 file changed, 9 insertions(+), 1

[FFmpeg-devel] [PATCH 0/3] transition strtod to av_strtod

2015-11-01 Thread Ganesh Ajjanagadde
Patch 1/3 was just a minor typo I noticed while working on av_strtod. Patch 2/3 offers improved flexibility in setting parameters, and it may be noted that with this, all of libavfilter uses av_strtod as opposed to strtod. Patch 3/3 accordingly documents it. Since all of libavfilter now uses

Re: [FFmpeg-devel] [PATCH 3/4] avutil/eval: check av_expr_parse_and_eval error code in the test build

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 12:52 PM, Michael Niedermayer wrote: > On Sat, Oct 31, 2015 at 10:47:56AM -0400, Ganesh Ajjanagadde wrote: >> This returns the error code from main in the test, in this case ENOMEM. >> This should not matter, and will ensure that no warnings are

[FFmpeg-devel] [PATCHv2 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Ganesh Ajjanagadde
FFDIFFSIGN was created explicitly for this purpose, since the common return a - b idiom is unsafe regarding overflow on signed integers. It optimizes to branchless code on common compilers. FFDIFFSIGN also has the subjective benefit of being easier to read due to lack of ternary operators.

Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:26 PM, Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 12:19:48PM -0500, Ganesh Ajjanagadde wrote: >> FFDIFFSIGN was created explicitly for this purpose, since the common >> return a - b idiom is unsafe regarding overflow on signed integers.

[FFmpeg-devel] [PATCHv2 3/4] avutil/eval: check av_expr_parse_and_eval error code in the test build

2015-11-01 Thread Ganesh Ajjanagadde
This returns the error code from main in the test in the case of ENOMEM. This should not matter, and will ensure that no warnings are triggered when av_warn_unused_result is added to avutil/eval.h. Tested with FATE. Signed-off-by: Ganesh Ajjanagadde --- libavutil/eval.c

[FFmpeg-devel] [PATCHv2 1/2] mpegtsenc: Add support for muxing Opus in MPEG-TS

2015-11-01 Thread Sebastian Dröge
From: Sebastian Dröge Signed-off-by: Sebastian Dröge --- libavformat/mpegtsenc.c | 180 +++- 1 file changed, 179 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegtsenc.c

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 04:16:18PM -0500, Ganesh Ajjanagadde wrote: > On Sun, Nov 1, 2015 at 3:45 PM, Nicolas George wrote: > > Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : > >> This function can return ENOMEM that needs to be propagated. > >> > >>

Re: [FFmpeg-devel] [PATCH 1/2] avutil/common: add FFDIFFSIGN macro

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 12:19:47PM -0500, Ganesh Ajjanagadde wrote: > This is of use for defining comparator callbacks. Common approaches like > return x-y are not safe due to the risks of overflow. > Furthermore, the (x > y) - (x < y) trick is optimized to branchless > code. > This also documents

Re: [FFmpeg-devel] [PATCH 1/2] avutil/common: add av_clipd64

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:09 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Nov 1, 2015 at 1:03 PM, Ganesh Ajjanagadde > wrote: >> >> The rationale for this function is reflected in the documentation for >> it, and is copied here: >> >> Clip a double

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:12 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Nov 1, 2015 at 1:03 PM, Ganesh Ajjanagadde > wrote: >> >> Floating point to integer conversion is well defined when the float lies >> within >> the representation bounds of the

[FFmpeg-devel] [PATCH 4/4] lavfi/select: add support for concatdec_select option

2015-11-01 Thread Marton Balint
This option can be used to select useful frames from an ffconcat file which is using inpoints and outpoints but where the source files are not intra frame only. Signed-off-by: Marton Balint --- doc/filters.texi | 16 libavfilter/f_select.c | 20

[FFmpeg-devel] [PATCH 3/4] concatdec: add option for adding segment start time and duration metadata

2015-11-01 Thread Marton Balint
Signed-off-by: Marton Balint --- doc/demuxers.texi | 8 libavformat/concatdec.c | 12 2 files changed, 20 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 34bfc9b..41d3722 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Nicolas George
Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : > Can't users give arbitrarily long arithmetic expressions? They can, and the current code deals gracefully with them. Regards, -- Nicolas George signature.asc Description: Digital signature

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:18 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Nov 1, 2015 at 6:15 PM, Ganesh Ajjanagadde > wrote: >> >> On Sun, Nov 1, 2015 at 6:12 PM, Ronald S. Bultje >> wrote: >> > Hi, >> > >> > On Sun, Nov 1, 2015

[FFmpeg-devel] [PATCH 0/2] mpegtsenc: Add support for muxing Opus into MPEG-TS

2015-11-01 Thread Sebastian Dröge
Hi everybody, the following patches are adding support for muxing Opus into MPEG-TS. ffmpeg could already demux such files since a while, but I guess it would also be nice to be able to create them. Please review carefully, thanks! Sebastian ___

Re: [FFmpeg-devel] [PATCH 1/3] avutil/eval: minor typo

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 11:57:53AM -0500, Ganesh Ajjanagadde wrote: > Signed-off-by: Ganesh Ajjanagadde > --- > libavutil/eval.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavutil/eval.h b/libavutil/eval.h > index 6159b0f..dacd22b 100644 >

[FFmpeg-devel] [PATCH 1/4] fate: add concat demuxer tests

2015-11-01 Thread Marton Balint
Signed-off-by: Marton Balint --- tests/Makefile |1 + tests/extended.ffconcat| 114 + tests/fate-run.sh | 20 + tests/fate/concatdec.mak | 21 +

[FFmpeg-devel] [PATCH 2/4] concatdec: factorize duration calculating code to get_duration function

2015-11-01 Thread Marton Balint
Signed-off-by: Marton Balint --- libavformat/concatdec.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 0180a7e..15094bf 100644 --- a/libavformat/concatdec.c +++

Re: [FFmpeg-devel] [PATCH 3/5] concatdec: move duration calculating code to open_file

2015-11-01 Thread Marton Balint
On Mon, 2 Nov 2015, Nicolas George wrote: Le primidi 11 brumaire, an CCXXIV, Marton Balint a écrit : Because I add it to the metadata store here in the next patch, which metadata will be set for every file packet, so calculating it at the end of file is not an option. I see. But do you

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Nicolas George
Le primidi 11 brumaire, an CCXXIV, Ronald S. Bultje a écrit : > So, is this a bug in llrint, or is this a failure to use llrint, or is this > different from llrint? It sounds to me that llrint should be used, not our > own alternative. Is there a sized version of the function? int64rint?

Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 12:19:48PM -0500, Ganesh Ajjanagadde wrote: > FFDIFFSIGN was created explicitly for this purpose, since the common > return a - b idiom is unsafe regarding overflow on signed integers. It > optimizes to branchless code on common compilers. > > FFDIFFSIGN also has the

Re: [FFmpeg-devel] [PATCH 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 2:14 PM, Michael Niedermayer wrote: > On Sat, Oct 31, 2015 at 10:47:54AM -0400, Ganesh Ajjanagadde wrote: >> This function can return ENOMEM that needs to be propagated. >> >> Signed-off-by: Ganesh Ajjanagadde >> --- >>

[FFmpeg-devel] [PATCH 1/2] mpegtsenc: Add support for muxing Opus in MPEG-TS

2015-11-01 Thread Sebastian Dröge
From: Sebastian Dröge Signed-off-by: Sebastian Dröge --- libavformat/mpegtsenc.c | 180 +++- 1 file changed, 179 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegtsenc.c

Re: [FFmpeg-devel] [PATCH 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 2:14 PM, Michael Niedermayer wrote: > On Sat, Oct 31, 2015 at 10:47:54AM -0400, Ganesh Ajjanagadde wrote: >> This function can return ENOMEM that needs to be propagated. >> >> Signed-off-by: Ganesh Ajjanagadde >> --- >>

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Nicolas George
Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : > This function can return ENOMEM that needs to be propagated. > > Signed-off-by: Ganesh Ajjanagadde > --- > libavfilter/vf_pad.c| 12 +++- > libavfilter/vf_rotate.c | 5 +++-- >

[FFmpeg-devel] [PATCHv2 2/2] mpegtsenc: Implement writing of Opus trim_start/trim_end control values

2015-11-01 Thread Sebastian Dröge
From: Sebastian Dröge Signed-off-by: Sebastian Dröge --- libavformat/mpegtsenc.c | 47 --- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/libavformat/mpegtsenc.c

Re: [FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval

2015-11-01 Thread Nicolas George
Le primidi 11 brumaire, an CCXXIV, Michael Niedermayer a écrit : > less fragile could be ret < 0 && ret != the error code generated by NaN > i dont know what to do about the clutter or if this approuch makes > sense or if just droping the return warning for av_expr_parse_and_eval > would be better

Re: [FFmpeg-devel] [PATCH 3/5] concatdec: move duration calculating code to open_file

2015-11-01 Thread Marton Balint
On Fri, 30 Oct 2015, Nicolas George wrote: Le quartidi 4 brumaire, an CCXXIV, Marton Balint a écrit : Hmm. I need this computed here for the next patch. Maybe we could calcualate the duration here and then update it in open_next_file as well? That is probably possible somehow but a bit

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Ronald S. Bultje
Hi, On Sun, Nov 1, 2015 at 1:03 PM, Ganesh Ajjanagadde wrote: > Floating point to integer conversion is well defined when the float lies > within > the representation bounds of the integer after discarding the fractional > part. > However, in other cases, unfortunately

Re: [FFmpeg-devel] [PATCH 1/2] avutil/common: add av_clipd64

2015-11-01 Thread Ronald S. Bultje
Hi, On Sun, Nov 1, 2015 at 1:03 PM, Ganesh Ajjanagadde wrote: > The rationale for this function is reflected in the documentation for > it, and is copied here: > > Clip a double value into the long long amin-amax range. > This function is needed because conversion of

Re: [FFmpeg-devel] [PATCH 1/3] avutil/eval: minor typo

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 5:10 PM, Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 11:57:53AM -0500, Ganesh Ajjanagadde wrote: >> Signed-off-by: Ganesh Ajjanagadde >> --- >> libavutil/eval.h | 2 +- >> 1 file changed, 1 insertion(+), 1

Re: [FFmpeg-devel] [PATCH 3/4] avutil/eval: check av_expr_parse_and_eval error code in the test build

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 1:33 PM, Ganesh Ajjanagadde wrote: > On Sun, Nov 1, 2015 at 12:52 PM, Michael Niedermayer > wrote: >> On Sat, Oct 31, 2015 at 10:47:56AM -0400, Ganesh Ajjanagadde wrote: >>> This returns the error code from main in the test, in

Re: [FFmpeg-devel] [PATCH 3/5] concatdec: move duration calculating code to open_file

2015-11-01 Thread Nicolas George
Le primidi 11 brumaire, an CCXXIV, Marton Balint a écrit : > Because I add it to the metadata store here in the next patch, which > metadata will be set for every file packet, so calculating it at the end of > file is not an option. I see. But do you really need the duration metadata when it is

Re: [FFmpeg-devel] [PATCH 0/2] first steps to resolving float to int undefined behavior

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 06:51:19PM -0500, Ganesh Ajjanagadde wrote: > On Sun, Nov 1, 2015 at 6:25 PM, Nicolas George wrote: > > Le primidi 11 brumaire, an CCXXIV, Ronald S. Bultje a écrit : > >> So, is this a bug in llrint, or is this a failure to use llrint, or is this > >>

[FFmpeg-devel] [PATCH] avformat/cache: Separate read and seek return-values within cache_read

2015-11-01 Thread Bryan Huh
Fixes an issue where an int64_t ffurl_seek return-value was being stored in a generic int "r" variable, leading to integer overflow when seeking into a large file (>2GB), and ultimately a "Failed to perform internal seek" error mesage. The "r" variable was used both for storing the result of any

[FFmpeg-devel] [PATCHv3 2/2] mpegtsenc: Implement writing of Opus trim_start/trim_end control values

2015-11-01 Thread Sebastian Dröge
From: Sebastian Dröge Signed-off-by: Sebastian Dröge --- libavformat/mpegtsenc.c | 43 --- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/libavformat/mpegtsenc.c