Re: [FFmpeg-devel] [PATCH] avfilter/showcqt: add cscheme option

2016-10-20 Thread Muhammad Faiz
On 10/19/16, Muhammad Faiz  wrote:
> Signed-off-by: Muhammad Faiz 
> ---
>  doc/filters.texi  |  5 +
>  libavfilter/avf_showcqt.c | 45
> ++---
>  libavfilter/avf_showcqt.h |  2 ++
>  3 files changed, 41 insertions(+), 11 deletions(-)

applied

thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] ffprobe: report field order for video streams

2016-10-20 Thread Tobias Rapp

On 19.10.2016 23:15, Michael Niedermayer wrote:

On Wed, Oct 19, 2016 at 02:35:21PM +0200, Tobias Rapp wrote:

From: Rodger Combs 

Reviewed-by: Tobias Rapp 
---
 doc/ffprobe.xsd |  1 +
 ffprobe.c   | 13 +
 tests/ref/fate/concat-demuxer-extended-lavf-mxf |  2 +-
 tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf  |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  |  2 +-
 tests/ref/fate/concat-demuxer-simple2-lavf-ts   |  2 +-
 tests/ref/fate/ffprobe_compact  |  4 ++--
 tests/ref/fate/ffprobe_csv  |  4 ++--
 tests/ref/fate/ffprobe_default  |  2 ++
 tests/ref/fate/ffprobe_flat |  2 ++
 tests/ref/fate/ffprobe_ini  |  2 ++
 12 files changed, 29 insertions(+), 9 deletions(-)


This too doesnt apply:

Applying: ffprobe: report field order for video streams
Using index info to reconstruct a base tree...
error: patch failed: tests/ref/fate/ffprobe_compact:27
error: tests/ref/fate/ffprobe_compact: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.



Could be due to encoding problems or long lines. Have rebased the patch 
onto current git HEAD and attached it as a file.


Regards,
Tobias
From 640344702717770695778fd3dcb4996f913876fb Mon Sep 17 00:00:00 2001
From: Rodger Combs 
Date: Mon, 10 Oct 2016 10:15:41 +0200
Subject: [PATCH 2/3] ffprobe: report field order for video streams

Reviewed-by: Tobias Rapp 
---
 doc/ffprobe.xsd |  1 +
 ffprobe.c   | 13 +
 tests/ref/fate/concat-demuxer-extended-lavf-mxf |  2 +-
 tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf  |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  |  2 +-
 tests/ref/fate/concat-demuxer-simple2-lavf-ts   |  2 +-
 tests/ref/fate/ffprobe_compact  |  4 ++--
 tests/ref/fate/ffprobe_csv  |  4 ++--
 tests/ref/fate/ffprobe_default  |  2 ++
 tests/ref/fate/ffprobe_flat |  2 ++
 tests/ref/fate/ffprobe_ini  |  2 ++
 12 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 757de12..ac0347f 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -201,6 +201,7 @@
   
   
   
+  
   
   
 
diff --git a/ffprobe.c b/ffprobe.c
index 662137c..7cd0034 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2268,6 +2268,19 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
 else
 print_str_opt("chroma_location", av_chroma_location_name(par->chroma_location));
 
+if (par->field_order == AV_FIELD_PROGRESSIVE)
+print_str("field_order", "progressive");
+else if (par->field_order == AV_FIELD_TT)
+print_str("field_order", "tt");
+else if (par->field_order == AV_FIELD_BB)
+print_str("field_order", "bb");
+else if (par->field_order == AV_FIELD_TB)
+print_str("field_order", "tb");
+else if (par->field_order == AV_FIELD_BT)
+print_str("field_order", "bt");
+else
+print_str_opt("field_order", "unknown");
+
 #if FF_API_PRIVATE_OPT
 if (dec_ctx && dec_ctx->timecode_frame_start >= 0) {
 char tcbuf[AV_TIMECODE_STR_SIZE];
diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf b/tests/ref/fate/concat-demuxer-extended-lavf-mxf
index f7905aa..8bb2fb0 100644
--- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf
+++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf
@@ -1 +1 @@
-21eb3a629ff504b55c93a66879a31362 *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe
+a277e04c23cf764abe692ca07e87b82e *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
index 0c49f1f..e294538 100644
--- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
+++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
@@ -1 +1 @@
-67a03ad49f1bd17131f751313639b61e *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
+026045a43aa2dde1723d7331c2252b01 *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
index 6bba76a..c899754 100644
--- a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
+++ b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
@@ -120,5 +120,5 @@ audio|1|65280|1.36|65280|1.36|1920|0.04|N/A|N/A|3840|206848|K_|1
 Strings Metadata|8
 video|0|37|1.48|34|1.36|1|0.04|N/A|N/A|24786|211456

Re: [FFmpeg-devel] [PATCH v2 3/3] fate: Add MXF D10/DV25 probe tests

2016-10-20 Thread Tobias Rapp

On 19.10.2016 23:06, Michael Niedermayer wrote:

On Wed, Oct 19, 2016 at 02:35:22PM +0200, Tobias Rapp wrote:

Signed-off-by: Tobias Rapp 
---
 tests/fate/mxf.mak| 19 ++-
 tests/ref/fate/mxf-probe-d10  |  3 +++
 tests/ref/fate/mxf-probe-dv25 |  4 
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/mxf-probe-d10
 create mode 100644 tests/ref/fate/mxf-probe-dv25


Applying: fate: Add MXF D10/DV25 probe tests
fatal: corrupt patch at line 60
didnt check deeply but some lines looks quite long, maybe something in
the mail chain didnt like that

[...]


Took the chance to change ffprobe output format from "compact" to 
"default". The reference files are only <80 bytes larger but it avoids 
the long lines and improves reading future diffs (git blame).


Also added a DNXHD probe test using an existing fate sample so 
progressive field order is covered now, too.


Updated patch attached as a file.

Regards,
Tobias
>From 49a9e528ad9d64fbe5ebbcea915382d5c70c20f4 Mon Sep 17 00:00:00 2001
From: Tobias Rapp 
Date: Wed, 19 Oct 2016 12:12:10 +0200
Subject: [PATCH 3/3] fate: Add MXF D10/DNXHD/DV25 probe tests

Signed-off-by: Tobias Rapp 
---
 tests/fate/mxf.mak |  23 ++-
 tests/ref/fate/mxf-probe-d10   | 106 ++
 tests/ref/fate/mxf-probe-dnxhd |  73 +
 tests/ref/fate/mxf-probe-dv25  | 146 +
 4 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/mxf-probe-d10
 create mode 100644 tests/ref/fate/mxf-probe-dnxhd
 create mode 100644 tests/ref/fate/mxf-probe-dv25

diff --git a/tests/fate/mxf.mak b/tests/fate/mxf.mak
index e95c0b5..b9a6ca0 100644
--- a/tests/fate/mxf.mak
+++ b/tests/fate/mxf.mak
@@ -8,7 +8,28 @@ fate-mxf-essencegroup-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mxf/opatom_esse
 FATE_MXF += fate-mxf-multiple-components-demux
 fate-mxf-multiple-components-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mxf/multiple_components.mxf -vcodec copy
 
+#
+# Tests probing MXF format and stream properties
+#
+PROBE_FORMAT_STREAMS_COMMAND = \
+ffprobe$(PROGSSUF)$(EXESUF) -show_entries format=format_name,duration,bit_rate:format_tags:streams:stream_tags \
+-print_format default -bitexact -v 0
+
+FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-probe-d10
+fate-mxf-probe-d10: SRC = $(TARGET_SAMPLES)/mxf/Sony-1.mxf
+fate-mxf-probe-d10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+
+FATE_MXF_PROBE-$(call ENCDEC, DNXHD, MXF) += fate-mxf-probe-dnxhd
+fate-mxf-probe-dnxhd: SRC = $(TARGET_SAMPLES)/mxf/multiple_components.mxf
+fate-mxf-probe-dnxhd: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+
+FATE_MXF_PROBE-$(call ENCDEC2, DVVIDEO, PCM_S16LE, MXF) += fate-mxf-probe-dv25
+fate-mxf-probe-dv25: SRC = $(TARGET_SAMPLES)/mxf/Avid-5.mxf
+fate-mxf-probe-dv25: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+
 FATE_MXF-$(CONFIG_MXF_DEMUXER) += $(FATE_MXF)
 
 FATE_SAMPLES_AVCONV += $(FATE_MXF-yes)
-fate-mxf: $(FATE_MXF-yes)
+FATE_SAMPLES_FFPROBE += $(FATE_MXF_PROBE-yes)
+
+fate-mxf: $(FATE_MXF-yes) $(FATE_MXF_PROBE-yes)
diff --git a/tests/ref/fate/mxf-probe-d10 b/tests/ref/fate/mxf-probe-d10
new file mode 100644
index 000..e1f5b36
--- /dev/null
+++ b/tests/ref/fate/mxf-probe-d10
@@ -0,0 +1,106 @@
+[STREAM]
+index=0
+codec_name=mpeg2video
+profile=0
+codec_type=video
+codec_time_base=1/25
+codec_tag_string=[0][0][0][0]
+codec_tag=0x
+width=720
+height=608
+coded_width=0
+coded_height=0
+has_b_frames=0
+sample_aspect_ratio=152:135
+display_aspect_ratio=4:3
+pix_fmt=yuv422p
+level=5
+color_range=tv
+color_space=unknown
+color_transfer=unknown
+color_primaries=unknown
+chroma_location=topleft
+field_order=tt
+timecode=N/A
+refs=1
+id=N/A
+r_frame_rate=25/1
+avg_frame_rate=25/1
+time_base=1/25
+start_pts=0
+start_time=0.00
+duration_ts=4
+duration=0.16
+bit_rate=5000
+max_bit_rate=N/A
+bits_per_raw_sample=N/A
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+TAG:file_package_umid=0x060A2B340101010501010D131300AE86B20091310580080046A54011
+[/STREAM]
+[STREAM]
+index=1
+codec_name=pcm_s16le
+profile=unknown
+codec_type=audio
+codec_time_base=1/48000
+codec_tag_string=[0][0][0][0]
+codec_tag=0x
+sample_fmt=s16
+sample_rate=48000
+channels=8
+channel_layout=unknown
+bits_per_sample=16
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.00
+duration_ts=8562
+duration=0.178375
+bit_rate=6144000
+max_bit_rate=N/A
+bits_per_raw_sample=N/A
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:ori

Re: [FFmpeg-devel] [PATCH] avfilter/firequalizer: use zero phase kernel

2016-10-20 Thread Muhammad Faiz
On 10/19/16, Muhammad Faiz  wrote:
> this makes real-valued kernel
>
> Signed-off-by: Muhammad Faiz 
> ---
>  libavfilter/af_firequalizer.c | 26 +++---
>  1 file changed, 15 insertions(+), 11 deletions(-)

applied

thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] removing comma at final enumeration items to fix pedantic warnings

