[FFmpeg-cvslog] avfilter/vf_waveform: set color range for output frames

2016-03-20 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 20 10:00:53 
2016 +0100| [50f4b64c543de39b74e56ea32ecfbdcf194c217a] | committer: Paul B Mahol

avfilter/vf_waveform: set color range for output frames

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50f4b64c543de39b74e56ea32ecfbdcf194c217a
---

 libavfilter/vf_waveform.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index 82ceb6f..1ec7577 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -2616,6 +2616,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 return AVERROR(ENOMEM);
 }
 out->pts = in->pts;
+av_frame_set_color_range(out, AVCOL_RANGE_JPEG);
 
 for (k = 0; k < s->ncomp; k++) {
 if (s->bits <= 8) {

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


[FFmpeg-cvslog] ffplay: Remove "&& 0" from already disabled debug code

2016-03-20 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Mar 18 11:27:57 2016 +0100| [7916f04b89d4e970f17a14776b71b8c61c2b117d] | 
committer: Michael Niedermayer

ffplay: Remove "&& 0" from already disabled debug code

Reviewed-by: Marton Balint 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7916f04b89d4e970f17a14776b71b8c61c2b117d
---

 ffplay.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 2cfdf26..ade5159 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1716,7 +1716,7 @@ static int queue_picture(VideoState *is, AVFrame 
*src_frame, double pts, double
 {
 Frame *vp;
 
-#if defined(DEBUG_SYNC) && 0
+#if defined(DEBUG_SYNC)
 printf("frame_type=%c pts=%0.3f\n",
av_get_picture_type_char(src_frame->pict_type), pts);
 #endif

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


[FFmpeg-cvslog] configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel

2016-03-20 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Mar 16 
15:23:28 2016 +0100| [7d9e064cc13cb1b9db854c60bfff3ed3dc60ab7b] | committer: 
Hendrik Leppkes

configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel

Fixes build on mingw32, which lacks this constant.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d9e064cc13cb1b9db854c60bfff3ed3dc60ab7b
---

 configure |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 6b4ae87..e5de306 100755
--- a/configure
+++ b/configure
@@ -5695,7 +5695,7 @@ disabled securetransport || { check_func 
SecIdentityCreate "-Wl,-framework,CoreF
 enable securetransport; }
 
 disabled schannel || { check_func_headers "windows.h security.h" 
InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
-   enable schannel && add_extralibs -lsecur32; }
+   check_cpp_condition winerror.h 
"defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; 
}
 
 makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 enabled makeinfo \

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


[FFmpeg-cvslog] lavf/dv: reindent after previous commit

2016-03-20 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sun Mar 20 19:28:07 
2016 +0100| [6c0cf11f38f3306773401bf35174703cb4f12dd5] | committer: Clément 
Bœsch

lavf/dv: reindent after previous commit

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c0cf11f38f3306773401bf35174703cb4f12dd5
---

 libavformat/dv.c |   30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index b1f8759..890f124 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -285,21 +285,21 @@ static int dv_extract_video_info(DVDemuxContext *c, const 
uint8_t *frame)
 AVCodecContext *avctx;
 int apt, is16_9;
 
-avctx = c->vst->codec;
-
-avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
-c->sys->time_base.den);
-c->vst->avg_frame_rate = av_inv_q(c->vst->time_base);
-
-/* finding out SAR is a little bit messy */
-vsc_pack = dv_extract_pack(frame, dv_video_control);
-apt  = frame[4] & 0x07;
-is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
- (!apt && (vsc_pack[2] & 0x07) == 0x07)));
-c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
-avctx->bit_rate = av_rescale_q(c->sys->frame_size,
-   (AVRational) { 8, 1 },
-   c->sys->time_base);
+avctx = c->vst->codec;
+
+avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
+c->sys->time_base.den);
+c->vst->avg_frame_rate = av_inv_q(c->vst->time_base);
+
+/* finding out SAR is a little bit messy */
+vsc_pack = dv_extract_pack(frame, dv_video_control);
+apt  = frame[4] & 0x07;
+is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
+ (!apt && (vsc_pack[2] & 0x07) == 0x07)));
+c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
+avctx->bit_rate = av_rescale_q(c->sys->frame_size,
+   (AVRational) { 8, 1 },
+   c->sys->time_base);
 return c->sys->frame_size;
 }
 

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