2016-10-20 Thread Nicolas George
L'octidi 28 vendémiaire, an CCXXV, Ronald S. Bultje a écrit :
> FWIW I still have doubts about this.

FWIW, I still have more than doubts about this. This comma is entirely
valid. If anything should be changed, it should be to add it where it is
missing, for consistency.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] removing comma at final enumeration items to fix pedantic warnings

2016-10-20 Thread Clément Bœsch
On Thu, Oct 20, 2016 at 09:49:40AM +0200, Nicolas George wrote:
> L'octidi 28 vendémiaire, an CCXXV, Ronald S. Bultje a écrit :
> > FWIW I still have doubts about this.
> 
> FWIW, I still have more than doubts about this. This comma is entirely
> valid. If anything should be changed, it should be to add it where it is
> missing, for consistency.
> 

it's a _NB entry, there won't be any entry added after those.

also, "2 files changed, 7 insertions(+), 7 deletions(-)"

it's really a trivial and harmless patch.

-- 
Clément B.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] removing comma at final enumeration items to fix pedantic warnings

2016-10-20 Thread Nicolas George
Le nonidi 29 vendémiaire, an CCXXV, Clement Boesch a écrit :
> it's really a trivial and harmless patch.

Which is not enough to accept it.

I am sure there are better uses of contributors' time than that.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] removing comma at final enumeration items to fix pedantic warnings

2016-10-20 Thread Clément Bœsch
On Thu, Oct 20, 2016 at 09:55:17AM +0200, Nicolas George wrote:
> Le nonidi 29 vendémiaire, an CCXXV, Clement Boesch a écrit :
> > it's really a trivial and harmless patch.
> 
> Which is not enough to accept it.
> 

but the patch is perfectly fine and semantically more correct (it
explicits that it's wrong to add entry afterward).

> I am sure there are better uses of contributors' time than that.
> 

people are free to do whatever they feel like; you're just wasting yours
by bikeshedding about this stuff you could just ignore.

-- 
Clément B.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/sheervideo: Increase av_get_codec_tag_string() input buffer size.

2016-10-20 Thread Carl Eugen Hoyos
2016-10-18 15:04 GMT+02:00 Carl Eugen Hoyos :

> Attached patch increases the size of the input buffer for
> av_get_codec_tag_string() to 32, typically used in FFmpeg.

Patch applied, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] removing comma at final enumeration items to fix pedantic warnings

2016-10-20 Thread Carl Eugen Hoyos
2016-10-20 9:55 GMT+02:00 Nicolas George :

> I am sure there are better uses of contributors' time than that.

After many years on this list, I don't think this is a helpful approach.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/aviobuf: add ff_get_line2() variant

2016-10-20 Thread Stefano Sabatini
On date Tuesday 2016-10-18 16:48:02 +0200, Michael Niedermayer encoded:
> On Tue, Oct 18, 2016 at 01:32:12PM +0200, Stefano Sabatini wrote:
[...]
> >  aviobuf.c  |   18 +++---
> >  internal.h |   14 ++
> >  2 files changed, 29 insertions(+), 3 deletions(-)
> > 19b979c45f087997ac69fba2caf5504c933acfc8  
> > 0001-lavf-aviobuf-add-ff_get_line2-variant.patch
> > From 58c1cad434447d48246e153e3a1a391d72d23c7b Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini 
> > Date: Thu, 13 Oct 2016 16:36:30 +0200
> > Subject: [PATCH] lavf/aviobuf: add ff_get_line2() variant
> > 
> > This allows to probe if the read line was partially discarded.
> > ---
> >  libavformat/aviobuf.c  | 18 +++---
> >  libavformat/internal.h | 14 ++
> >  2 files changed, 29 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> > index 134d627..29bcf1e 100644
> > --- a/libavformat/aviobuf.c
> > +++ b/libavformat/aviobuf.c
> > @@ -764,18 +764,30 @@ unsigned int avio_rb32(AVIOContext *s)
> >  
> >  int ff_get_line(AVIOContext *s, char *buf, int maxlen)
> >  {
> > -int i = 0;
> > +return ff_get_line2(s, buf, maxlen, NULL);
> > +}
> > +
> > +int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen)
> > +{
> > +int i = 0, j = 0;
> >  char c;
> >  
> > +while (1) {
> >  c = avio_r8(s);
> >  if (c && i < maxlen-1)
> >  buf[i++] = c;
> > +if (c != '\n' && c != '\r' && c) {
> > +j++;
> > +} else {
> > +break;
> > +}
> > +}
> 
> a string like "\n"
> would have a strlen of 1
> but readlen of 0
> while a string like "X" would have a strlen and readlen of 1
> 
> is this difference intended ?
> or maybe i misread the code

You're right, I was confused.

Updated patch in attachment, thanks.
-- 
FFmpeg = Frightening and Fierce Moronic Power Elected Geisha
>From 54a5d3469d4d9a3f17f45e7577da6c46cb7e969e Mon Sep 17 00:00:00 2001
From: Stefano Sabatini 
Date: Thu, 13 Oct 2016 16:36:30 +0200
Subject: [PATCH] lavf/aviobuf: add ff_get_line2() variant

This allows to probe if the read line was partially discarded.
---
 libavformat/aviobuf.c  | 16 +---
 libavformat/internal.h | 14 ++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 134d627..144a617 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -764,18 +764,28 @@ unsigned int avio_rb32(AVIOContext *s)
 
 int ff_get_line(AVIOContext *s, char *buf, int maxlen)
 {
-int i = 0;
+return ff_get_line2(s, buf, maxlen, NULL);
+}
+
+int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen)
+{
+int i = 0, j = 0;
 char c;
 
 do {
 c = avio_r8(s);
-if (c && i < maxlen-1)
-buf[i++] = c;
+if (c) {
+if (i < maxlen-1)
+buf[i++] = c;
+j++;
+}
 } while (c != '\n' && c != '\r' && c);
 if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s))
 avio_skip(s, -1);
 
 buf[i] = 0;
+if (readlen)
+*readlen = j;
 return i;
 }
 
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 49244fa..fc49571 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -274,6 +274,20 @@ void ff_put_v(AVIOContext *bc, uint64_t val);
  */
 int ff_get_line(AVIOContext *s, char *buf, int maxlen);
 
+/**
+ * Read a whole line of text from AVIOContext. Stop reading after reaching
+ * either a \\n, a \\0 or EOF. The returned string is always \\0-terminated,
+ * and may be truncated if the buffer is too small.
+ *
+ * @param s the read-only AVIOContext
+ * @param buf buffer to store the read line
+ * @param maxlen size of the buffer
+ * @param readlen length of the read line, not including the final \\0
+ * @return the length of the string written in the buffer, not including the
+ * final \\0
+ */
+int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen);
+
 #define SPACE_CHARS " \t\r\n"
 
 /**
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/libvpxenc: fix -auto-alt-ref option type

2016-10-20 Thread Kagami Hiiragi
vp9_cx_iface actually allows values in range [0..2].
This fixes ticket #5894.

Signed-off-by: Kagami Hiiragi 
---
 libavcodec/libvpxenc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 2db87f7..bedaa70 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -615,6 +615,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
 }
 }
 
+if (ctx->auto_alt_ref > 1 && avctx->codec_id == AV_CODEC_ID_VP8) {
+av_log(avctx, AV_LOG_ERROR, "auto_alt_ref > 1 is forbidden for 
libvpx-vp8\n");
+return AVERROR(EINVAL);
+}
+
 //codec control failures are currently treated only as warnings
 av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
 codecctl_int(avctx, VP8E_SET_CPUUSED,  ctx->cpu_used);
@@ -1025,7 +1030,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
*pkt,
 
 #define COMMON_OPTIONS \
 { "auto-alt-ref","Enable use of alternate reference " \
- "frames (2-pass only)",   
OFFSET(auto_alt_ref),AV_OPT_TYPE_BOOL, {.i64 = -1}, -1,  1,   
VE}, \
+ "frames (2-pass only)",   
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
VE}, \
 { "lag-in-frames",   "Number of frames to look ahead for " \
  "alternate reference frame selection",
OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
 { "arnr-maxframes",  "altref noise reduction max frame count", 
OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
-- 
2.7.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: write DisplayWidth and DisplayHeight elements only if they differ from PixelWidth and PixelHeight

2016-10-20 Thread Dave Rice
Hi James,

> On Oct 18, 2016, at 11:20 PM, James Almer  wrote:
> 
> Signed-off-by: James Almer 
> ---
> libavformat/matroskaenc.c | 6 --
> tests/fate/matroska.mak   | 2 +-
> 2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 6f2957c..03d5326 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1192,8 +1192,10 @@ static int mkv_write_track(AVFormatContext *s, 
> MatroskaMuxContext *mkv,
> av_log(s, AV_LOG_ERROR, "Overflow in display width\n");
> return AVERROR(EINVAL);
> }
> -put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width / 
> display_width_div);
> -put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, par->height / 
> display_height_div);
> +if (d_width != par->width || display_width_div != 1 || 
> display_height_div != 1) {
> +put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width / 
> display_width_div);
> +put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, 
> par->height / display_height_div);
> +}
> } else if (display_width_div != 1 || display_height_div != 1) {
> put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , par->width / 
> display_width_div);
> put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, par->height / 
> display_height_div);

You could also make the storage simpler by considering whether or not to write 
DisplayWidth and DisplayHeight independently. For instance:
PixelWidth=720
PixelHeight=480
DisplayWidth=640
DisplayHeight=480

could be simplified to this (as DisplayHeight if unstored, defaults to 
PixelHeight)
PixelWidth=720
PixelHeight=480
DisplayWidth=640

However I'm worried that this may break things when #4489 and/or #5301 are 
resolved. As the DisplayWidth/Height are intended to be used after cropping. In 
the attached example on #5301 it has:

PixelWidth=320
PixelHeight=240
PixelCropBottom=40
PixelCropTop=0
PixelCropLeft=240
PixelCropRight=40
DisplayWidth=320
DisplayHeight=240

If this was remuxed with your patch AND a potential patch to pass PixelCrop 
elements from source mkv to output mkv, then the result would be:

PixelWidth=320
PixelHeight=240
PixelCropBottom=40
PixelCropTop=0
PixelCropLeft=240
PixelCropRight=40

and since the Display Elements are not stored, they would be evaluated as 
DisplayWidth as "PixelWidth - PixelCropLeft - PixelCropRight"
DisplayHeight = "PixelHeight - PixelCropTop - PixelCropBottom"
which is 
DisplayWidth=40
DisplayHeight=200
which is wrong, since the original file intended to show the cropped 40x200 
image in a 320x240 display.

Dave Rice

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add support for iec61966-2.1 (sRGB) transfer

2016-10-20 Thread Ronald S. Bultje
Hi,

On Tue, Oct 18, 2016 at 3:17 PM, Vittorio Giovara <
vittorio.giov...@gmail.com> wrote:

> Signed-off-by: Vittorio Giovara 
> ---
> Special thanks to Andrew Roland for helping me figure out these numbers.
> Please keep me in CC.
> Vittorio
>
>  libavfilter/vf_colorspace.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index 5b060f9..16ad760 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -229,6 +229,7 @@ static const struct TransferCharacteristics
> transfer_characteristics[AVCOL_TRC_N
>  [AVCOL_TRC_GAMMA28]   = { 1.0,0.0,1.0 / 2.8, 0.0 },
>  [AVCOL_TRC_SMPTE170M] = { 1.099,  0.018,  0.45, 4.5 },
>  [AVCOL_TRC_SMPTE240M] = { 1.1115, 0.0228, 0.45, 4.0 },
> +[AVCOL_TRC_IEC61966_2_1] = { 1.055, 0.0031308, 1.0 / 2.4, 12.92 },
>  [AVCOL_TRC_BT2020_10] = { 1.099,  0.018,  0.45, 4.5 },
>  [AVCOL_TRC_BT2020_12] = { 1.0993, 0.0181, 0.45, 4.5 },
>  };
> @@ -1067,6 +1068,8 @@ static const AVOption colorspace_options[] = {
>  ENUM("gamma28",  AVCOL_TRC_GAMMA28,  "trc"),
>  ENUM("smpte170m",AVCOL_TRC_SMPTE170M,"trc"),
>  ENUM("smpte240m",AVCOL_TRC_SMPTE240M,"trc"),
> +ENUM("srgb", AVCOL_TRC_IEC61966_2_1, "trc"),
> +ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
>  ENUM("bt2020-10",AVCOL_TRC_BT2020_10,"trc"),
>  ENUM("bt2020-12",AVCOL_TRC_BT2020_12,"trc"),
>
> --
> 2.10.0


After some discussion offline, I think this is fine. I'll leave it for a
few hours for others to comment on before I push.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] ffprobe: report field order for video streams

2016-10-20 Thread Dave Rice

> On Oct 20, 2016, at 3:28 AM, Tobias Rapp  wrote:
> 
> On 19.10.2016 23:15, Michael Niedermayer wrote:
>> On Wed, Oct 19, 2016 at 02:35:21PM +0200, Tobias Rapp wrote:
>>> From: Rodger Combs 
>>> 
>>> Reviewed-by: Tobias Rapp 
>>> ---
>>> doc/ffprobe.xsd |  1 +
>>> ffprobe.c   | 13 +
>>> tests/ref/fate/concat-demuxer-extended-lavf-mxf |  2 +-
>>> tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 |  2 +-
>>> tests/ref/fate/concat-demuxer-simple1-lavf-mxf  |  2 +-
>>> tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  |  2 +-
>>> tests/ref/fate/concat-demuxer-simple2-lavf-ts   |  2 +-
>>> tests/ref/fate/ffprobe_compact  |  4 ++--
>>> tests/ref/fate/ffprobe_csv  |  4 ++--
>>> tests/ref/fate/ffprobe_default  |  2 ++
>>> tests/ref/fate/ffprobe_flat |  2 ++
>>> tests/ref/fate/ffprobe_ini  |  2 ++
>>> 12 files changed, 29 insertions(+), 9 deletions(-)
>> 
>> This too doesnt apply:
>> 
>> Applying: ffprobe: report field order for video streams
>> Using index info to reconstruct a base tree...
>> error: patch failed: tests/ref/fate/ffprobe_compact:27
>> error: tests/ref/fate/ffprobe_compact: patch does not apply
>> error: Did you hand edit your patch?
>> It does not apply to blobs recorded in its index.
>> 
> 
> Could be due to encoding problems or long lines. Have rebased the patch onto 
> current git HEAD and attached it as a file.

I tested this and the new version applied for me. The output of xml=q=1 
validated against the revision. LGTM. Having this data in ffprobe is really 
helpful.
Dave Rice

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/flvenc: do not write duration and filesize when cannot seekable

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 09:16:55AM +0800, Steven Liu wrote:
> 2016-10-13 4:08 GMT+08:00 Michael Niedermayer :
> 
> > On Wed, Oct 12, 2016 at 06:11:41PM +0800, Steven Liu wrote:
> > > when living stream cannot seekable, don't write duration and
> > > filesize in metadata, and donnot seek at the flv_write_trailer
> > >
> > > Signed-off-by: Steven Liu 
> > > ---
> > >  libavformat/flvenc.c |   49 --
> > ---
> > >  1 files changed, 28 insertions(+), 21 deletions(-)
> >
> > This will also remove these fields from
> > -f hds
> > is that intended ?
> >
> if cannot seekable when living stream. the duration and the filesize value
> is 0, the value is wrong.
> so i think remove it is a right way, because there have no describe to the
> duration and the filesize for use,
> some media player will use the value to control play duration. yes! that's
> a shit media player, but i think it can fix by publish tools.

patch applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vf_colorspace: don't spam console with warnings if range is unspecified.

2016-10-20 Thread Ronald S. Bultje
---
 libavfilter/vf_colorspace.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index c74fe00..f64163f 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -163,6 +163,8 @@ typedef struct ColorSpaceContext {
 yuv2yuv_fn yuv2yuv;
 double yuv2rgb_dbl_coeffs[3][3], rgb2yuv_dbl_coeffs[3][3];
 int in_y_rng, in_uv_rng, out_y_rng, out_uv_rng;
+
+int did_range_warn;
 } ColorSpaceContext;
 
 // FIXME deal with odd width/heights (or just forbid it)
@@ -523,9 +525,15 @@ static int get_range_off(AVFilterContext *ctx, int *off,
  enum AVColorRange rng, int depth)
 {
 switch (rng) {
-case AVCOL_RANGE_UNSPECIFIED:
-av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");
+case AVCOL_RANGE_UNSPECIFIED: {
+ColorSpaceContext *s = ctx->priv;
+
+if (!s->did_range_warn) {
+av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming 
tv/mpeg\n");
+s->did_range_warn = 1;
+}
 // fall-through
+}
 case AVCOL_RANGE_MPEG:
 *off = 16 << (depth - 8);
 *y_rng = 219 << (depth - 8);
-- 
2.8.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add support for iec61966-2.1 (sRGB) transfer

2016-10-20 Thread Michael Niedermayer
On Tue, Oct 18, 2016 at 03:17:26PM -0400, Vittorio Giovara wrote:
> Signed-off-by: Vittorio Giovara 
> ---
> Special thanks to Andrew Roland for helping me figure out these numbers.
> Please keep me in CC.
> Vittorio
> 
>  libavfilter/vf_colorspace.c | 3 +++
>  1 file changed, 3 insertions(+)

LGTM

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: write DisplayWidth and DisplayHeight elements only if they differ from PixelWidth and PixelHeight

2016-10-20 Thread Nicolas George
Le nonidi 29 vendémiaire, an CCXXV, Dave Rice a écrit :
> You could also make the storage simpler by considering whether or not to
> write DisplayWidth and DisplayHeight independently. For instance:
> PixelWidth=720
> PixelHeight=480
> DisplayWidth=640
> DisplayHeight=480
> 
> could be simplified to this (as DisplayHeight if unstored, defaults to 
> PixelHeight)
> PixelWidth=720
> PixelHeight=480
> DisplayWidth=640

Even apart from the drawbacks you expect, I do not think this
micro-optimization is very interesting. Logically, width and height go
together, using half a default value seems unnatural.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_colorspace: don't spam console with warnings if range is unspecified.

2016-10-20 Thread Josh de Kock

On 20/10/2016 17:06, Ronald S. Bultje wrote:

---
 libavfilter/vf_colorspace.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index c74fe00..f64163f 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -163,6 +163,8 @@ typedef struct ColorSpaceContext {
 yuv2yuv_fn yuv2yuv;
 double yuv2rgb_dbl_coeffs[3][3], rgb2yuv_dbl_coeffs[3][3];
 int in_y_rng, in_uv_rng, out_y_rng, out_uv_rng;
+
+int did_range_warn;
 } ColorSpaceContext;

 // FIXME deal with odd width/heights (or just forbid it)
@@ -523,9 +525,15 @@ static int get_range_off(AVFilterContext *ctx, int *off,
  enum AVColorRange rng, int depth)
 {
 switch (rng) {
-case AVCOL_RANGE_UNSPECIFIED:
-av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");
+case AVCOL_RANGE_UNSPECIFIED: {
+ColorSpaceContext *s = ctx->priv;
+
+if (!s->did_range_warn) {
+av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming 
tv/mpeg\n");
+s->did_range_warn = 1;
+}
 // fall-through
+}
 case AVCOL_RANGE_MPEG:
 *off = 16 << (depth - 8);
 *y_rng = 219 << (depth - 8);



I think did_warn_range would sound more natural. LGTM otherwise (with or 
without the change).


--
Josh
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_colorspace: don't spam console with warnings if range is unspecified.

2016-10-20 Thread Ronald S. Bultje
Hi,

On Thu, Oct 20, 2016 at 1:08 PM, Josh de Kock  wrote:

> On 20/10/2016 17:06, Ronald S. Bultje wrote:
>
>> ---
>>  libavfilter/vf_colorspace.c | 12 ++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
>> index c74fe00..f64163f 100644
>> --- a/libavfilter/vf_colorspace.c
>> +++ b/libavfilter/vf_colorspace.c
>> @@ -163,6 +163,8 @@ typedef struct ColorSpaceContext {
>>  yuv2yuv_fn yuv2yuv;
>>  double yuv2rgb_dbl_coeffs[3][3], rgb2yuv_dbl_coeffs[3][3];
>>  int in_y_rng, in_uv_rng, out_y_rng, out_uv_rng;
>> +
>> +int did_range_warn;
>>  } ColorSpaceContext;
>>
>>  // FIXME deal with odd width/heights (or just forbid it)
>> @@ -523,9 +525,15 @@ static int get_range_off(AVFilterContext *ctx, int
>> *off,
>>   enum AVColorRange rng, int depth)
>>  {
>>  switch (rng) {
>> -case AVCOL_RANGE_UNSPECIFIED:
>> -av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming
>> tv/mpeg\n");
>> +case AVCOL_RANGE_UNSPECIFIED: {
>> +ColorSpaceContext *s = ctx->priv;
>> +
>> +if (!s->did_range_warn) {
>> +av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming
>> tv/mpeg\n");
>> +s->did_range_warn = 1;
>> +}
>>  // fall-through
>> +}
>>  case AVCOL_RANGE_MPEG:
>>  *off = 16 << (depth - 8);
>>  *y_rng = 219 << (depth - 8);
>>
>>
> I think did_warn_range would sound more natural. LGTM otherwise (with or
> without the change).


Changed locally, thanks. I'll leave it out for a couple more hours before
pushing so others have time to comment too.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] rsd: limit number of channels

2016-10-20 Thread Andreas Cadhalpun
On 20.10.2016 02:04, Michael Niedermayer wrote:
> On Wed, Oct 19, 2016 at 11:46:43PM +0200, Andreas Cadhalpun wrote:
>> Negative values don't make sense and too large values can cause
>> overflows. For AV_CODEC_ID_ADPCM_THP this leads to a too small extradata
>> buffer being allocated, causing out-of-bounds writes.
>>
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavformat/rsd.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> LGTM

Pushed.

Best regards,
Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/4] V14 - Adding SCTE-35 CUI codec

2016-10-20 Thread Michael Niedermayer
On Tue, Oct 18, 2016 at 05:36:27PM -0700, Carlos Fernandez Sanz wrote:
> From: Carlos Fernandez 
> 
> Signed-off-by: Carlos Fernandez 
> ---
>  libavcodec/avcodec.h| 1 +
>  libavcodec/codec_desc.c | 6 ++
>  2 files changed, 7 insertions(+)

Reviewed-by: Michael
LGTM

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] V14 - SCTE-35 extraction from mpegts

2016-10-20 Thread Michael Niedermayer
On Tue, Oct 18, 2016 at 05:36:28PM -0700, Carlos Fernandez Sanz wrote:
> From: Carlos Fernandez 
> 
> Signed-off-by: Carlos Fernandez 
> ---
>  libavformat/mpegts.c | 47 +--
>  1 file changed, 45 insertions(+), 2 deletions(-)

Acked-by: Michael

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] V14 - Correct Indentation

2016-10-20 Thread Michael Niedermayer
On Tue, Oct 18, 2016 at 05:36:30PM -0700, Carlos Fernandez Sanz wrote:
> From: Carlos Fernandez 
> 
> Signed-off-by: Carlos Fernandez 
> ---
>  libavformat/hlsenc.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Michael
LGTM

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] aiffdec: fix division by zero

2016-10-20 Thread Andreas Cadhalpun
On 20.10.2016 02:56, Michael Niedermayer wrote:
> On Wed, Oct 19, 2016 at 09:18:51PM +0200, Andreas Cadhalpun wrote:
>> This is similar to commit c143a9c.
>>
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavformat/aiffdec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> can aiff work without block_align ?

Well, it can use a fall-back value. That value can be wrong, of course.

> either way, block_duration is from the header reading
> if its still accurate then using it together with 1 instead of the
> matching block align is quite likely not correct
> OTOH if block_duration does not represent the actual content then
> the duration would only be correct by pure chance
> 
> Its a bit unfortunate that theres no usecase with an undamaged sample
> which would have clear correct values
> 
> one has to work on the assumptation of a use case where the user needs
> to override the codec and then ask "what is correct to do" that makes
> this a bit tricky ...

Alternatively aiff_read_packet could just error out, if you prefer that.
Patch doing that attached.

Best regards,
Andreas

>From d1edb842a886de0bae6e32ac602f2fef6810081a Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Thu, 20 Oct 2016 20:08:15 +0200
Subject: [PATCH] aiff: check block_align in aiff_read_packet

It can be unset in avcodec_parameters_from_context and a value of 0
causes SIGFPE crashes.

Signed-off-by: Andreas Cadhalpun 
---
 libavformat/aiffdec.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index de82787..59e969d 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -371,6 +371,11 @@ static int aiff_read_packet(AVFormatContext *s,
 if (max_size <= 0)
 return AVERROR_EOF;
 
+if (!st->codecpar->block_align) {
+av_log(s, AV_LOG_ERROR, "block_align not set\n");
+return AVERROR_INVALIDDATA;
+}
+
 /* Now for that packet */
 switch (st->codecpar->codec_id) {
 case AV_CODEC_ID_ADPCM_IMA_QT:
-- 
2.9.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dcstr: fix division by zero

2016-10-20 Thread Andreas Cadhalpun
On 20.10.2016 02:59, Michael Niedermayer wrote:
> On Wed, Oct 19, 2016 at 10:41:22PM +0200, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavformat/dcstr.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c
>> index 69fae41..d5d2281 100644
>> --- a/libavformat/dcstr.c
>> +++ b/libavformat/dcstr.c
>> @@ -47,7 +47,7 @@ static int dcstr_read_header(AVFormatContext *s)
>>  avio_skip(s->pb, 4);
>>  st->duration   = avio_rl32(s->pb);
> 
>>  st->codecpar->channels   *= avio_rl32(s->pb);
> 
> This here can overflow and needs a check

Yes.

> 
>> -if (!align || align > INT_MAX / st->codecpar->channels)
>> +if (!align || !st->codecpar->channels || align > INT_MAX / 
>> st->codecpar->channels)
>>  return AVERROR_INVALIDDATA;
> 
> might need a <0 check too should be ok otherwise

OK. New patch attached.

Best regards,
Andreas

>From 656f4ea3f664417197a622dcf80284e890caa849 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Thu, 20 Oct 2016 20:13:54 +0200
Subject: [PATCH] dcstr: fix division by zero

Also check for possible overflows.

Signed-off-by: Andreas Cadhalpun 
---
 libavformat/dcstr.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c
index 69fae41..6035dd4 100644
--- a/libavformat/dcstr.c
+++ b/libavformat/dcstr.c
@@ -33,6 +33,7 @@ static int dcstr_probe(AVProbeData *p)
 static int dcstr_read_header(AVFormatContext *s)
 {
 unsigned codec, align;
+int mult;
 AVStream *st;
 
 st = avformat_new_stream(s, NULL);
@@ -46,7 +47,12 @@ static int dcstr_read_header(AVFormatContext *s)
 align  = avio_rl32(s->pb);
 avio_skip(s->pb, 4);
 st->duration   = avio_rl32(s->pb);
-st->codecpar->channels   *= avio_rl32(s->pb);
+mult   = avio_rl32(s->pb);
+if (st->codecpar->channels <= 0 || mult <= 0 || mult > INT_MAX / st->codecpar->channels) {
+av_log(s, AV_LOG_ERROR, "invalid number of channels %d x %d\n", st->codecpar->channels, mult);
+return AVERROR_INVALIDDATA;
+}
+st->codecpar->channels *= mult;
 if (!align || align > INT_MAX / st->codecpar->channels)
 return AVERROR_INVALIDDATA;
 st->codecpar->block_align = align * st->codecpar->channels;
-- 
2.9.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Ticket #5897. swresample. Incorrect work of swr_set_matrix() if the SwrContext was never initialized

2016-10-20 Thread v0lt r


From 55a5ec258f53fc7a4bdbea200d096bd5d46625d4 Mon Sep 17 00:00:00 2001
From: Aleksoid1978
Date: Wed, 19 Oct 2016 11:38:12 +0300
Subject: [PATCH] fix swr_set_matrix()

---
libswresample/rematrix.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index 1af2498..4721063 100644
--- a/libswresample/rematrix.c
+++ b/libswresample/rematrix.c
@@ -68,14 +68,12 @@ int swr_set_matrix(struct SwrContext *s, const double 
*matrix, int stride)
if (!s || s->in_convert) // s needs to be allocated but not initialized
return AVERROR(EINVAL);
memset(s->matrix, 0, sizeof(s->matrix));
+memset(s->matrix_flt, 0, sizeof(s->matrix_flt));
nb_in  = av_get_channel_layout_nb_channels(s->user_in_ch_layout);
nb_out = av_get_channel_layout_nb_channels(s->user_out_ch_layout);
for (out = 0; out < nb_out; out++) {
for (in = 0; in < nb_in; in++)
-s->matrix[out][in] = matrix[in];
-if (s->int_sample_fmt == AV_SAMPLE_FMT_FLTP)
-for (in = 0; in < nb_in; in++)
-s->matrix_flt[out][in] = matrix[in];
+s->matrix_flt[out][in] = s->matrix[out][in] = matrix[in];
matrix += stride;
}
s->rematrix_custom = 1;
--
1.9.5.msysgit.0
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: zero initialize codec_name in mov_parse_stsd_video()

2016-10-20 Thread Andreas Cadhalpun
On 20.10.2016 03:25, Michael Niedermayer wrote:
> On Wed, Oct 19, 2016 at 07:30:29PM +0200, Andreas Cadhalpun wrote:
>> On 19.10.2016 04:15, James Almer wrote:
>>> On 10/17/2016 9:57 PM, Michael Niedermayer wrote:
 On Sun, Oct 16, 2016 at 09:34:50PM -0300, James Almer wrote:
> Fixes valgrind warning about "Conditional jump or move depends on 
> uninitialised value(s)"
>
> Signed-off-by: James Almer 
> ---
>  libavformat/mov.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

 This should be suppressable by adding it to
 tests/fate-valgrind.supp
>>>
>>> I'll leave that to someone else. No idea how to add stuff to that file.
>>>
>>> Should i drop this patch? Zero initializing a buffer in stack wouldn't
>>> hurt IMO.
>>
>> I prefer fixing such things in the code if it's reasonable possible, which
>> is the case here. In other words, the patch looks good to me.
> 
> I think the bug is that valgrind misinterprets highly optimized libc/gcc
> code, i might be wrong though as i didnt disassemble and analyze this,
> that was just my feeling ...
> But if true a change to ffmpeg can only workaround but not fix this

Yes, this seems to be a false positive. But working around it is good, because
it increases the signal to noise ratio of valgrind.
This is similar to false positive compiler warnings: Not working around them
has high chances of wasting the time of the next one to look into it.

Best regards,
Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/libvpxenc: fix -auto-alt-ref option type

2016-10-20 Thread Rostislav Pehlivanov
On 20 October 2016 at 16:31, Kagami Hiiragi  wrote:

> vp9_cx_iface actually allows values in range [0..2].
> This fixes ticket #5894.
>
> Signed-off-by: Kagami Hiiragi 
> ---
>  libavcodec/libvpxenc.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 2db87f7..bedaa70 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -615,6 +615,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  }
>  }
>
> +if (ctx->auto_alt_ref > 1 && avctx->codec_id == AV_CODEC_ID_VP8) {
> +av_log(avctx, AV_LOG_ERROR, "auto_alt_ref > 1 is forbidden for
> libvpx-vp8\n");
> +return AVERROR(EINVAL);
> +}
> +
>  //codec control failures are currently treated only as warnings
>  av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
>  codecctl_int(avctx, VP8E_SET_CPUUSED,  ctx->cpu_used);
> @@ -1025,7 +1030,7 @@ static int vpx_encode(AVCodecContext *avctx,
> AVPacket *pkt,
>
>  #define COMMON_OPTIONS \
>  { "auto-alt-ref","Enable use of alternate reference " \
> - "frames (2-pass only)",
>  OFFSET(auto_alt_ref),AV_OPT_TYPE_BOOL, {.i64 = -1}, -1,  1,
>VE}, \
> + "frames (2-pass only)",
>  OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,
>VE}, \
>  { "lag-in-frames",   "Number of frames to look ahead for " \
>   "alternate reference frame selection",
> OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,
> INT_MAX, VE}, \
>  { "arnr-maxframes",  "altref noise reduction max frame count",
> OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,
> INT_MAX, VE}, \
> --
> 2.7.3
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

lgtm
You could have moved the check after the tuning ifs before the alpha
channel check but it's okay like it is, whoever commits it could do it
anyway if they feel like it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] cavsdec: unref frame before referencing again