[FFmpeg-cvslog] lavf/dv: do not check for c->sys

2016-03-20 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sun Mar 20 14:24:53 
2016 +0100| [35ba5c424bbecea632c7cce0c9cae51190478068] | committer: Clément 
Bœsch

lavf/dv: do not check for c->sys

dv_extract_video_info() is a static function called only from
avpriv_dv_produce_packet(), where c->sys is made sure to be set.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35ba5c424bbecea632c7cce0c9cae51190478068
---

 libavformat/dv.c |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 84c3061..b1f8759 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -284,9 +284,7 @@ static int dv_extract_video_info(DVDemuxContext *c, const 
uint8_t *frame)
 const uint8_t *vsc_pack;
 AVCodecContext *avctx;
 int apt, is16_9;
-int size = 0;
 
-if (c->sys) {
 avctx = c->vst->codec;
 
 avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
@@ -302,9 +300,7 @@ static int dv_extract_video_info(DVDemuxContext *c, const 
uint8_t *frame)
 avctx->bit_rate = av_rescale_q(c->sys->frame_size,
(AVRational) { 8, 1 },
c->sys->time_base);
-size = c->sys->frame_size;
-}
-return size;
+return c->sys->frame_size;
 }
 
 static int dv_extract_timecode(DVDemuxContext* c, const uint8_t* frame, char 
*tc)

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


[FFmpeg-cvslog] lavf/dv: use c->sys->frame_size in dv_frame_offset()

2016-03-20 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sun Mar 20 16:14:22 
2016 +0100| [8284a4ba11e2d8ca55e3222e5730bfa8d6cca940] | committer: Clément 
Bœsch

lavf/dv: use c->sys->frame_size in dv_frame_offset()

dv_frame_offset() is static and called only from dv_read_seek(), where
c->sys->frame_size is already used.

This simplifies the incoming codecpar merge where
avctx->{coded_width,coded_height,time_base} are not accessible anymore.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8284a4ba11e2d8ca55e3222e5730bfa8d6cca940
---

 libavformat/dv.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 890f124..b41d123 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -418,13 +418,12 @@ static int64_t dv_frame_offset(AVFormatContext *s, 
DVDemuxContext *c,
int64_t timestamp, int flags)
 {
 // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
-const AVDVProfile *sys = av_dv_codec_profile2(c->vst->codec->coded_width, 
c->vst->codec->coded_height,
-  c->vst->codec->pix_fmt, 
c->vst->codec->time_base);
+const int frame_size = c->sys->frame_size;
 int64_t offset;
 int64_t size   = avio_size(s->pb) - s->internal->data_offset;
-int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
+int64_t max_offset = ((size - 1) / frame_size) * frame_size;
 
-offset = sys->frame_size * timestamp;
+offset = frame_size * timestamp;
 
 if (size >= 0 && offset > max_offset)
 offset = max_offset;

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


[FFmpeg-cvslog] avformat/mov: read start_pad from edit list start time if codec is aac

2016-03-20 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sat Feb 20 20:09:42 
2016 +0100| [65efcaeb8467f5aff25eaf02b20dae43d5ca9dc7] | committer: Marton 
Balint

avformat/mov: read start_pad from edit list start time if codec is aac

Related to ticket #2324, #2325.

Stream duration still need to be fixed...

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65efcaeb8467f5aff25eaf02b20dae43d5ca9dc7
---

 libavformat/mov.c|3 +++
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |8 
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |8 
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4f446ba..3fa8fcc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2688,6 +2688,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
 st->codec->has_b_frames = 1;
 }
 }
+
+if (!unsupported && st->codec->codec_id == AV_CODEC_ID_AAC && 
start_time > 0)
+sc->start_pad = start_time;
 }
 
 /* only use old uncompressed audio chunk demuxing when stts specifies it */
diff --git a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac 
b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
index 564c212..aacb058 100644
--- a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
+++ b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
@@ -1,10 +1,10 @@
 [STREAM]
 index=0