2016-10-20 Thread Andreas Cadhalpun
This fixes asserts (from commit 13aae8) in av_frame_ref and
av_frame_move_ref.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/cavsdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 70ac6f8..fed7043 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -1217,6 +1217,8 @@ static int cavs_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 h->got_keyframe = 1;
 }
 case PIC_PB_START_CODE:
+if (*got_frame)
+av_frame_unref(data);
 *got_frame = 0;
 if (!h->got_keyframe)
 break;
-- 
2.9.3
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mpeg12dec: unref discarded picture from extradata

2016-10-20 Thread Andreas Cadhalpun
Otherwise another frame gets referenced into picture, triggering an assert
(from commit 13aae8) in av_frame_ref.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/mpeg12dec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 44f7b61..ac8160d 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2808,6 +2808,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void 
*data,
 avctx->extradata, avctx->extradata_size);
 if (*got_output) {
 av_log(avctx, AV_LOG_ERROR, "picture in extradata\n");
+av_frame_unref(picture);
 *got_output = 0;
 }
 s->extradata_decoded = 1;
-- 
2.9.3
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 0/3] Detect field_order based on video_line_map

2016-10-20 Thread Michael Niedermayer
On Wed, Oct 19, 2016 at 02:35:19PM +0200, Tobias Rapp wrote:
> This patch series adds fate tests for probing MXF D10 (top field first) and
> DV25 (bottom field first) file properties. Patch #2 is taken from
> https://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200607.html
> and has been augmented with the missing XSD update.
> 
> The fate samples can be downloaded at the following URLs wrapped into a ZIP
> file and should be put into folder "$FATE_SAMPLES/mxf".
> 

> Avid-5.mxf:
> http://mxf.irt.de/files/download.php?action=getFile&repository=manufacturers&id=85
> 
> Sony-1.mxf:
> http://mxf.irt.de/files/download.php?action=getFile&repository=manufacturers&id=134

uploaded

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/aviobuf: add ff_get_line2() variant

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 04:05:07PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2016-10-18 16:48:02 +0200, Michael Niedermayer encoded:
> > On Tue, Oct 18, 2016 at 01:32:12PM +0200, Stefano Sabatini wrote:
> [...]
> > >  aviobuf.c  |   18 +++---
> > >  internal.h |   14 ++
> > >  2 files changed, 29 insertions(+), 3 deletions(-)
> > > 19b979c45f087997ac69fba2caf5504c933acfc8  
> > > 0001-lavf-aviobuf-add-ff_get_line2-variant.patch
> > > From 58c1cad434447d48246e153e3a1a391d72d23c7b Mon Sep 17 00:00:00 2001
> > > From: Stefano Sabatini 
> > > Date: Thu, 13 Oct 2016 16:36:30 +0200
> > > Subject: [PATCH] lavf/aviobuf: add ff_get_line2() variant
> > > 
> > > This allows to probe if the read line was partially discarded.
> > > ---
> > >  libavformat/aviobuf.c  | 18 +++---
> > >  libavformat/internal.h | 14 ++
> > >  2 files changed, 29 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> > > index 134d627..29bcf1e 100644
> > > --- a/libavformat/aviobuf.c
> > > +++ b/libavformat/aviobuf.c
> > > @@ -764,18 +764,30 @@ unsigned int avio_rb32(AVIOContext *s)
> > >  
> > >  int ff_get_line(AVIOContext *s, char *buf, int maxlen)
> > >  {
> > > -int i = 0;
> > > +return ff_get_line2(s, buf, maxlen, NULL);
> > > +}
> > > +
> > > +int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen)
> > > +{
> > > +int i = 0, j = 0;
> > >  char c;
> > >  
> > > +while (1) {
> > >  c = avio_r8(s);
> > >  if (c && i < maxlen-1)
> > >  buf[i++] = c;
> > > +if (c != '\n' && c != '\r' && c) {
> > > +j++;
> > > +} else {
> > > +break;
> > > +}
> > > +}
> > 
> > a string like "\n"
> > would have a strlen of 1
> > but readlen of 0
> > while a string like "X" would have a strlen and readlen of 1
> > 
> > is this difference intended ?
> > or maybe i misread the code
> 
> You're right, I was confused.
> 
> Updated patch in attachment, thanks.
> -- 
> FFmpeg = Frightening and Fierce Moronic Power Elected Geisha

>  aviobuf.c  |   16 +---
>  internal.h |   14 ++
>  2 files changed, 27 insertions(+), 3 deletions(-)
> ff84236587ab1ebec44e4b835a734757c59fd614  
> 0001-lavf-aviobuf-add-ff_get_line2-variant.patch
> From 54a5d3469d4d9a3f17f45e7577da6c46cb7e969e Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini 
> Date: Thu, 13 Oct 2016 16:36:30 +0200
> Subject: [PATCH] lavf/aviobuf: add ff_get_line2() variant
> 
> This allows to probe if the read line was partially discarded.
> ---
>  libavformat/aviobuf.c  | 16 +---
>  libavformat/internal.h | 14 ++
>  2 files changed, 27 insertions(+), 3 deletions(-)

LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/4] V13 - SCTE-35 support in hlsenc