-start_pts=-1024
+start_pts=0
 duration_ts=104384
 [/STREAM]
 [FORMAT]
-start_time=-0.023220
+start_time=0.00
 duration=2.367000
 [/FORMAT]
 packet|pts=-1024|dts=-1024|duration=1024
@@ -24,7 +24,6 @@ packet|pts=100352|dts=100352|duration=1024
 packet|pts=101376|dts=101376|duration=1024
 packet|pts=102400|dts=102400|duration=1984
 stream|nb_read_packets=102
-frame|pkt_pts=-1024|pkt_dts=-1024|best_effort_timestamp=-1024|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=2048|pkt_dts=2048|best_effort_timestamp=2048|pkt_duration=1024|nb_samples=1024
@@ -32,6 +31,7 @@ 
frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_
 
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=6144|pkt_dts=6144|best_effort_timestamp=6144|pkt_duration=1024|nb_samples=1024
+frame|pkt_pts=7168|pkt_dts=7168|best_effort_timestamp=7168|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=95232|pkt_dts=95232|best_effort_timestamp=95232|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=96256|pkt_dts=96256|best_effort_timestamp=96256|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=97280|pkt_dts=97280|best_effort_timestamp=97280|pkt_duration=1024|nb_samples=1024
@@ -40,4 +40,4 @@ 
frame|pkt_pts=99328|pkt_dts=99328|best_effort_timestamp=99328|pkt_duration=1024|
 
frame|pkt_pts=100352|pkt_dts=100352|best_effort_timestamp=100352|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=101376|pkt_dts=101376|best_effort_timestamp=101376|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=102400|pkt_dts=102400|best_effort_timestamp=102400|pkt_duration=1984|nb_samples=1024
-stream|nb_read_frames=102
+stream|nb_read_frames=101
diff --git a/tests/ref/fate/gaplessenc-pcm-to-mov-aac 
b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
index b71d094..05dff6e 100644
--- a/tests/ref/fate/gaplessenc-pcm-to-mov-aac
+++ b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
@@ -1,10 +1,10 @@
 [STREAM]
 index=0
-start_pts=-1024
+start_pts=0
 duration_ts=530224
 [/STREAM]
 [FORMAT]
-start_time=-0.023220
+start_time=0.00
 duration=12.024000
 [/FORMAT]
 packet|pts=-1024|dts=-1024|duration=1024
@@ -24,7 +24,6 @@ packet|pts=526336|dts=526336|duration=1024
 packet|pts=527360|dts=527360|duration=1024
 packet|pts=528384|dts=528384|duration=1840
 stream|nb_read_packets=518
-frame|pkt_pts=-1024|pkt_dts=-1024|best_effort_timestamp=-1024|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=2048|pkt_dts=2048|best_effort_timestamp=2048|pkt_duration=1024|nb_samples=1024
@@ -32,6 +31,7 @@ 
frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_
 
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=6144|pkt_dts=6144|best_effort_timestamp=6144|pkt_duration=1024|nb_samples=1024
+frame|pkt_pts=7168|pkt_dts=7168|best_effort_timestamp=7168|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=521216|pkt_dts=521216|best_effort_timestamp=521216|pkt_duration=1024|nb_samples=1024
 
frame|pkt_p

[FFmpeg-cvslog] tests/gapless: add gapless aac tests

2016-03-20 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Mon Mar  7 22:57:51 
2016 +0100| [48a96383faa0393d66d4bf755808845b6318e06f] | committer: Marton 
Balint

tests/gapless: add gapless aac tests

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48a96383faa0393d66d4bf755808845b6318e06f
---

 tests/fate-run.sh|   28 +
 tests/fate/gapless.mak   |   28 -
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |   43 ++
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |   43 ++
 tests/ref/fate/gaplessinfo-itunes1   |   43 ++
 tests/ref/fate/gaplessinfo-itunes2   |   43 ++
 6 files changed, 227 insertions(+), 1 deletion(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 16087cb..5631267 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -96,6 +96,21 @@ probeframes(){
 run ffprobe${PROGSUF} -show_frames -v 0 "$@"
 }
 
+probegaplessinfo(){
+filename="$1"
+shift
+run ffprobe${PROGSUF} -bitexact -select_streams a -show_entries 
format=start_time,duration:stream=index,start_pts,duration_ts -v 0 "$filename" 
"$@"
+pktfile1="${outdir}/${test}.pkts"
+framefile1="${outdir}/${test}.frames"
+cleanfiles="$cleanfiles $pktfile1 $framefile1"
+run ffprobe${PROGSUF} -bitexact -select_streams a -of compact 
-count_packets -show_entries packet=pts,dts,duration:stream=nb_read_packets -v 
0 "$filename" "$@" > "$pktfile1"
+head -n 8 "$pktfile1"
+tail -n 9 "$pktfile1"
+run ffprobe${PROGSUF} -bitexact -select_streams a -of compact 
-count_frames -show_entries 
frame=pkt_pts,pkt_dts,best_effort_timestamp,pkt_duration,nb_samples:stream=nb_read_frames
 -v 0 "$filename" "$@" > "$framefile1"
+head -n 8 "$framefile1"
+tail -n 9 "$framefile1"
+}
+
 ffmpeg(){
 dec_opts="-hwaccel $hwaccel -threads $threads -thread_type $thread_type"
 ffmpeg_args="-nostdin -nostats -cpuflags $cpuflags"
@@ -249,6 +264,19 @@ gapless(){
 do_md5sum $decfile3
 }
 
+gaplessenc(){
+sample=$(target_path $1)
+format=$2
+codec=$3
+
+file1="${outdir}/${test}.out-1"
+cleanfiles="$cleanfiles $file1"
+
+# test data after reencoding
+ffmpeg -i "$sample" -flags +bitexact -fflags +bitexact -map 0:a -c:a 
$codec -f $format -y "$file1"
+probegaplessinfo "$file1"
+}
+
 concat(){
 template=$1
 sample=$2
diff --git a/tests/fate/gapless.mak b/tests/fate/gapless.mak
index 2fb005f..8cae3ac 100644
--- a/tests/fate/gapless.mak
+++ b/tests/fate/gapless.mak
@@ -3,5 +3,31 @@ fate-gapless-mp3: CMD = gapless 
$(TARGET_SAMPLES)/gapless/gapless.mp3
 
 FATE_GAPLESS = $(FATE_GAPLESS-yes)
 
+FATE_GAPLESSINFO_PROBE-$(call DEMDEC, MOV, AAC) += fate-gaplessinfo-itunes1
+fate-gaplessinfo-itunes1: ffprobe$(PROGSSUF)$(EXESUF)
+fate-gaplessinfo-itunes1: CMD = probegaplessinfo 
$(TARGET_SAMPLES)/cover_art/Owner-iTunes_9.0.3.15.m4a
+
+FATE_GAPLESSINFO_PROBE-$(call DEMDEC, MOV, AAC) += fate-gaplessinfo-itunes2
+fate-gaplessinfo-itunes2: ffprobe$(PROGSSUF)$(EXESUF)
+fate-gaplessinfo-itunes2: CMD = probegaplessinfo 
$(TARGET_SAMPLES)/gapless/102400samples_qt-lc-aac.m4a
+
+FATE_GAPLESSENC_PROBE-$(call ENCDEC, AAC, MOV) += 
fate-gaplessenc-itunes-to-ipod-aac
+fate-gaplessenc-itunes-to-ipod-aac: ffprobe$(PROGSSUF)$(EXESUF)
+fate-gaplessenc-itunes-to-ipod-aac: CMD = gaplessenc 
$(TARGET_SAMPLES)/gapless/102400samples_qt-lc-aac.m4a ipod aac
+
+FATE_GAPLESSENC_PROBE-$(call ENCDEC, AAC, MOV) += 
fate-gaplessenc-pcm-to-mov-aac
+fate-gaplessenc-pcm-to-mov-aac: $(AREF)
+fate-gaplessenc-pcm-to-mov-aac: ffprobe$(PROGSSUF)$(EXESUF)
+fate-gaplessenc-pcm-to-mov-aac: CMD = gaplessenc $(AREF) mov aac
+
+FATE_GAPLESSINFO-$(CONFIG_FFPROBE) = $(FATE_GAPLESSINFO_PROBE-yes)
+FATE_GAPLESSINFO = $(FATE_GAPLESSINFO-yes)
+
+FATE_GAPLESSENC-$(CONFIG_FFPROBE) = $(FATE_GAPLESSENC_PROBE-yes)
+FATE_GAPLESSENC = $(FATE_GAPLESSENC-yes)
+
 FATE_SAMPLES_AVCONV += $(FATE_GAPLESS)
-fate-gapless: $(FATE_GAPLESS)
+FATE_SAMPLES_AVCONV += $(FATE_GAPLESSINFO)
+FATE_SAMPLES_AVCONV += $(FATE_GAPLESSENC)
+
+fate-gapless: $(FATE_GAPLESS) $(FATE_GAPLESSINFO) $(FATE_GAPLESSENC)
diff --git a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac 
b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
new file mode 100644
index 000..1d4262f
--- /dev/null
+++ b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
@@ -0,0 +1,43 @@
+[STREAM]
+index=0
+start_pts=1058
+duration_ts=104384
+[/STREAM]
+[FORMAT]
+start_time=0.023991
+duration=2.367000
+[/FORMAT]
+packet|pts=1058|dts=1058|duration=1024
+packet|pts=2082|dts=2082|duration=1024
+packet|pts=3106|dts=3106|duration=1024
+packet|pts=4130|dts=4130|duration=1024
+packet|pts=5154|dts=5154|duration=1024
+packet|pts=6178|dts=6178|duration=1024
+packet|pts=7202|dts=7202|duration=1024
+packet|pts=8226|dts=8226|duration=1024
+packet|pts=97314|dts=97314|duration=1024
+packet|pts=98338|dts=98338|duration=1024
+pack

[FFmpeg-cvslog] avformat/utils: increase detected start_time with skip_samples

2016-03-20 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sat Feb 20 22:39:07 
2016 +0100| [25f707694cd33f65979320bc0de9273c11bf547c] | committer: Marton 
Balint

avformat/utils: increase detected start_time with skip_samples

Reviewed-by: Michael Niedermayer 
Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25f707694cd33f65979320bc0de9273c11bf547c
---

 libavformat/utils.c  |   10 +++-
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |   68 +-
 tests/ref/fate/gaplessinfo-itunes1   |4 +-
 tests/ref/fate/gaplessinfo-itunes2   |4 +-
 4 files changed, 46 insertions(+), 40 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5cff3a7..5409907 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -997,16 +997,22 @@ static void update_initial_timestamps(AVFormatContext *s, 
int stream_index,
 if (is_relative(pktl_it->pkt.dts))
 pktl_it->pkt.dts += shift;
 
-if (st->start_time == AV_NOPTS_VALUE && pktl_it->pkt.pts != 
AV_NOPTS_VALUE)
+if (st->start_time == AV_NOPTS_VALUE && pktl_it->pkt.pts != 
AV_NOPTS_VALUE) {
 st->start_time = pktl_it->pkt.pts;
+if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && 
st->codec->sample_rate)
+st->start_time += av_rescale_q(st->skip_samples, 
(AVRational){1, st->codec->sample_rate}, st->time_base);
+}
 }
 
 if (has_decode_delay_been_guessed(st)) {
 update_dts_from_pts(s, stream_index, pktl);
 }
 
-if (st->start_time == AV_NOPTS_VALUE)
+if (st->start_time == AV_NOPTS_VALUE) {
 st->start_time = pts;
+if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && 
st->codec->sample_rate)
+st->start_time += av_rescale_q(st->skip_samples, (AVRational){1, 
st->codec->sample_rate}, st->time_base);
+}
 }
 
 static void update_initial_durations(AVFormatContext *s, AVStream *st,
diff --git a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac 
b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
index 1d4262f..564c212 100644
--- a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
+++ b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
@@ -1,43 +1,43 @@
 [STREAM]
 index=0
-start_pts=1058
+start_pts=-1024
 duration_ts=104384
 [/STREAM]
 [FORMAT]
-start_time=0.023991
+start_time=-0.023220
 duration=2.367000
 [/FORMAT]
-packet|pts=1058|dts=1058|duration=1024
-packet|pts=2082|dts=2082|duration=1024
-packet|pts=3106|dts=3106|duration=1024
-packet|pts=4130|dts=4130|duration=1024
-packet|pts=5154|dts=5154|duration=1024
-packet|pts=6178|dts=6178|duration=1024
-packet|pts=7202|dts=7202|duration=1024
-packet|pts=8226|dts=8226|duration=1024
-packet|pts=97314|dts=97314|duration=1024
-packet|pts=98338|dts=98338|duration=1024
-packet|pts=99362|dts=99362|duration=1024
-packet|pts=100386|dts=100386|duration=1024
-packet|pts=101410|dts=101410|duration=1024
-packet|pts=102434|dts=102434|duration=1024
-packet|pts=103458|dts=103458|duration=1024
-packet|pts=104482|dts=104482|duration=-98
+packet|pts=-1024|dts=-1024|duration=1024
+packet|pts=0|dts=0|duration=1024
+packet|pts=1024|dts=1024|duration=1024
+packet|pts=2048|dts=2048|duration=1024
+packet|pts=3072|dts=3072|duration=1024
+packet|pts=4096|dts=4096|duration=1024
+packet|pts=5120|dts=5120|duration=1024
+packet|pts=6144|dts=6144|duration=1024
+packet|pts=95232|dts=95232|duration=1024
+packet|pts=96256|dts=96256|duration=1024
+packet|pts=97280|dts=97280|duration=1024
+packet|pts=98304|dts=98304|duration=1024
+packet|pts=99328|dts=99328|duration=1024
+packet|pts=100352|dts=100352|duration=1024
+packet|pts=101376|dts=101376|duration=1024
+packet|pts=102400|dts=102400|duration=1984
 stream|nb_read_packets=102
-frame|pkt_pts=1058|pkt_dts=1058|best_effort_timestamp=1058|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=2082|pkt_dts=2082|best_effort_timestamp=2082|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=3106|pkt_dts=3106|best_effort_timestamp=3106|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=4130|pkt_dts=4130|best_effort_timestamp=4130|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=5154|pkt_dts=5154|best_effort_timestamp=5154|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=6178|pkt_dts=6178|best_effort_timestamp=6178|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=7202|pkt_dts=7202|best_effort_timestamp=7202|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=8226|pkt_dts=8226|best_effort_timestamp=8226|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=97314|pkt_dts=97314|best_effort_timestamp=97314|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=98338|pkt_dts=98338|best_effort_timestamp=98338|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=99362|pkt_dts=99362|best_effort_timestamp=99362|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=100386|pkt_dts=100386|best_effort_timestamp=100386|pkt_duration=1024|nb_samples=1024
-frame|pkt_pts=101410|pkt_dts=101410|best_effort_timestamp=101410|pkt_duration=1024|nb_samples=1024
-fra

[FFmpeg-cvslog] avfilter/vf_vectorscope: always flip output vertically

2016-03-20 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 20 21:03:43 
2016 +0100| [8f66a2da38094cf09f9b6f109bcde251e8ec7795] | committer: Paul B Mahol

avfilter/vf_vectorscope: always flip output vertically

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f66a2da38094cf09f9b6f109bcde251e8ec7795
---

 libavfilter/vf_vectorscope.c |   12 ++--
 tests/ref/fate/filter-vectorscope_color  |6 +++---
 tests/ref/fate/filter-vectorscope_color2 |6 +++---
 tests/ref/fate/filter-vectorscope_color3 |6 +++---
 tests/ref/fate/filter-vectorscope_color4 |6 +++---
 tests/ref/fate/filter-vectorscope_gray   |6 +++---
 tests/ref/fate/filter-vectorscope_xy |6 +++---
 7 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index 7d2123b..987bc66 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -911,7 +911,7 @@ static void draw_htext(AVFrame *out, int x, int y, float 
o1, float o2, const cha
 int v = color[plane];
 
 uint8_t *p = out->data[plane] + y * out->linesize[plane] + (x + i 
* 8);
-for (char_y = 0; char_y < font_height; char_y++) {
+for (char_y = font_height - 1; char_y >= 0; char_y--) {
 for (mask = 0x80; mask; mask >>= 1) {
 if (font[txt[i] * font_height + char_y] & mask)
 p[0] = p[0] * o2 + v * o1;
@@ -937,7 +937,7 @@ static void draw_htext16(AVFrame *out, int x, int y, float 
o1, float o2, const c
 int v = color[plane];
 
 uint16_t *p = (uint16_t *)(out->data[plane] + y * 
out->linesize[plane]) + (x + i * 8);
-for (char_y = 0; char_y < font_height; char_y++) {
+for (char_y = font_height - 1; char_y >= 0; char_y--) {
 for (mask = 0x80; mask; mask >>= 1) {
 if (font[txt[i] * font_height + char_y] & mask)
 p[0] = p[0] * o2 + v * o1;
@@ -1207,6 +1207,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 VectorscopeContext *s = ctx->priv;
 AVFilterLink *outlink = ctx->outputs[0];
 AVFrame *out;
+int plane;
 
 if (s->colorspace) {
 s->cs = (s->depth - 8) * 2 + s->colorspace - 1;
@@ -1232,6 +1233,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*in)
 s->vectorscope(s, in, out, s->pd);
 s->graticulef(s, out, s->x, s->y, s->pd, s->cs);
 
+for (plane = 0; plane < 4; plane++) {
+if (out->data[plane]) {
+out->data[plane]+= (s->size - 1) * out->linesize[plane];
+out->linesize[plane] = -out->linesize[plane];
+}
+}
+
 av_frame_free(&in);
 return ff_filter_frame(outlink, out);
 }
diff --git a/tests/ref/fate/filter-vectorscope_color 
b/tests/ref/fate/filter-vectorscope_color
index 3d184f6..780c330 100644
--- a/tests/ref/fate/filter-vectorscope_color
+++ b/tests/ref/fate/filter-vectorscope_color
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,  0,  0,1,   196608, 0x1890aa30
-0,  1,  1,1,   196608, 0xa490acf9
-0,  2,  2,1,   196608, 0x404a775d
+0,  0,  0,1,   196608, 0xf6e3aa30
+0,  1,  1,1,   196608, 0x5584acf9
+0,  2,  2,1,   196608, 0xa862775d
diff --git a/tests/ref/fate/filter-vectorscope_color2 
b/tests/ref/fate/filter-vectorscope_color2
index be69443..417c3e0 100644
--- a/tests/ref/fate/filter-vectorscope_color2
+++ b/tests/ref/fate/filter-vectorscope_color2
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,  0,  0,1,   196608, 0x9bfcfae5
-0,  1,  1,1,   196608, 0x1ac6fcbf
-0,  2,  2,1,   196608, 0x31cb1088
+0,  0,  0,1,   196608, 0x5e62fae5
+0,  1,  1,1,   196608, 0x4c27fcbf
+0,  2,  2,1,   196608, 0xb7531088
diff --git a/tests/ref/fate/filter-vectorscope_color3 
b/tests/ref/fate/filter-vectorscope_color3
index f297efd..26831cf 100644
--- a/tests/ref/fate/filter-vectorscope_color3
+++ b/tests/ref/fate/filter-vectorscope_color3
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,  0,  0,1,   196608, 0x6e698770
-0,  1,  1,1,   196608, 0x374d74a7
-0,  2,  2,1,   196608, 0x3d817143
+0,  0,  0,1,   196608, 0x83df8770
+0,  1,  1,1,   196608, 0xa6a674a7
+0,  2,  2,1,   196608, 0x11757143
diff --git a/tests/ref/fate/filter-vectorscope_color4 
b/tests/ref/fate/filter-vectorscope_color4
index 5ede41f..6bdfd5f 100644
--- a/tests/ref/fate/filter-vectorscope_color4
+++ b/tests/ref/fate/filter-vectorscope_color4
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,  0,  0,1,   196608, 0x4d2e53c4
-0,  1,  1,1,   196608, 0x795e1dcc
-0,  

[FFmpeg-cvslog] lavf/matroskaenc.c: add early support for colour elements

2016-03-20 Thread Neil Birkbeck
ffmpeg | branch: master | Neil Birkbeck  | Mon Mar  7 
14:42:47 2016 -0800| [e7e5c5e6c4d7e85531bd90a84cbd35c3d84f0453] | committer: 
Michael Niedermayer

lavf/matroskaenc.c: add early support for colour elements

Adding early support for a subset of the proposed colour elements
according to the latest version of spec:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=hIKLhMdgTMTEwUTeA4ct38h0tmE

Like matroskadec, I've left out elements for pix_fmt related things
 as there still seems to be some discussion around these.

The new elements are exposed under strict experimental mode.

Signed-off-by: Neil Birkbeck 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e7e5c5e6c4d7e85531bd90a84cbd35c3d84f0453
---

 libavformat/matroskaenc.c |   63 -
 1 file changed, 62 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 6ad9aed..0546686 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -41,6 +41,7 @@
 #include "libavutil/intfloat.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/lfg.h"
+#include "libavutil/mastering_display_metadata.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/random_seed.h"
@@ -730,6 +731,64 @@ static int mkv_write_codecprivate(AVFormatContext *s, 
AVIOContext *pb,
 return ret;
 }
 
+static int mkv_write_video_color(AVIOContext *pb, AVCodecContext *codec, 
AVStream *st) {
+int side_data_size = 0;
+const uint8_t *side_data = av_stream_get_side_data(
+st, AV_PKT_DATA_MASTERING_DISPLAY_METADATA, &side_data_size);
+ebml_master colorinfo = start_ebml_master(pb, MATROSKA_ID_VIDEOCOLOR, 0);
+
+if (codec->color_trc != AVCOL_TRC_UNSPECIFIED &&
+codec->color_trc < AVCOL_TRC_NB) {
+put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS,
+  codec->color_trc);
+}
+if (codec->colorspace != AVCOL_SPC_UNSPECIFIED &&
+codec->colorspace < AVCOL_SPC_NB) {
+put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, 
codec->colorspace);
+}
+if (codec->color_primaries != AVCOL_PRI_UNSPECIFIED &&
+codec->color_primaries < AVCOL_PRI_NB) {
+put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORPRIMARIES, 
codec->color_primaries);
+}
+if (codec->color_range != AVCOL_RANGE_UNSPECIFIED &&
+codec->color_range < AVCOL_RANGE_NB) {
+put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORRANGE, codec->color_range);
+}
+if (side_data_size == sizeof(AVMasteringDisplayMetadata)) {
+ebml_master meta_element = start_ebml_master(
+pb, MATROSKA_ID_VIDEOCOLORMASTERINGMETA, 0);
+const AVMasteringDisplayMetadata *metadata =
+(const AVMasteringDisplayMetadata*)side_data;
+if (metadata->has_primaries) {
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_RX,
+   av_q2d(metadata->display_primaries[0][0]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_RY,
+   av_q2d(metadata->display_primaries[0][1]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_GX,
+   av_q2d(metadata->display_primaries[1][0]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_GY,
+   av_q2d(metadata->display_primaries[1][1]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_BX,
+   av_q2d(metadata->display_primaries[2][0]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_BY,
+   av_q2d(metadata->display_primaries[2][1]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_WHITEX,
+   av_q2d(metadata->white_point[0]));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_WHITEY,
+   av_q2d(metadata->white_point[1]));
+}
+if (metadata->has_luminance) {
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX,
+   av_q2d(metadata->max_luminance));
+put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN,
+   av_q2d(metadata->min_luminance));
+}
+end_ebml_master(pb, meta_element);
+}
+end_ebml_master(pb, colorinfo);
+return 0;
+}
+
 
 static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb,
  AVStream *st, int mode, int *h_width, int 
*h_height)
@@ -1019,7 +1078,9 @@ static int mkv_write_track(AVFormatContext *s, 
MatroskaMuxContext *mkv,
 uint32_t color_space = av_le2ne32(codec->codec_tag);
 put_ebml_binary(pb, MATROSKA_ID_VIDEOCOLORSPACE, &color_space, 
sizeof(color_space));
 }
-
+if (s->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
+mkv_write_video_color(pb, codec, st);
+}
 end_ebml_master(pb, subinfo);