2016-10-20 Thread Steven Liu
LGTM, Thanks

Carlos Fernandez Sanz 于2016年10月19日 周三下午1:47写道:

> On Sun, Oct 16, 2016 at 10:59 AM, Carlos Fernandez Sanz
>  wrote:
> >
> > All other things corrected (I think) - will send a patch soon. Thanks!
>
> I submitted V14 yesterday - can you take a look and comment and/or merge?
>
> Thanks
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] aiffdec: fix division by zero

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 08:11:19PM +0200, Andreas Cadhalpun wrote:
> On 20.10.2016 02:56, Michael Niedermayer wrote:
> > On Wed, Oct 19, 2016 at 09:18:51PM +0200, Andreas Cadhalpun wrote:
> >> This is similar to commit c143a9c.
> >>
> >> Signed-off-by: Andreas Cadhalpun 
> >> ---
> >>  libavformat/aiffdec.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > can aiff work without block_align ?
> 
> Well, it can use a fall-back value. That value can be wrong, of course.
> 
> > either way, block_duration is from the header reading
> > if its still accurate then using it together with 1 instead of the
> > matching block align is quite likely not correct
> > OTOH if block_duration does not represent the actual content then
> > the duration would only be correct by pure chance
> > 
> > Its a bit unfortunate that theres no usecase with an undamaged sample
> > which would have clear correct values
> > 
> > one has to work on the assumptation of a use case where the user needs
> > to override the codec and then ask "what is correct to do" that makes
> > this a bit tricky ...
> 
> Alternatively aiff_read_packet could just error out, if you prefer that.
> Patch doing that attached.
> 
> Best regards,
> Andreas
> 

>  aiffdec.c |5 +
>  1 file changed, 5 insertions(+)
> 2fb78e5573b52b635b5077a265a54542e054cf02  
> 0001-aiff-check-block_align-in-aiff_read_packet.patch
> From d1edb842a886de0bae6e32ac602f2fef6810081a Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Thu, 20 Oct 2016 20:08:15 +0200
> Subject: [PATCH] aiff: check block_align in aiff_read_packet
> 
> It can be unset in avcodec_parameters_from_context and a value of 0
> causes SIGFPE crashes.

LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dcstr: fix division by zero

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 08:19:00PM +0200, Andreas Cadhalpun wrote:
> On 20.10.2016 02:59, Michael Niedermayer wrote:
> > On Wed, Oct 19, 2016 at 10:41:22PM +0200, Andreas Cadhalpun wrote:
> >> Signed-off-by: Andreas Cadhalpun 
> >> ---
> >>  libavformat/dcstr.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c
> >> index 69fae41..d5d2281 100644
> >> --- a/libavformat/dcstr.c
> >> +++ b/libavformat/dcstr.c
> >> @@ -47,7 +47,7 @@ static int dcstr_read_header(AVFormatContext *s)
> >>  avio_skip(s->pb, 4);
> >>  st->duration   = avio_rl32(s->pb);
> > 
> >>  st->codecpar->channels   *= avio_rl32(s->pb);
> > 
> > This here can overflow and needs a check
> 
> Yes.
> 
> > 
> >> -if (!align || align > INT_MAX / st->codecpar->channels)
> >> +if (!align || !st->codecpar->channels || align > INT_MAX / 
> >> st->codecpar->channels)
> >>  return AVERROR_INVALIDDATA;
> > 
> > might need a <0 check too should be ok otherwise
> 
> OK. New patch attached.
> 
> Best regards,
> Andreas
> 

>  dcstr.c |8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 365ebc3a050f6754a981340e0a8df5dbf781  
> 0001-dcstr-fix-division-by-zero.patch
> From 656f4ea3f664417197a622dcf80284e890caa849 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Thu, 20 Oct 2016 20:13:54 +0200
> Subject: [PATCH] dcstr: fix division by zero
> 
> Also check for possible overflows.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavformat/dcstr.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Ticket #5897. swresample. Incorrect work of swr_set_matrix() if the SwrContext was never initialized

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 06:57:35AM +0300, v0lt r wrote:
> 
> From 55a5ec258f53fc7a4bdbea200d096bd5d46625d4 Mon Sep 17 00:00:00 2001

> From: Aleksoid1978

is this Author name intended ?
do you not want your full name in the git history for your patch ?

If you want your full name, then please resubmit the git patch with
correctly set author

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat/mxfdec: Detect field_order based on video_line_map

2016-10-20 Thread Michael Niedermayer
On Wed, Oct 19, 2016 at 02:35:20PM +0200, Tobias Rapp wrote:
> Read video_line_map from MXF generic picture essence descriptor and use
> it to derive the coded field order. Use field_dominance to derive the
> display field order from coded field order. If field_dominance is not
> available the default value "1" is used as defined in SMPTE S377-1.
> 
> Fixes field_order detection for a bunch of DV/DVCPRO files. The heuristic
> for deriving coded field order from video_line_map is inspired by
> MediaInfo.
> 
> Signed-off-by: Tobias Rapp 
> ---
>  libavformat/mxfdec.c | 75 
> +---
>  1 file changed, 60 insertions(+), 15 deletions(-)

applied

thx

8...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] cavsdec: unref frame before referencing again

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 10:16:17PM +0200, Andreas Cadhalpun wrote:
> This fixes asserts (from commit 13aae8) in av_frame_ref and
> av_frame_move_ref.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavcodec/cavsdec.c | 2 ++
>  1 file changed, 2 insertions(+)

should be ok

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mpeg12dec: unref discarded picture from extradata

2016-10-20 Thread Michael Niedermayer
On Thu, Oct 20, 2016 at 10:57:15PM +0200, Andreas Cadhalpun wrote:
> Otherwise another frame gets referenced into picture, triggering an assert
> (from commit 13aae8) in av_frame_ref.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavcodec/mpeg12dec.c | 1 +
>  1 file changed, 1 insertion(+)

should be ok

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/4] libavformat/mxfdec: export track name metadata

2016-10-20 Thread Michael Niedermayer
On Wed, Sep 21, 2016 at 01:42:06PM -0700, Mark Reid wrote:
> ---
>  libavformat/mxfdec.c | 79 
> +---
>  1 file changed, 44 insertions(+), 35 deletions(-)

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] libavformat/mxfdec: don't assume first stream index to be primary

2016-10-20 Thread Michael Niedermayer
On Wed, Sep 21, 2016 at 01:42:07PM -0700, Mark Reid wrote:
> ---
>  libavformat/mxfdec.c | 48 
>  1 file changed, 36 insertions(+), 12 deletions(-)

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/4] libavformat/mxfdec: add metadata streams for external referenced sourclips

2016-10-20 Thread Michael Niedermayer
On Wed, Sep 21, 2016 at 01:42:08PM -0700, Mark Reid wrote:
> ---
>  libavformat/mxfdec.c | 47 ---
>  1 file changed, 44 insertions(+), 3 deletions(-)

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] tests/fate: add mxf metadata streams test

2016-10-20 Thread Michael Niedermayer
On Wed, Sep 21, 2016 at 01:42:09PM -0700, Mark Reid wrote:
> ---
>  tests/fate/mxf.mak  |  6 ++
>  tests/ref/fate/mxf-metadata-source-ref1 | 13 +
>  tests/ref/fate/mxf-metadata-source-ref2 | 13 +
>  3 files changed, 32 insertions(+)
>  create mode 100644 tests/ref/fate/mxf-metadata-source-ref1
>  create mode 100644 tests/ref/fate/mxf-metadata-source-ref2

applied

do you want to help maintain mxfdec ?
if so please send a patch that adds you to MAINTAINERS for mxf(dec)

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/libvpxenc: fix -auto-alt-ref option type

2016-10-20 Thread James Zern
On Thu, Oct 20, 2016 at 8:31 AM, Kagami Hiiragi  wrote:
> vp9_cx_iface actually allows values in range [0..2].
> This fixes ticket #5894.
>
> Signed-off-by: Kagami Hiiragi 
> ---
>  libavcodec/libvpxenc.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>

This is all right in the sense that the library exposes the option. In
practice the feature was never fully developed and will cause failures
in certain hardware decoders.

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 2db87f7..bedaa70 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -615,6 +615,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  }
>  }
>
> +if (ctx->auto_alt_ref > 1 && avctx->codec_id == AV_CODEC_ID_VP8) {
> +av_log(avctx, AV_LOG_ERROR, "auto_alt_ref > 1 is forbidden for 
> libvpx-vp8\n");
> +return AVERROR(EINVAL);
> +}
> +
>  //codec control failures are currently treated only as warnings
>  av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
>  codecctl_int(avctx, VP8E_SET_CPUUSED,  ctx->cpu_used);
> @@ -1025,7 +1030,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>
>  #define COMMON_OPTIONS \
>  { "auto-alt-ref","Enable use of alternate reference " \
> - "frames (2-pass only)",   
> OFFSET(auto_alt_ref),AV_OPT_TYPE_BOOL, {.i64 = -1}, -1,  1,   
> VE}, \
> + "frames (2-pass only)",   
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
> VE}, \
>  { "lag-in-frames",   "Number of frames to look ahead for " \
>   "alternate reference frame selection",
> OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
> VE}, \
>  { "arnr-maxframes",  "altref noise reduction max frame count", 
> OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
> VE}, \
> --
> 2.7.3
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] openssl: Support version 1.1.0.

2016-10-20 Thread Matt Oliver
On 15 October 2016 at 14:22, Matt Oliver  wrote:

> ---
>  configure |   3 +-
>  libavformat/tls_openssl.c | 163 --
> 
>  2 files changed, 102 insertions(+), 64 deletions(-)
>
> diff --git a/configure b/configure
> index e014615..3a92eb3 100755
> --- a/configure
> +++ b/configure
> @@ -5816,7 +5816,8 @@ enabled omx   && { check_header
> OMX_Core.h ||
>  add_cflags
> -isystem/opt/vc/include/IL ; }
>  check_header OMX_Core.h ; } ||
> die "ERROR: OpenMAX IL headers not
> found"; }
> -enabled openssl   && { use_pkg_config openssl openssl/ssl.h
> SSL_library_init ||
> +enabled openssl   && { use_pkg_config openssl openssl/ssl.h
> OPENSSL_init_ssl ||
> +   use_pkg_config openssl openssl/ssl.h
> SSL_library_init ||
> check_lib openssl/ssl.h SSL_library_init
> -lssl -lcrypto ||
> check_lib openssl/ssl.h SSL_library_init
> -lssl32 -leay32 ||
> check_lib openssl/ssl.h SSL_library_init
> -lssl -lcrypto -lws2_32 -lgdi32 ||
> diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
> index 46eb3e6..c551ac7 100644
> --- a/libavformat/tls_openssl.c
> +++ b/libavformat/tls_openssl.c
> @@ -43,6 +43,9 @@ typedef struct TLSContext {
>  TLSShared tls_shared;
>  SSL_CTX *ctx;
>  SSL *ssl;
> +#if OPENSSL_VERSION_NUMBER >= 0x101fL
> +BIO_METHOD* url_bio_method;
> +#endif
>  } TLSContext;
>
>  #if HAVE_THREADS
> @@ -63,6 +66,87 @@ static unsigned long openssl_thread_id(void)
>  #endif
>  #endif
>
> +static int url_bio_create(BIO *b)
> +{
> +#if OPENSSL_VERSION_NUMBER >= 0x101fL
> +BIO_set_init(b, 1);
> +BIO_set_data(b, NULL);
> +BIO_set_flags(b, 0);
> +#else
> +b->init = 1;
> +b->ptr = NULL;
> +b->flags = 0;
> +#endif
> +return 1;
> +}
> +
> +static int url_bio_destroy(BIO *b)
> +{
> +return 1;
> +}
> +
> +#if OPENSSL_VERSION_NUMBER >= 0x101fL
> +#define GET_BIO_DATA(x) BIO_get_data(x);
> +#else
> +#define GET_BIO_DATA(x) (x)->ptr;
> +#endif
> +
> +static int url_bio_bread(BIO *b, char *buf, int len)
> +{
> +URLContext *h;
> +int ret;
> +h = GET_BIO_DATA(b);
> +ret = ffurl_read(h, buf, len);
> +if (ret >= 0)
> +return ret;
> +BIO_clear_retry_flags(b);
> +if (ret == AVERROR_EXIT)
> +return 0;
> +return -1;
> +}
> +
> +static int url_bio_bwrite(BIO *b, const char *buf, int len)
> +{
> +URLContext *h;
> +int ret;
> +h = GET_BIO_DATA(b);
> +ret = ffurl_write(h, buf, len);
> +if (ret >= 0)
> +return ret;
> +BIO_clear_retry_flags(b);
> +if (ret == AVERROR_EXIT)
> +return 0;
> +return -1;
> +}
> +
> +static long url_bio_ctrl(BIO *b, int cmd, long num, void *ptr)
> +{
> +if (cmd == BIO_CTRL_FLUSH) {
> +BIO_clear_retry_flags(b);
> +return 1;
> +}
> +return 0;
> +}
> +
> +static int url_bio_bputs(BIO *b, const char *str)
> +{
> +return url_bio_bwrite(b, str, strlen(str));
> +}
> +
> +#if OPENSSL_VERSION_NUMBER < 0x101fL
> +static BIO_METHOD url_bio_method = {
> +.type = BIO_TYPE_SOURCE_SINK,
> +.name = "urlprotocol bio",
> +.bwrite = url_bio_bwrite,
> +.bread = url_bio_bread,
> +.bputs = url_bio_bputs,
> +.bgets = NULL,
> +.ctrl = url_bio_ctrl,
> +.create = url_bio_create,
> +.destroy = url_bio_destroy,
> +};
> +#endif
> +
>  int ff_openssl_init(void)
>  {
>  avpriv_lock_avformat();
> @@ -128,73 +212,14 @@ static int tls_close(URLContext *h)
>  SSL_CTX_free(c->ctx);
>  if (c->tls_shared.tcp)
>  ffurl_close(c->tls_shared.tcp);
> +#if OPENSSL_VERSION_NUMBER >= 0x101fL
> +if (c->url_bio_method)
> +BIO_meth_free(c->url_bio_method);
> +#endif
>  ff_openssl_deinit();
>
>  return 0;
>  }
>
> -static int url_bio_create(BIO *b)
> -{
> -b->init = 1;
> -b->ptr = NULL;
> -b->flags = 0;
> -return 1;
> -}
> -
> -static int url_bio_destroy(BIO *b)
> -{
> -return 1;
> -}
> -
> -static int url_bio_bread(BIO *b, char *buf, int len)
> -{
> -URLContext *h = b->ptr;
> -int ret = ffurl_read(h, buf, len);
> -if (ret >= 0)
> -return ret;
> -BIO_clear_retry_flags(b);
> -if (ret == AVERROR_EXIT)
> -return 0;
> -return -1;
> -}
> -
> -static int url_bio_bwrite(BIO *b, const char *buf, int len)
> -{
> -URLContext *h = b->ptr;
> -int ret = ffurl_write(h, buf, len);
> -if (ret >= 0)
> -return ret;
> -BIO_clear_retry_flags(b);
> -if (ret == AVERROR_EXIT)
> -return 0;
> -return -1;
> -}
> -
> -static long url_bio_ctrl(BIO *b, int cmd, long num, void *ptr)
> -{
> -if (cmd == BIO_CTRL_FLUSH) {
> -BIO_clear_retry_flags(b);
> -return 1;
> -}
> -return 0;
> -}
> -

Re: [FFmpeg-devel] [PATCH] lavc/libvpxenc: fix -auto-alt-ref option type

2016-10-20 Thread James Zern
On Thu, Oct 20, 2016 at 11:51 AM, Rostislav Pehlivanov
 wrote:
> On 20 October 2016 at 16:31, Kagami Hiiragi  wrote:
>
>> vp9_cx_iface actually allows values in range [0..2].
>> This fixes ticket #5894.
>>
>> Signed-off-by: Kagami Hiiragi 
>> ---
>>  libavcodec/libvpxenc.c | 7 ++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
>> index 2db87f7..bedaa70 100644
>> --- a/libavcodec/libvpxenc.c
>> +++ b/libavcodec/libvpxenc.c
>> @@ -615,6 +615,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
>>  }
>>  }
>>
>> +if (ctx->auto_alt_ref > 1 && avctx->codec_id == AV_CODEC_ID_VP8) {
>> +av_log(avctx, AV_LOG_ERROR, "auto_alt_ref > 1 is forbidden for
>> libvpx-vp8\n");
>> +return AVERROR(EINVAL);
>> +}
>> +
>>  //codec control failures are currently treated only as warnings
>>  av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
>>  codecctl_int(avctx, VP8E_SET_CPUUSED,  ctx->cpu_used);
>> @@ -1025,7 +1030,7 @@ static int vpx_encode(AVCodecContext *avctx,
>> AVPacket *pkt,
>>
>>  #define COMMON_OPTIONS \
>>  { "auto-alt-ref","Enable use of alternate reference " \
>> - "frames (2-pass only)",
>>  OFFSET(auto_alt_ref),AV_OPT_TYPE_BOOL, {.i64 = -1}, -1,  1,
>>VE}, \
>> + "frames (2-pass only)",
>>  OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,
>>VE}, \
>>  { "lag-in-frames",   "Number of frames to look ahead for " \
>>   "alternate reference frame selection",
>> OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,
>> INT_MAX, VE}, \
>>  { "arnr-maxframes",  "altref noise reduction max frame count",
>> OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,
>> INT_MAX, VE}, \
>> --
>> 2.7.3
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> lgtm
> You could have moved the check after the tuning ifs before the alpha
> channel check but it's okay like it is, whoever commits it could do it
> anyway if they feel like it.
>

The library will report an error (treated as a warning here) which is
probably enough.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 0/3] Detect field_order based on video_line_map

2016-10-20 Thread Tobias Rapp

On 21.10.2016 00:55, Michael Niedermayer wrote:

On Wed, Oct 19, 2016 at 02:35:19PM +0200, Tobias Rapp wrote:

This patch series adds fate tests for probing MXF D10 (top field first) and
DV25 (bottom field first) file properties. Patch #2 is taken from
https://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200607.html
and has been augmented with the missing XSD update.

The fate samples can be downloaded at the following URLs wrapped into a ZIP
file and should be put into folder "$FATE_SAMPLES/mxf".




Avid-5.mxf:
http://mxf.irt.de/files/download.php?action=getFile&repository=manufacturers&id=85

Sony-1.mxf:
http://mxf.irt.de/files/download.php?action=getFile&repository=manufacturers&id=134


uploaded

thx


Forgot to mention that besides the MXF file the IRT ZIPs also contain 
some text/XML log files which now have been included in the fate samples.


In my opinion the following files can be deleted:

mxf/Avid-5.txt
mxf/Avid-5.xml
mxf/Sony-1.txt
mxf/Sony-1.xml

Regards,
Tobias

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel