[FFmpeg-cvslog] Merge commit '390b95b88b2b896b63f257f69e434dfc0111e076'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:16:54 2016 +0100| [9e1ddc08208d7b484d5d97d4e169c75b91e3ff21] | committer: 
Hendrik Leppkes

Merge commit '390b95b88b2b896b63f257f69e434dfc0111e076'

* commit '390b95b88b2b896b63f257f69e434dfc0111e076':
  fate: Add a mixed NAL coding sample

Merged-by: Hendrik Leppkes 

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

 tests/fate/h264.mak  |  5 +
 tests/ref/fate/h264-mixed-nal-coding | 10 ++
 2 files changed, 15 insertions(+)

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index 7681943..c366d86 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -206,6 +206,10 @@ FATE_H264-$(call DEMDEC,  MOV, H264) += 
fate-h264-interlace-crop
 # by using a previous ref frame instead of a missing one
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-invalid-ref-mod
 
+# this sample gives an explicit size for a single NAL unit, but contains
+# several NAL units
+FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-mixed-nal-coding
+
 # this sample has invalid extradata that is not escaped
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-unescaped-extradata
 
@@ -423,6 +427,7 @@ fate-h264-skip-nokey: CMD = 
framecrc -skip_frame nok
 fate-h264-skip-nointra:   CMD = framecrc -skip_frame 
nointra -i $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts
 fate-h264-invalid-ref-mod:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/h264refframeregression.mp4 -an -frames 10 -pix_fmt 
yuv420p10le
 fate-h264-lossless:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/lossless.h264
+fate-h264-mixed-nal-coding:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/mixed-nal-coding.mp4
 fate-h264-unescaped-extradata:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/unescaped_extradata.mp4 -an -frames 10
 fate-h264-3386:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/bbc2.sample.h264
 
diff --git a/tests/ref/fate/h264-mixed-nal-coding 
b/tests/ref/fate/h264-mixed-nal-coding
new file mode 100644
index 000..24b6b4c
--- /dev/null
+++ b/tests/ref/fate/h264-mixed-nal-coding
@@ -0,0 +1,10 @@
+#tb 0: 1001/3
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 720x480
+#sar 0: 40/33
+0,  0,  0,1,   518400, 0x8f882e4d
+0,  1,  1,1,   518400, 0xc5694144
+0,  2,  2,1,   518400, 0xcf0e9e3a
+0,  3,  3,1,   518400, 0xf620e459
+0,  4,  4,1,   518400, 0x4566453e


==

diff --cc tests/fate/h264.mak
index 7681943,bbce95d..c366d86
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@@ -241,191 -220,171 +245,192 @@@ fate-h264-conformance-caba2_sva_b
  fate-h264-conformance-caba3_sony_c:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_Sony_C.jsv
  fate-h264-conformance-caba3_sva_b:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_SVA_B.264
  fate-h264-conformance-caba3_toshiba_e:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264
 -fate-h264-conformance-cabac_mot_fld0_full:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_fld0_full.26l
 -fate-h264-conformance-cabac_mot_frm0_full:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_frm0_full.26l
 -fate-h264-conformance-cabac_mot_mbaff0_full:  CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_mbaff0_full.26l
 -fate-h264-conformance-cabac_mot_picaff0_full: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_picaff0_full.26l
 -fate-h264-conformance-cabaci3_sony_b: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABACI3_Sony_B.jsv
 -fate-h264-conformance-cabast3_sony_e: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABAST3_Sony_E.jsv
 -fate-h264-conformance-cabastbr3_sony_b:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABASTBR3_Sony_B.jsv
 -fate-h264-conformance-cabref3_sand_d: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABREF3_Sand_D.264
 -fate-h264-conformance-cacqp3_sony_d:  CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CACQP3_Sony_D.jsv
 -fate-h264-conformance-cafi1_sva_c:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CAFI1_SVA_C.264
 -fate-h264-conformance-cama1_sony_c:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CAMA1_Sony_C.jsv
 -fate-h264-conformance-cama1_toshiba_b:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CAMA1_TOSHIBA_B.264
 -fate-h264-conformance-cama1_vtc_c:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/cama1_vtc_c.avc
 -fate-h264-conformance-cama2_vtc_b:  

[FFmpeg-cvslog] fate: Add a mixed NAL coding sample

2016-11-18 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Jul 11 16:36:20 2016 -0400| [390b95b88b2b896b63f257f69e434dfc0111e076] | 
committer: Vittorio Giovara

fate: Add a mixed NAL coding sample

See 17c99b6158f2c6720af74e81ee727ee50d2e7e96.

Signed-off-by: Vittorio Giovara 

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

 tests/fate/h264.mak  | 5 +
 tests/ref/fate/h264-mixed-nal-coding | 6 ++
 2 files changed, 11 insertions(+)

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index 29ef25c..bbce95d 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -190,6 +190,10 @@ FATE_H264-$(call DEMDEC,  MOV, H264) += 
fate-h264-interlace-crop
 # by using a previous ref frame instead of a missing one
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-invalid-ref-mod
 
+# this sample gives an explicit size for a single NAL unit, but contains
+# several NAL units
+FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-mixed-nal-coding
+
 # this sample has invalid extradata that is not escaped
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-unescaped-extradata
 
@@ -380,6 +384,7 @@ fate-h264-extreme-plane-pred: CMD = 
framemd5 -i $(TARGET_SAM
 fate-h264-interlace-crop: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
 fate-h264-invalid-ref-mod:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/h264refframeregression.mp4 -an -frames 10 -pix_fmt 
yuv420p10le
 fate-h264-lossless:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/lossless.h264
+fate-h264-mixed-nal-coding:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/mixed-nal-coding.mp4
 fate-h264-unescaped-extradata:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/unescaped_extradata.mp4 -an -frames 10
 
 fate-h264-reinit-%:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/$(@:fate-h264-%=%).h264 -vf 
format=yuv444p10le,scale=w=352:h=288
diff --git a/tests/ref/fate/h264-mixed-nal-coding 
b/tests/ref/fate/h264-mixed-nal-coding
new file mode 100644
index 000..6bebce6
--- /dev/null
+++ b/tests/ref/fate/h264-mixed-nal-coding
@@ -0,0 +1,6 @@
+#tb 0: 1/3
+0,  0,  0,0,   518400, 0x8f882e4d
+0,   1001,   1001,0,   518400, 0xc5694144
+0,   2002,   2002,0,   518400, 0xcf0e9e3a
+0,   3003,   3003,0,   518400, 0xf620e459
+0,   4004,   4004,0,   518400, 0x4566453e

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


[FFmpeg-cvslog] lavd: Drop unneeded av_init_packet()s

2016-11-18 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Wed 
Jul 13 11:41:35 2016 -0400| [0b1bd1b2057d41fd0ccba7317911c484a50f9207] | 
committer: Vittorio Giovara

lavd: Drop unneeded av_init_packet()s

The input packet is already unref'd by the calling function.

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

 libavdevice/v4l2.c| 1 -
 libavdevice/x11grab.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 74fec51..47241e4 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -861,7 +861,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 int res;
 
-av_init_packet(pkt);
 if ((res = mmap_read_frame(s1, pkt)) < 0) {
 return res;
 }
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index da2bfa0..60e2560 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -511,7 +511,6 @@ static int x11grab_read_packet(AVFormatContext *s1, 
AVPacket *pkt)
 nanosleep(&ts, NULL);
 }
 
-av_init_packet(pkt);
 pkt->data = image->data;
 pkt->size = s->frame_size;
 pkt->pts  = curtime;

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


[FFmpeg-cvslog] Merge commit '0b1bd1b2057d41fd0ccba7317911c484a50f9207'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:20:14 2016 +0100| [d7d6f9c78272949b8b13a52eaa850f0d63842fcf] | committer: 
Hendrik Leppkes

Merge commit '0b1bd1b2057d41fd0ccba7317911c484a50f9207'

* commit '0b1bd1b2057d41fd0ccba7317911c484a50f9207':
  lavd: Drop unneeded av_init_packet()s

Merged-by: Hendrik Leppkes 

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

 libavdevice/v4l2.c| 1 -
 libavdevice/x11grab.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index ddf331d..ae51d83 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -979,7 +979,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 int res;
 
-av_init_packet(pkt);
 if ((res = mmap_read_frame(ctx, pkt)) < 0) {
 return res;
 }
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 5c8cfc1..65b409f 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -544,7 +544,6 @@ static int x11grab_read_packet(AVFormatContext *s1, 
AVPacket *pkt)
   s->time_frame += INT64_C(100);
 } while ((s->time_frame * av_q2d(s->time_base) - curtime) <= 0);
 
-av_init_packet(pkt);
 pkt->data = image->data;
 pkt->size = s->frame_size;
 pkt->pts  = curtime;


==

diff --cc libavdevice/v4l2.c
index ddf331d,47241e4..ae51d83
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@@ -979,8 -861,7 +979,7 @@@ FF_ENABLE_DEPRECATION_WARNING
  #endif
  int res;
  
- av_init_packet(pkt);
 -if ((res = mmap_read_frame(s1, pkt)) < 0) {
 +if ((res = mmap_read_frame(ctx, pkt)) < 0) {
  return res;
  }
  
diff --cc libavdevice/x11grab.c
index 5c8cfc1,60e2560..65b409f
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@@ -539,12 -511,6 +539,11 @@@ static int x11grab_read_packet(AVFormat
  nanosleep(&ts, NULL);
  }
  
 +/* Calculate the time of the next frame */
 +do {
 +  s->time_frame += INT64_C(100);
 +} while ((s->time_frame * av_q2d(s->time_base) - curtime) <= 0);
 +
- av_init_packet(pkt);
  pkt->data = image->data;
  pkt->size = s->frame_size;
  pkt->pts  = curtime;

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


[FFmpeg-cvslog] mov: fix stream extradata_size allocation

2016-11-18 Thread Matthieu Bouron
ffmpeg | branch: master | Matthieu Bouron  | Fri 
Jul 15 10:00:34 2016 +0200| [61cb9fac47498a38dfe7623f66aa1f3696e9158c] | 
committer: Martin Storsjö

mov: fix stream extradata_size allocation

Signed-off-by: Martin Storsjö 

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

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0cb3271..14be96e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1900,7 +1900,7 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return AVERROR(ENOMEM);
 
 sc->stsd_count = entries;
-sc->extradata_size = av_mallocz_array(sc->stsd_count, 
sizeof(sc->extradata_size));
+sc->extradata_size = av_mallocz_array(sc->stsd_count, 
sizeof(*sc->extradata_size));
 if (!sc->extradata_size)
 return AVERROR(ENOMEM);
 

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


[FFmpeg-cvslog] Merge commit 'd0b1e6049b06eeeeca146ece4d2f199c5dba1565'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:44:37 2016 +0100| [6fb07c7d85c0d0464e5bdaaad55cc2b774468b3d] | committer: 
Hendrik Leppkes

Merge commit 'd0b1e6049b06ca146ece4d2f199c5dba1565'

* commit 'd0b1e6049b06ca146ece4d2f199c5dba1565':
  libopenh264dec: Fix cleanup if the init failed early

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] libopenh264dec: Fix cleanup if the init failed early

2016-11-18 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu Jul 14 
22:03:16 2016 +0300| [d0b1e6049b06ca146ece4d2f199c5dba1565] | committer: 
Martin Storsjö

libopenh264dec: Fix cleanup if the init failed early

Signed-off-by: Martin Storsjö 

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

 libavcodec/libopenh264dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index cdbea7b..a105fa5 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -48,7 +48,7 @@ static av_cold int svc_decode_close(AVCodecContext *avctx)
 if (s->decoder)
 WelsDestroyDecoder(s->decoder);
 
-while (av_fifo_size(s->packet_fifo) >= sizeof(pkt)) {
+while (s->packet_fifo && av_fifo_size(s->packet_fifo) >= sizeof(pkt)) {
 av_fifo_generic_read(s->packet_fifo, &pkt, sizeof(pkt), NULL);
 av_packet_unref(&pkt);
 }

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


[FFmpeg-cvslog] Merge commit '61cb9fac47498a38dfe7623f66aa1f3696e9158c'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:44:21 2016 +0100| [8a91452e83e763dc38d84912fe7978acede2c039] | committer: 
Hendrik Leppkes

Merge commit '61cb9fac47498a38dfe7623f66aa1f3696e9158c'

* commit '61cb9fac47498a38dfe7623f66aa1f3696e9158c':
  mov: fix stream extradata_size allocation

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set

2016-11-18 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu Jul 14 
22:20:25 2016 +0300| [36b380dcd52ef47d7ba0559ed51192c88d82a9bd] | committer: 
Martin Storsjö

libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set

Signed-off-by: Martin Storsjö 

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

 libavcodec/libopenh264dec.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index a105fa5..cc18f24 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -72,15 +72,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
 return err;
 
 s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
-if (!s->packet_fifo) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!s->packet_fifo)
+return AVERROR(ENOMEM);
 
 if (WelsCreateDecoder(&s->decoder)) {
 av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
-err = AVERROR_UNKNOWN;
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 // Pass all libopenh264 messages to our callback, to allow ourselves to 
filter them.
@@ -98,14 +95,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
 
 if ((*s->decoder)->Initialize(s->decoder, ¶m) != cmResultSuccess) {
 av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
-err = AVERROR_UNKNOWN;
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
 
-fail:
-return err;
+return 0;
 }
 
 static int init_bsf(AVCodecContext *avctx)

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


[FFmpeg-cvslog] Merge commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:45:08 2016 +0100| [0bd76401d1666bf8f0a67946d761ed9ba4751e49] | committer: 
Hendrik Leppkes

Merge commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd'

* commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd':
  libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being 
set

Merged-by: Hendrik Leppkes 

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

 libavcodec/libopenh264dec.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index ab0a84c..26cc8db 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -72,15 +72,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
 return err;
 
 s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
-if (!s->packet_fifo) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!s->packet_fifo)
+return AVERROR(ENOMEM);
 
 if (WelsCreateDecoder(&s->decoder)) {
 av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
-err = AVERROR_UNKNOWN;
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 // Pass all libopenh264 messages to our callback, to allow ourselves to 
filter them.
@@ -98,14 +95,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
 
 if ((*s->decoder)->Initialize(s->decoder, ¶m) != cmResultSuccess) {
 av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
-err = AVERROR_UNKNOWN;
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
 
-fail:
-return err;
+return 0;
 }
 
 static int init_bsf(AVCodecContext *avctx)


==


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


[FFmpeg-cvslog] Merge commit '2d097c16b833c532ac974a7f1fd05c0a1f3b7675'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:46:02 2016 +0100| [7e9474ca47fd4d267bdafcc8162fded67f6410e5] | committer: 
Hendrik Leppkes

Merge commit '2d097c16b833c532ac974a7f1fd05c0a1f3b7675'

* commit '2d097c16b833c532ac974a7f1fd05c0a1f3b7675':
  libopenh264enc: Return a more sensible error code in some init failure paths

Merged-by: Hendrik Leppkes 

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

 libavcodec/libopenh264enc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 14afe90..91f26d0 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -167,6 +167,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 av_log(avctx, AV_LOG_ERROR,
"Invalid combination -slices %d and -max_nal_size %d.\n",
avctx->slices, s->max_nal_size);
+err = AVERROR(EINVAL);
 goto fail;
 }
 
@@ -195,6 +196,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 } else {
 av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn\n");
+err = AVERROR(EINVAL);
 goto fail;
 }
 }


==


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


[FFmpeg-cvslog] libopenh264enc: Return a more sensible error code in some init failure paths

2016-11-18 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu Jul 14 
22:21:50 2016 +0300| [2d097c16b833c532ac974a7f1fd05c0a1f3b7675] | committer: 
Martin Storsjö

libopenh264enc: Return a more sensible error code in some init failure paths

Previously they returned the default AVERROR_UNKNOWN.

Signed-off-by: Martin Storsjö 

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

 libavcodec/libopenh264enc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 8ef23f1..bf1cf25 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -167,6 +167,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 av_log(avctx, AV_LOG_ERROR,
"Invalid combination -slices %d and -max_nal_size %d.\n",
avctx->slices, s->max_nal_size);
+err = AVERROR(EINVAL);
 goto fail;
 }
 
@@ -195,6 +196,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 } else {
 av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn\n");
+err = AVERROR(EINVAL);
 goto fail;
 }
 }

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


[FFmpeg-cvslog] Merge commit '7a76371437f9562c3414f985523f883489e3936a'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:47:08 2016 +0100| [07502e473f0c28fdb781954d5ca1aca5f039179a] | committer: 
Hendrik Leppkes

Merge commit '7a76371437f9562c3414f985523f883489e3936a'

* commit '7a76371437f9562c3414f985523f883489e3936a':
  libopenh264enc: Simplify init by setting FF_CODEC_CAP_INIT_CLEANUP

Merged-by: Hendrik Leppkes 

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

 libavcodec/libopenh264enc.c | 27 ---
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 91f26d0..648f59b 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -100,8 +100,6 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
 
 if ((err = ff_libopenh264_check_version(avctx)) < 0)
 return err;
-// Use a default error for multiple error paths below
-err = AVERROR_UNKNOWN;
 
 if (WelsCreateSVCEncoder(&s->encoder)) {
 av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n");
@@ -167,8 +165,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 av_log(avctx, AV_LOG_ERROR,
"Invalid combination -slices %d and -max_nal_size %d.\n",
avctx->slices, s->max_nal_size);
-err = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 
 if (avctx->slices > 1)
@@ -196,14 +193,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
 } else {
 av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn\n");
-err = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 }
 
 if ((*s->encoder)->InitializeExt(s->encoder, ¶m) != cmResultSuccess) {
 av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
@@ -213,27 +209,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
 for (i = 0; i < fbi.sLayerInfo[0].iNalCount; i++)
 size += fbi.sLayerInfo[0].pNalLengthInByte[i];
 avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
-if (!avctx->extradata) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!avctx->extradata)
+return AVERROR(ENOMEM);
 avctx->extradata_size = size;
 memcpy(avctx->extradata, fbi.sLayerInfo[0].pBsBuf, size);
 }
 
 props = ff_add_cpb_side_data(avctx);
-if (!props) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!props)
+return AVERROR(ENOMEM);
 props->max_bitrate = param.iMaxBitrate;
 props->avg_bitrate = param.iTargetBitrate;
 
 return 0;
-
-fail:
-svc_encode_close(avctx);
-return err;
 }
 
 static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
@@ -306,6 +294,7 @@ AVCodec ff_libopenh264_encoder = {
 .encode2= svc_encode_frame,
 .close  = svc_encode_close,
 .capabilities   = AV_CODEC_CAP_AUTO_THREADS,
+.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 .pix_fmts   = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_NONE },
 .priv_class = &class,


==


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


[FFmpeg-cvslog] libopenh264enc: Simplify init by setting FF_CODEC_CAP_INIT_CLEANUP

2016-11-18 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu Jul 14 
22:24:55 2016 +0300| [7a76371437f9562c3414f985523f883489e3936a] | committer: 
Martin Storsjö

libopenh264enc: Simplify init by setting FF_CODEC_CAP_INIT_CLEANUP

Also set FF_CODEC_CAP_INIT_THREADSAFE while adding internal capabilities.

Signed-off-by: Martin Storsjö 

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

 libavcodec/libopenh264enc.c | 27 ---
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index bf1cf25..a09b7cf 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -100,8 +100,6 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
 
 if ((err = ff_libopenh264_check_version(avctx)) < 0)
 return err;
-// Use a default error for multiple error paths below
-err = AVERROR_UNKNOWN;
 
 if (WelsCreateSVCEncoder(&s->encoder)) {
 av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n");
@@ -167,8 +165,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 av_log(avctx, AV_LOG_ERROR,
"Invalid combination -slices %d and -max_nal_size %d.\n",
avctx->slices, s->max_nal_size);
-err = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 
 if (avctx->slices > 1)
@@ -196,14 +193,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
 } else {
 av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn\n");
-err = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 }
 
 if ((*s->encoder)->InitializeExt(s->encoder, ¶m) != cmResultSuccess) {
 av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
-goto fail;
+return AVERROR_UNKNOWN;
 }
 
 if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
@@ -213,27 +209,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
 for (i = 0; i < fbi.sLayerInfo[0].iNalCount; i++)
 size += fbi.sLayerInfo[0].pNalLengthInByte[i];
 avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
-if (!avctx->extradata) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!avctx->extradata)
+return AVERROR(ENOMEM);
 avctx->extradata_size = size;
 memcpy(avctx->extradata, fbi.sLayerInfo[0].pBsBuf, size);
 }
 
 props = ff_add_cpb_side_data(avctx);
-if (!props) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+if (!props)
+return AVERROR(ENOMEM);
 props->max_bitrate = param.iMaxBitrate;
 props->avg_bitrate = param.iTargetBitrate;
 
 return 0;
-
-fail:
-svc_encode_close(avctx);
-return err;
 }
 
 static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
@@ -306,6 +294,7 @@ AVCodec ff_libopenh264_encoder = {
 .encode2= svc_encode_frame,
 .close  = svc_encode_close,
 .capabilities   = AV_CODEC_CAP_AUTO_THREADS,
+.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 .pix_fmts   = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_NONE },
 .priv_class = &class,

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


[FFmpeg-cvslog] mp3dec: read the initial/trailing padding from the LAME tag

2016-11-18 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri Jul  1 
10:44:41 2016 +0200| [d60c2d5216930ef98c7d4d6837d6229b37e0dcb3] | committer: 
Anton Khirnov

mp3dec: read the initial/trailing padding from the LAME tag

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

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

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 0838962..e282218 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -143,7 +143,7 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream 
*st,
 #define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
 
 uint16_t crc;
-uint32_t v;
+uint32_t v, delays;
 
 char version[10];
 
@@ -215,7 +215,9 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream 
*st,
 avio_r8(s->pb);
 
 /* Encoder delays */
-avio_rb24(s->pb);
+delays = avio_rb24(s->pb);
+st->codecpar->initial_padding  = delays >> 12;
+st->codecpar->trailing_padding = delays & ((1 << 12) - 1);
 
 /* Misc */
 avio_r8(s->pb);

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


[FFmpeg-cvslog] Merge commit '46278ec90ac5ad1dab5e85991f176afe49003fee'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:48:40 2016 +0100| [5e78126bbdd58ae4dd97e2b604cbbec336f8bc32] | committer: 
Hendrik Leppkes

Merge commit '46278ec90ac5ad1dab5e85991f176afe49003fee'

* commit '46278ec90ac5ad1dab5e85991f176afe49003fee':
  mp3enc: write trailing padding

Noop, we have our own implementation for mp3 gapless.

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] mp3enc: write trailing padding

2016-11-18 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri Jul  1 
10:49:33 2016 +0200| [46278ec90ac5ad1dab5e85991f176afe49003fee] | committer: 
Anton Khirnov

mp3enc: write trailing padding

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

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

diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index a62c7f6..1e2ff1a 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -245,11 +245,12 @@ static void mp3_write_xing(AVFormatContext *s)
 avio_w8(dyn_ctx, 0);  // unknown abr/minimal bitrate
 
 // encoder delay
-if (par->initial_padding >= 1 << 12) {
-av_log(s, AV_LOG_WARNING, "Too many samples of initial padding.\n");
+if (par->initial_padding >= 1 << 12 ||
+par->trailing_padding >= 1 << 12) {
+av_log(s, AV_LOG_WARNING, "Too many samples of padding.\n");
 avio_wb24(dyn_ctx, 0);
 } else {
-avio_wb24(dyn_ctx, par->initial_padding << 12);
+avio_wb24(dyn_ctx, par->initial_padding << 12 | par->trailing_padding);
 }
 
 avio_w8(dyn_ctx,   0); // misc

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


[FFmpeg-cvslog] Merge commit 'd60c2d5216930ef98c7d4d6837d6229b37e0dcb3'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
10:48:04 2016 +0100| [f4c3aa7ade13cd3e52366ffc8801a55588027aeb] | committer: 
Hendrik Leppkes

Merge commit 'd60c2d5216930ef98c7d4d6837d6229b37e0dcb3'

* commit 'd60c2d5216930ef98c7d4d6837d6229b37e0dcb3':
  mp3dec: read the initial/trailing padding from the LAME tag

Noop, we have our own implementation for mp3 gapless tags.

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] Merge commit '8d07e941b04d63fc4443dd986e3dc7b69cdcca43'

2016-11-18 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 18 
11:32:10 2016 +0100| [127cc6dd3d0b8ce8875aecacc5c2aaf45bf52243] | committer: 
Hendrik Leppkes

Merge commit '8d07e941b04d63fc4443dd986e3dc7b69cdcca43'

* commit '8d07e941b04d63fc4443dd986e3dc7b69cdcca43':
  FATE: add a test of H.264 SEI recovery in an intra refresh stream

Our H264 decoder drops 3 frames from the beginning of the stream, but
all frames after those match, hence the difference in the fate test.

Merged-by: Hendrik Leppkes 

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

 tests/fate/h264.mak|  2 ++
 tests/ref/fate/h264-intra-refresh-recovery | 15 +++
 2 files changed, 17 insertions(+)

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index c366d86..718a3a8 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -191,6 +191,7 @@ FATE_H264_REINIT_TESTS := large_420_8-to-small_420_8
\
 FATE_H264  := $(FATE_H264:%=fate-h264-conformance-%)\
   $(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)\
   fate-h264-extreme-plane-pred  \
+  fate-h264-intra-refresh-recovery  \
   fate-h264-lossless\
   fate-h264-3386\
 
@@ -425,6 +426,7 @@ fate-h264-xavc-4389:  CMD = 
framecrc -i $(TARGET_SAM
 fate-h264-attachment-631: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/attachment631-small.mp4 -an -max_error_rate 0.95
 fate-h264-skip-nokey: CMD = framecrc -skip_frame 
nokey -i $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts
 fate-h264-skip-nointra:   CMD = framecrc -skip_frame 
nointra -i $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts
+fate-h264-intra-refresh-recovery: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/intra_refresh.h264 -frames:v 10
 fate-h264-invalid-ref-mod:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/h264refframeregression.mp4 -an -frames 10 -pix_fmt 
yuv420p10le
 fate-h264-lossless:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/lossless.h264
 fate-h264-mixed-nal-coding:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/mixed-nal-coding.mp4
diff --git a/tests/ref/fate/h264-intra-refresh-recovery 
b/tests/ref/fate/h264-intra-refresh-recovery
new file mode 100644
index 000..e85fe7b
--- /dev/null
+++ b/tests/ref/fate/h264-intra-refresh-recovery
@@ -0,0 +1,15 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 320x240
+#sar 0: 0/1
+0, 57, 57,1,   115200, 0x4a17d50b
+0, 58, 58,1,   115200, 0x1283d05b
+0, 59, 59,1,   115200, 0x2747c650
+0, 60, 60,1,   115200, 0xba23c933
+0, 61, 61,1,   115200, 0x8a96c54b
+0, 62, 62,1,   115200, 0x748ac6d3
+0, 63, 63,1,   115200, 0x719ca491
+0, 64, 64,1,   115200, 0x3d259d4d
+0, 65, 65,1,   115200, 0xe3599aa8
+0, 66, 66,1,   115200, 0x6fd4affe


==

diff --cc tests/fate/h264.mak
index c366d86,9996f95..718a3a8
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@@ -191,8 -180,8 +191,9 @@@ FATE_H264_REINIT_TESTS := large_420_8-t
  FATE_H264  := $(FATE_H264:%=fate-h264-conformance-%)\
$(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)\
fate-h264-extreme-plane-pred  \
+   fate-h264-intra-refresh-recovery  \
fate-h264-lossless\
 +  fate-h264-3386\
  
  FATE_H264-$(call DEMDEC, H264, H264) += $(FATE_H264)
  FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-crop-to-container
@@@ -245,186 -221,169 +246,187 @@@ fate-h264-conformance-caba2_sva_b
  fate-h264-conformance-caba3_sony_c:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_Sony_C.jsv
  fate-h264-conformance-caba3_sva_b:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_SVA_B.264
  fate-h264-conformance-caba3_toshiba_e:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264
 -fate-h264-conformance-cabac_mot_fld0_full:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_fld0_full.26l
 -fate-h264-conformance-cabac_mot_frm0_full:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264-conformance/camp_mot_frm0_full.26l
 -fate-h264-conformance-cabac_mot_mbaff0_full:  CMD = framecrc -i 
$(TARGET_SAMP

[FFmpeg-cvslog] FATE: add a test of H.264 SEI recovery in an intra refresh stream

2016-11-18 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Jun 15 
10:39:08 2016 +0200| [8d07e941b04d63fc4443dd986e3dc7b69cdcca43] | committer: 
Anton Khirnov

FATE: add a test of H.264 SEI recovery in an intra refresh stream

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

 tests/fate/h264.mak|  2 ++
 tests/ref/fate/h264-intra-refresh-recovery | 11 +++
 2 files changed, 13 insertions(+)

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index bbce95d..9996f95 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -180,6 +180,7 @@ FATE_H264_REINIT_TESTS := large_420_8-to-small_420_8
\
 FATE_H264  := $(FATE_H264:%=fate-h264-conformance-%)\
   $(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)\
   fate-h264-extreme-plane-pred  \
+  fate-h264-intra-refresh-recovery  \
   fate-h264-lossless\
 
 FATE_H264-$(call DEMDEC, H264, H264) += $(FATE_H264)
@@ -382,6 +383,7 @@ fate-h264-crop-to-container:  CMD = 
framemd5 -i $(TARGET_SAM
 fate-h264-direct-bff: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/direct-bff.mkv
 fate-h264-extreme-plane-pred: CMD = framemd5 -i 
$(TARGET_SAMPLES)/h264/extreme-plane-pred.h264
 fate-h264-interlace-crop: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
+fate-h264-intra-refresh-recovery: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/intra_refresh.h264 -frames:v 10
 fate-h264-invalid-ref-mod:CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/h264refframeregression.mp4 -an -frames 10 -pix_fmt 
yuv420p10le
 fate-h264-lossless:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/lossless.h264
 fate-h264-mixed-nal-coding:   CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/mixed-nal-coding.mp4
diff --git a/tests/ref/fate/h264-intra-refresh-recovery 
b/tests/ref/fate/h264-intra-refresh-recovery
new file mode 100644
index 000..4803900
--- /dev/null
+++ b/tests/ref/fate/h264-intra-refresh-recovery
@@ -0,0 +1,11 @@
+#tb 0: 1/25
+0,  0,  0,1,   115200, 0x5825f1b3
+0,  1,  1,1,   115200, 0xa6e2f328
+0,  2,  2,1,   115200, 0xcd88e49e
+0,  3,  3,1,   115200, 0x4a17d50b
+0,  4,  4,1,   115200, 0x1283d05b
+0,  5,  5,1,   115200, 0x2747c650
+0,  6,  6,1,   115200, 0xba23c933
+0,  7,  7,1,   115200, 0x8a96c54b
+0,  8,  8,1,   115200, 0x748ac6d3
+0,  9,  9,1,   115200, 0x719ca491

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


[FFmpeg-cvslog] Revert "apngdec: use side data to pass extradata to the decoder"

2016-11-18 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Fri Nov 18 
12:08:54 2016 -0300| [cf655d1643342e2c8b7c9dd895580d03948f5b18] | committer: 
James Almer

Revert "apngdec: use side data to pass extradata to the decoder"

This reverts commit e0c6b32046f4bab7d34be77dd2f03b2a80c86d39.

Said commit changed the behavior of the demuxer and decoder in a non
backwards compatible way.
Demuxers should make extradata available at init if possible, and send
new extradata as side data within a packet if needed.

A better fix for the remuxing crash will follow.

Signed-off-by: James Almer 
(cherry picked from commit 16c429166ddf1736972b6ccce84bd3509ec16a34)

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

 libavcodec/pngdec.c  | 23 ++-
 libavformat/apngdec.c| 73 
 tests/lavf-regression.sh |  6 ++--
 tests/ref/lavf/apng  |  3 --
 4 files changed, 29 insertions(+), 76 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 83eeb8d..36275ae 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -45,9 +45,6 @@ typedef struct PNGDecContext {
 ThreadFrame last_picture;
 ThreadFrame picture;
 
-uint8_t* extra_data;
-int extra_data_size;
-
 int state;
 int width, height;
 int cur_w, cur_h;
@@ -1364,28 +1361,14 @@ static int decode_frame_apng(AVCodecContext *avctx,
 p = s->picture.f;
 
 if (!(s->state & PNG_IHDR)) {
-int side_data_size = 0;
-uint8_t *side_data = NULL;
-if (avpkt)
-side_data = av_packet_get_side_data(avpkt, 
AV_PKT_DATA_NEW_EXTRADATA, &side_data_size);
-
-if (side_data_size) {
-av_freep(&s->extra_data);
-s->extra_data = av_mallocz(side_data_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
-if (!s->extra_data)
-return AVERROR(ENOMEM);
-s->extra_data_size = side_data_size;
-memcpy(s->extra_data, side_data, s->extra_data_size);
-}
-
-if (!s->extra_data_size)
+if (!avctx->extradata_size)
 return AVERROR_INVALIDDATA;
 
 /* only init fields, there is no zlib use in extradata */
 s->zstream.zalloc = ff_png_zalloc;
 s->zstream.zfree  = ff_png_zfree;
 
-bytestream2_init(&s->gb, s->extra_data, s->extra_data_size);
+bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
 if ((ret = decode_frame_common(avctx, s, p, avpkt)) < 0)
 goto end;
 }
@@ -1511,8 +1494,6 @@ static av_cold int png_dec_end(AVCodecContext *avctx)
 s->last_row_size = 0;
 av_freep(&s->tmp_row);
 s->tmp_row_size = 0;
-av_freep(&s->extra_data);
-s->extra_data_size = 0;
 
 return 0;
 }
diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 07a21e6..bb17896 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -49,10 +49,6 @@ typedef struct APNGDemuxContext {
 
 int is_key_frame;
 
-uint8_t *extra_data;
-int extra_data_size;
-int extra_data_updated;
-
 /*
  * loop options
  */
@@ -126,9 +122,9 @@ end:
 return AVPROBE_SCORE_MAX;
 }
 
-static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)
+static int append_extradata(AVCodecParameters *par, AVIOContext *pb, int len)
 {
-int previous_size = ctx->extra_data_size;
+int previous_size = par->extradata_size;
 int new_size, ret;
 uint8_t *new_extradata;
 
@@ -136,30 +132,18 @@ static int append_extradata(APNGDemuxContext *ctx, 
AVIOContext *pb, int len)
 return AVERROR_INVALIDDATA;
 
 new_size = previous_size + len;
-new_extradata = av_realloc(ctx->extra_data, new_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+new_extradata = av_realloc(par->extradata, new_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
 if (!new_extradata)
 return AVERROR(ENOMEM);
-ctx->extra_data = new_extradata;
-ctx->extra_data_size = new_size;
+par->extradata = new_extradata;
+par->extradata_size = new_size;
 
-if ((ret = avio_read(pb, ctx->extra_data + previous_size, len)) < 0)
+if ((ret = avio_read(pb, par->extradata + previous_size, len)) < 0)
 return ret;
 
 return previous_size;
 }
 
-static int send_extradata(APNGDemuxContext *ctx, AVPacket *pkt)
-{
-if (!ctx->extra_data_updated) {
-uint8_t *side_data = av_packet_new_side_data(pkt, 
AV_PKT_DATA_NEW_EXTRADATA, ctx->extra_data_size);
-if (!side_data)
-return AVERROR(ENOMEM);
-memcpy(side_data, ctx->extra_data, ctx->extra_data_size);
-ctx->extra_data_updated = 1;
-}
-return 0;
-}
-
 static int apng_read_header(AVFormatContext *s)
 {
 APNGDemuxContext *ctx = s->priv_data;
@@ -194,15 +178,15 @@ static int apng_read_header(AVFormatContext *s)
 return ret;
 
 /* extradata will contain every chunk up to the first fcTL (excluded) */
-ctx->extra_data = av_malloc

[FFmpeg-cvslog] Revert "apngdec: use side data to pass extradata to the decoder"

2016-11-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Nov 18 12:08:54 
2016 -0300| [16c429166ddf1736972b6ccce84bd3509ec16a34] | committer: James Almer

Revert "apngdec: use side data to pass extradata to the decoder"

This reverts commit e0c6b32046f4bab7d34be77dd2f03b2a80c86d39.

Said commit changed the behavior of the demuxer and decoder in a non
backwards compatible way.
Demuxers should make extradata available at init if possible, and send
new extradata as side data within a packet if needed.

A better fix for the remuxing crash will follow.

Signed-off-by: James Almer 

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

 libavcodec/pngdec.c  | 23 ++-
 libavformat/apngdec.c| 73 
 tests/lavf-regression.sh |  6 ++--
 tests/ref/lavf/apng  |  3 --
 4 files changed, 29 insertions(+), 76 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 83eeb8d..36275ae 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -45,9 +45,6 @@ typedef struct PNGDecContext {
 ThreadFrame last_picture;
 ThreadFrame picture;
 
-uint8_t* extra_data;
-int extra_data_size;
-
 int state;
 int width, height;
 int cur_w, cur_h;
@@ -1364,28 +1361,14 @@ static int decode_frame_apng(AVCodecContext *avctx,
 p = s->picture.f;
 
 if (!(s->state & PNG_IHDR)) {
-int side_data_size = 0;
-uint8_t *side_data = NULL;
-if (avpkt)
-side_data = av_packet_get_side_data(avpkt, 
AV_PKT_DATA_NEW_EXTRADATA, &side_data_size);
-
-if (side_data_size) {
-av_freep(&s->extra_data);
-s->extra_data = av_mallocz(side_data_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
-if (!s->extra_data)
-return AVERROR(ENOMEM);
-s->extra_data_size = side_data_size;
-memcpy(s->extra_data, side_data, s->extra_data_size);
-}
-
-if (!s->extra_data_size)
+if (!avctx->extradata_size)
 return AVERROR_INVALIDDATA;
 
 /* only init fields, there is no zlib use in extradata */
 s->zstream.zalloc = ff_png_zalloc;
 s->zstream.zfree  = ff_png_zfree;
 
-bytestream2_init(&s->gb, s->extra_data, s->extra_data_size);
+bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
 if ((ret = decode_frame_common(avctx, s, p, avpkt)) < 0)
 goto end;
 }
@@ -1511,8 +1494,6 @@ static av_cold int png_dec_end(AVCodecContext *avctx)
 s->last_row_size = 0;
 av_freep(&s->tmp_row);
 s->tmp_row_size = 0;
-av_freep(&s->extra_data);
-s->extra_data_size = 0;
 
 return 0;
 }
diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 07a21e6..bb17896 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -49,10 +49,6 @@ typedef struct APNGDemuxContext {
 
 int is_key_frame;
 
-uint8_t *extra_data;
-int extra_data_size;
-int extra_data_updated;
-
 /*
  * loop options
  */
@@ -126,9 +122,9 @@ end:
 return AVPROBE_SCORE_MAX;
 }
 
-static int append_extradata(APNGDemuxContext *ctx, AVIOContext *pb, int len)
+static int append_extradata(AVCodecParameters *par, AVIOContext *pb, int len)
 {
-int previous_size = ctx->extra_data_size;
+int previous_size = par->extradata_size;
 int new_size, ret;
 uint8_t *new_extradata;
 
@@ -136,30 +132,18 @@ static int append_extradata(APNGDemuxContext *ctx, 
AVIOContext *pb, int len)
 return AVERROR_INVALIDDATA;
 
 new_size = previous_size + len;
-new_extradata = av_realloc(ctx->extra_data, new_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+new_extradata = av_realloc(par->extradata, new_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
 if (!new_extradata)
 return AVERROR(ENOMEM);
-ctx->extra_data = new_extradata;
-ctx->extra_data_size = new_size;
+par->extradata = new_extradata;
+par->extradata_size = new_size;
 
-if ((ret = avio_read(pb, ctx->extra_data + previous_size, len)) < 0)
+if ((ret = avio_read(pb, par->extradata + previous_size, len)) < 0)
 return ret;
 
 return previous_size;
 }
 
-static int send_extradata(APNGDemuxContext *ctx, AVPacket *pkt)
-{
-if (!ctx->extra_data_updated) {
-uint8_t *side_data = av_packet_new_side_data(pkt, 
AV_PKT_DATA_NEW_EXTRADATA, ctx->extra_data_size);
-if (!side_data)
-return AVERROR(ENOMEM);
-memcpy(side_data, ctx->extra_data, ctx->extra_data_size);
-ctx->extra_data_updated = 1;
-}
-return 0;
-}
-
 static int apng_read_header(AVFormatContext *s)
 {
 APNGDemuxContext *ctx = s->priv_data;
@@ -194,15 +178,15 @@ static int apng_read_header(AVFormatContext *s)
 return ret;
 
 /* extradata will contain every chunk up to the first fcTL (excluded) */
-ctx->extra_data = av_malloc(len + 12 + AV_INPUT_BUFFER_PADDING_SIZE);
-if (!ctx->extra_data)
+

[FFmpeg-cvslog] avformat/apngenc: use the stream parameters extradata if available

2016-11-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Nov 18 12:21:54 
2016 -0300| [50e0e96f3f8ed57443707289a621446cef0fe367] | committer: James Almer

avformat/apngenc: use the stream parameters extradata if available

Fixes remuxing apng streams coming from the apng demuxer, which sends extradata
during init.

Signed-off-by: James Almer 

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

 libavformat/apngenc.c| 9 +
 tests/lavf-regression.sh | 6 +++---
 tests/ref/lavf/apng  | 3 +++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
index e5e8aa9..0c40be2 100644
--- a/libavformat/apngenc.c
+++ b/libavformat/apngenc.c
@@ -81,6 +81,7 @@ static void apng_write_chunk(AVIOContext *io_context, 
uint32_t tag,
 static int apng_write_header(AVFormatContext *format_context)
 {
 APNGMuxContext *apng = format_context->priv_data;
+AVCodecParameters *par = format_context->streams[0]->codecpar;
 
 if (format_context->nb_streams != 1 ||
 format_context->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO 
||
@@ -101,6 +102,14 @@ static int apng_write_header(AVFormatContext 
*format_context)
 avio_wb64(format_context->pb, PNGSIG);
 // Remaining headers are written when they are copied from the encoder
 
+if (par->extradata_size) {
+apng->extra_data = av_mallocz(par->extradata_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!apng->extra_data)
+return AVERROR(ENOMEM);
+apng->extra_data_size = par->extradata_size;
+memcpy(apng->extra_data, par->extradata, par->extradata_size);
+}
+
 return 0;
 }
 
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index e47be18..12954d5 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -216,9 +216,9 @@ if [ -n "$do_apng" ] ; then
 file=${outfile}lavf.apng
 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 
-pix_fmt rgb24
 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
-#file_copy=${outfile}lavf.copy.apng
-#do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
-#do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
+file_copy=${outfile}lavf.copy.apng
+do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
+do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
 file=${outfile}lavf.png
 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS 
-pix_fmt rgb24 -frames:v 1 -f apng
 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
diff --git a/tests/ref/lavf/apng b/tests/ref/lavf/apng
index 4d35408..8e9e5e6 100644
--- a/tests/ref/lavf/apng
+++ b/tests/ref/lavf/apng
@@ -1,6 +1,9 @@
 a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.apng
 6209864 ./tests/data/lavf/lavf.apng
 ./tests/data/lavf/lavf.apng CRC=0x87b3c15f
+a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.copy.apng
+6209864 ./tests/data/lavf/lavf.copy.apng
+./tests/data/lavf/lavf.copy.apng CRC=0x87b3c15f
 c5900fdd1b2fc30b985793f5226fd0c4 *./tests/data/lavf/lavf.png
 248854 ./tests/data/lavf/lavf.png
 ./tests/data/lavf/lavf.png CRC=0xd8c7b7a1

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


[FFmpeg-cvslog] avformat/apngenc: use the stream parameters extradata if available

2016-11-18 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Fri Nov 18 
12:21:54 2016 -0300| [f97bee9ad565cba3b8e348167105b73211787066] | committer: 
James Almer

avformat/apngenc: use the stream parameters extradata if available

Fixes remuxing apng streams coming from the apng demuxer, which sends extradata
during init.

Signed-off-by: James Almer 

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

 libavformat/apngenc.c| 9 +
 tests/lavf-regression.sh | 6 +++---
 tests/ref/lavf/apng  | 3 +++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
index e5e8aa9..0c40be2 100644
--- a/libavformat/apngenc.c
+++ b/libavformat/apngenc.c
@@ -81,6 +81,7 @@ static void apng_write_chunk(AVIOContext *io_context, 
uint32_t tag,
 static int apng_write_header(AVFormatContext *format_context)
 {
 APNGMuxContext *apng = format_context->priv_data;
+AVCodecParameters *par = format_context->streams[0]->codecpar;
 
 if (format_context->nb_streams != 1 ||
 format_context->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO 
||
@@ -101,6 +102,14 @@ static int apng_write_header(AVFormatContext 
*format_context)
 avio_wb64(format_context->pb, PNGSIG);
 // Remaining headers are written when they are copied from the encoder
 
+if (par->extradata_size) {
+apng->extra_data = av_mallocz(par->extradata_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!apng->extra_data)
+return AVERROR(ENOMEM);
+apng->extra_data_size = par->extradata_size;
+memcpy(apng->extra_data, par->extradata, par->extradata_size);
+}
+
 return 0;
 }
 
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index e47be18..12954d5 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -216,9 +216,9 @@ if [ -n "$do_apng" ] ; then
 file=${outfile}lavf.apng
 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 
-pix_fmt rgb24
 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
-#file_copy=${outfile}lavf.copy.apng
-#do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
-#do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
+file_copy=${outfile}lavf.copy.apng
+do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
+do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
 file=${outfile}lavf.png
 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS 
-pix_fmt rgb24 -frames:v 1 -f apng
 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
diff --git a/tests/ref/lavf/apng b/tests/ref/lavf/apng
index 4d35408..8e9e5e6 100644
--- a/tests/ref/lavf/apng
+++ b/tests/ref/lavf/apng
@@ -1,6 +1,9 @@
 a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.apng
 6209864 ./tests/data/lavf/lavf.apng
 ./tests/data/lavf/lavf.apng CRC=0x87b3c15f
+a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.copy.apng
+6209864 ./tests/data/lavf/lavf.copy.apng
+./tests/data/lavf/lavf.copy.apng CRC=0x87b3c15f
 c5900fdd1b2fc30b985793f5226fd0c4 *./tests/data/lavf/lavf.png
 248854 ./tests/data/lavf/lavf.png
 ./tests/data/lavf/lavf.png CRC=0xd8c7b7a1

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


[FFmpeg-cvslog] avcodec/ffv1dec: Set packed_at_lsb for 16bit YUV

2016-11-18 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Nov 17 23:29:00 2016 +0100| [d1d18de6ade3ad5690f1eba9e005bab797d94ac6] | 
committer: Michael Niedermayer

avcodec/ffv1dec: Set packed_at_lsb for 16bit YUV

This avoids unneeded computations

Signed-off-by: Michael Niedermayer 

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

 libavcodec/ffv1dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index b5fb825..358da17 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -637,12 +637,14 @@ static int read_header(FFV1Context *f)
 case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUVA420P10; break;
 }
 } else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency){
+f->packed_at_lsb = 1;
 switch(16 * f->chroma_h_shift + f->chroma_v_shift) {
 case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUV444P16; break;
 case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P16; break;
 case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P16; break;
 }
 } else if (f->avctx->bits_per_raw_sample == 16 && f->transparency){
+f->packed_at_lsb = 1;
 switch(16 * f->chroma_h_shift + f->chroma_v_shift) {
 case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P16; break;
 case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P16; break;

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


[FFmpeg-cvslog] avcodec/ffv1dec: Support gray 10/12/16 explicitly avoid shifts

2016-11-18 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Nov 17 23:21:37 2016 +0100| [d7a3bb2088679623db70eaa432e7e3563cbd561d] | 
committer: Michael Niedermayer

avcodec/ffv1dec: Support gray 10/12/16 explicitly avoid shifts

Signed-off-by: Michael Niedermayer 

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

 libavcodec/ffv1dec.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 0719e28..b5fb825 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -575,8 +575,19 @@ static int read_header(FFV1Context *f)
 if (!f->transparency && !f->chroma_planes) {
 if (f->avctx->bits_per_raw_sample <= 8)
 f->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-else
+else if (f->avctx->bits_per_raw_sample == 10) {
+f->packed_at_lsb = 1;
+f->avctx->pix_fmt = AV_PIX_FMT_GRAY10;
+} else if (f->avctx->bits_per_raw_sample == 12) {
+f->packed_at_lsb = 1;
+f->avctx->pix_fmt = AV_PIX_FMT_GRAY12;
+} else if (f->avctx->bits_per_raw_sample == 16) {
+f->packed_at_lsb = 1;
+f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+} else if (f->avctx->bits_per_raw_sample < 16) {
 f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+} else
+return AVERROR(ENOSYS);
 } else if (f->transparency && !f->chroma_planes) {
 if (f->avctx->bits_per_raw_sample <= 8)
 f->avctx->pix_fmt = AV_PIX_FMT_YA8;

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


[FFmpeg-cvslog] ffmpeg: remove dead code out of the video filter loop

2016-11-18 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Mon Oct 24 22:54:03 
2016 +0200| [b9c26aed4e3ca396d826b4566d5f3fef8b08b424] | committer: Clément 
Bœsch

ffmpeg: remove dead code out of the video filter loop

It makes no sense for this code to be inside the video filter loop, and
the frame sample aspect ratio is even set unconditionally a few lines
above.

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

 ffmpeg.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index a6e9476..2c46b22 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2201,7 +2201,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, 
int *got_output, int eo
 int i, ret = 0, err = 0, resample_changed;
 int64_t best_effort_timestamp;
 int64_t dts = AV_NOPTS_VALUE;
-AVRational *frame_sample_aspect;
 AVPacket avpkt;
 
 // With fate-indeo3-2, we're getting 0-sized packets before EOF for some
@@ -2347,11 +2346,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, 
int *got_output, int eo
 }
 }
 
-frame_sample_aspect= av_opt_ptr(avcodec_get_frame_class(), decoded_frame, 
"sample_aspect_ratio");
 for (i = 0; i < ist->nb_filters; i++) {
-if (!frame_sample_aspect->num)
-*frame_sample_aspect = ist->st->sample_aspect_ratio;
-
 if (i < ist->nb_filters - 1) {
 f = ist->filter_frame;
 err = av_frame_ref(f, decoded_frame);

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


[FFmpeg-cvslog] ffmpeg: factor out sending frame to filters

2016-11-18 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Mon Oct 24 23:01:23 
2016 +0200| [825f6fbfac6cd98c1a865fa5a890599f8934f2e7] | committer: Clément 
Bœsch

ffmpeg: factor out sending frame to filters

Video doesn't exit ffmpeg on error anymore, and audio now prints an
error.

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

 ffmpeg.c | 64 ++--
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 2c46b22..c47a824 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2065,9 +2065,35 @@ static int decode(AVCodecContext *avctx, AVFrame *frame, 
int *got_frame, AVPacke
 return 0;
 }
 
+static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
+{
+int i, ret;
+AVFrame *f;
+
+for (i = 0; i < ist->nb_filters; i++) {
+if (i < ist->nb_filters - 1) {
+f = ist->filter_frame;
+ret = av_frame_ref(f, decoded_frame);
+if (ret < 0)
+break;
+} else
+f = decoded_frame;
+ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f,
+   AV_BUFFERSRC_FLAG_PUSH);
+if (ret == AVERROR_EOF)
+ret = 0; /* ignore */
+if (ret < 0) {
+av_log(NULL, AV_LOG_ERROR,
+   "Failed to inject frame into filter network: %s\n", 
av_err2str(ret));
+break;
+}
+}
+return ret;
+}
+
 static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
 {
-AVFrame *decoded_frame, *f;
+AVFrame *decoded_frame;
 AVCodecContext *avctx = ist->dec_ctx;
 int i, ret, err = 0, resample_changed;
 AVRational decoded_frame_tb;
@@ -2172,21 +2198,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, 
int *got_output)
   (AVRational){1, 
avctx->sample_rate}, decoded_frame->nb_samples, 
&ist->filter_in_rescale_delta_last,
   (AVRational){1, 
avctx->sample_rate});
 ist->nb_samples = decoded_frame->nb_samples;
-for (i = 0; i < ist->nb_filters; i++) {
-if (i < ist->nb_filters - 1) {
-f = ist->filter_frame;
-err = av_frame_ref(f, decoded_frame);
-if (err < 0)
-break;
-} else
-f = decoded_frame;
-err = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f,
- AV_BUFFERSRC_FLAG_PUSH);
-if (err == AVERROR_EOF)
-err = 0; /* ignore */
-if (err < 0)
-break;
-}
+err = send_frame_to_filters(ist, decoded_frame);
 decoded_frame->pts = AV_NOPTS_VALUE;
 
 fail:
@@ -2197,7 +2209,7 @@ fail:
 
 static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int 
eof)
 {
-AVFrame *decoded_frame, *f;
+AVFrame *decoded_frame;
 int i, ret = 0, err = 0, resample_changed;
 int64_t best_effort_timestamp;
 int64_t dts = AV_NOPTS_VALUE;
@@ -2346,23 +2358,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, 
int *got_output, int eo
 }
 }
 
-for (i = 0; i < ist->nb_filters; i++) {
-if (i < ist->nb_filters - 1) {
-f = ist->filter_frame;
-err = av_frame_ref(f, decoded_frame);
-if (err < 0)
-break;
-} else
-f = decoded_frame;
-err = av_buffersrc_add_frame_flags(ist->filters[i]->filter, f, 
AV_BUFFERSRC_FLAG_PUSH);
-if (err == AVERROR_EOF) {
-err = 0; /* ignore */
-} else if (err < 0) {
-av_log(NULL, AV_LOG_FATAL,
-   "Failed to inject frame into filter network: %s\n", 
av_err2str(err));
-exit_program(1);
-}
-}
+err = send_frame_to_filters(ist, decoded_frame);
 
 fail:
 av_frame_unref(ist->filter_frame);

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


[FFmpeg-cvslog] x86/vp9itxfm: add missing AVX2 guards

2016-11-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Nov 18 16:58:35 
2016 -0300| [2de1c79b61b66672a53b1bb42fdbb7aaa5854111] | committer: James Almer

x86/vp9itxfm: add missing AVX2 guards

Fixes compilation with Yasm 1.1.0 and older.

Signed-off-by: James Almer 

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

 libavcodec/x86/vp9itxfm.asm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/vp9itxfm.asm b/libavcodec/x86/vp9itxfm.asm
index 21d572e..2c63fe5 100644
--- a/libavcodec/x86/vp9itxfm.asm
+++ b/libavcodec/x86/vp9itxfm.asm
@@ -2092,7 +2092,7 @@ IADST16_FN iadst, IADST16, iadst, IADST16, avx
 SWAP 5,  9, 15
 %endmacro
 
-%if ARCH_X86_64
+%if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
 %macro IADST16_YMM_FN 4
 INIT_YMM avx2
 cglobal vp9_%1_%3_16x16_add, 4, 4, 16, dst, stride, block, eob

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


[FFmpeg-cvslog] options_table: limit codec parameters to sane values

2016-11-18 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Thu Nov 17 19:25:50 2016 +0100| [7289aa2d71a892685b05eede8705fbc05f50dcb4] | 
committer: Andreas Cadhalpun

options_table: limit codec parameters to sane values

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

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

 libavcodec/options_table.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index ba5297c..48de667 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -106,12 +106,12 @@ static const AVOption avcodec_options[] = {
 {"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, 
INT_MIN, INT_MAX, V|E, "me_method" },
 {"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, 
INT_MIN, INT_MAX, V|E, "me_method" },
 #endif
-{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 
INT_MIN, INT_MAX},
+{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 
INT_MAX},
 {"g", "set the group of picture (GOP) size", OFFSET(gop_size), 
AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
 {"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, 
{.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
 {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = 
DEFAULT }, INT_MIN, INT_MAX, A|E},
-{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX, A|E},
+{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
0, INT_MAX, A|E},
 {"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT 
}, INT_MIN, INT_MAX},
 {"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, 
INT_MAX},
 {"qcomp", "video quantizer scale compression (VBR). Constant of ratecontrol 
equation. "
@@ -180,8 +180,8 @@ static const AVOption avcodec_options[] = {
 {"careful","consider things that violate the spec, are fast to check and 
have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
 {"compliant",  "consider all spec non compliancies as errors", 0, 
AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, A|V|D, 
"err_detect"},
 {"aggressive", "consider things that a sane encoder should not do as an 
error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, 
A|V|D, "err_detect"},
-{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT 
}, INT_MIN, INT_MAX},
-{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
+{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT 
}, 0, INT_MAX},
+{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
0, INT_MAX},
 #if FF_API_PRIVATE_OPT
 {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
 #endif
@@ -247,7 +247,7 @@ static const AVOption avcodec_options[] = {
 {"guess_mvs", "iterative motion vector (MV) search (slow)", 0, 
AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
 {"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, 
{.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"},
 {"favor_inter", "favor predicting from the previous frame", 0, 
AV_OPT_TYPE_CONST, {.i64 = FF_EC_FAVOR_INTER }, INT_MIN, INT_MAX, V|D, "ec"},
-{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX},
 #if FF_API_PRIVATE_OPT
 {"pred", "prediction method", OFFSET(prediction_method), AV_OPT_TYPE_INT, 
{.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "pred"},
 {"left", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_LEFT }, INT_MIN, INT_MAX, 
V|E, "pred"},
@@ -446,7 +446,7 @@ static const AVOption avcodec_options[] = {
 {"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, 
{.i64 = -1 }, INT_MIN, INT_MAX, A|E},
 {"timecode_frame_start", "GOP timecode frame start number, in non-drop-frame 
format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = -1 }, -1, 
INT64_MAX, V|E},
 #endif
-{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, 
{.i64 = DEFAULT }, INT_MIN, INT_MAX},
+{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, 
{.i64 = DEFAULT }, 0, INT_MAX},
 {"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = 
DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"},
 {"request_channel_layout", NULL, OFFSET(request_channel_layout), 
AV_OPT_

[FFmpeg-cvslog] avformat/flvdec: add debug message to list keyframes index metadata

2016-11-18 Thread Steven Liu
ffmpeg | branch: master | Steven Liu  | Fri Nov  4 
19:54:48 2016 +0800| [4696f7639b22c9205792d2e3d5e8e07b3cadbb63] | committer: 
Michael Niedermayer

avformat/flvdec: add debug message to list keyframes index metadata

when parsing keyframe index metadata, list the message by trace log

Signed-off-by: Steven Liu 
Signed-off-by: Michael Niedermayer 

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

 libavformat/flvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index e53c345..3812994 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -114,6 +114,8 @@ static void add_keyframes_index(AVFormatContext *s)
 
 if (stream->nb_index_entries == 0) {
 for (i = 0; i < flv->keyframe_count; i++) {
+av_log(s, AV_LOG_TRACE, "keyframe filepositions = %"PRId64" times 
= %"PRId64"\n",
+   flv->keyframe_filepositions[i], flv->keyframe_times[i] * 
1000);
 av_add_index_entry(stream, flv->keyframe_filepositions[i],
 flv->keyframe_times[i] * 1000, 0, 0, AVINDEX_KEYFRAME);
 }

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


[FFmpeg-cvslog] avformat/utils: add av_stream_add_side_data()

2016-11-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Nov 17 02:02:41 
2016 -0300| [2ab50647ff653ab45d9d78203b6a671124609991] | committer: James Almer

avformat/utils: add av_stream_add_side_data()

Functionally similar to av_packet_add_side_data(). Allows the use of an
already allocated buffer as stream side data.

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 doc/APIchanges |  3 +++
 libavformat/avformat.h | 15 +++
 libavformat/utils.c| 32 +++-
 libavformat/version.h  |  2 +-
 4 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 3089c82..3171c05 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-11-18 - xxx - lavf 57.58.100 - avformat.h
+  Add av_stream_add_side_data().
+
 2016-xx-xx - xxx - lavu 55.39.100 - hwcontext_vaapi.h
   Add AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE.
 
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f9f4d72..7c69614 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2049,6 +2049,21 @@ const AVClass *avformat_get_class(void);
 AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
 
 /**
+ * Wrap an existing array as stream side data.
+ *
+ * @param st stream
+ * @param type side information type
+ * @param data the side data array. It must be allocated with the av_malloc()
+ * family of functions. The ownership of the data is transferred to
+ * st.
+ * @param size side information size
+ * @return zero on success, a negative AVERROR code on failure. On failure,
+ * the stream is unchanged and the data remains owned by the caller.
+ */
+int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
+uint8_t *data, size_t size);
+
+/**
  * Allocate new information from stream.
  *
  * @param stream stream
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5664646..19bb8bd 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5104,15 +5104,11 @@ uint8_t *av_stream_get_side_data(const AVStream *st,
 return NULL;
 }
 
-uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
- int size)
+int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
+uint8_t *data, size_t size)
 {
 AVPacketSideData *sd, *tmp;
 int i;
-uint8_t *data = av_malloc(size);
-
-if (!data)
-return NULL;
 
 for (i = 0; i < st->nb_side_data; i++) {
 sd = &st->side_data[i];
@@ -5121,14 +5117,13 @@ uint8_t *av_stream_new_side_data(AVStream *st, enum 
AVPacketSideDataType type,
 av_freep(&sd->data);
 sd->data = data;
 sd->size = size;
-return sd->data;
+return 0;
 }
 }
 
 tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));
 if (!tmp) {
-av_freep(&data);
-return NULL;
+return AVERROR(ENOMEM);
 }
 
 st->side_data = tmp;
@@ -5138,6 +5133,25 @@ uint8_t *av_stream_new_side_data(AVStream *st, enum 
AVPacketSideDataType type,
 sd->type = type;
 sd->data = data;
 sd->size = size;
+
+return 0;
+}
+
+uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
+ int size)
+{
+int ret;
+uint8_t *data = av_malloc(size);
+
+if (!data)
+return NULL;
+
+ret = av_stream_add_side_data(st, type, data, size);
+if (ret < 0) {
+av_freep(&data);
+return NULL;
+}
+
 return data;
 }
 
diff --git a/libavformat/version.h b/libavformat/version.h
index f75b400..24a7534 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  57
+#define LIBAVFORMAT_VERSION_MINOR  58
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

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


[FFmpeg-cvslog] avformat/mov: use av_stream_add_side_data() for displaymatrix side data

2016-11-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Nov 17 02:19:19 
2016 -0300| [77f033eb98d0d7d05f3aa238409d87fb1f6096b3] | committer: James Almer

avformat/mov: use av_stream_add_side_data() for displaymatrix side data

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 libavformat/mov.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8d6cc12..9bf436e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5647,20 +5647,13 @@ static int mov_read_header(AVFormatContext *s)
 break;
 case AVMEDIA_TYPE_VIDEO:
 if (sc->display_matrix) {
-AVPacketSideData *sd, *tmp;
+int ret;
 
-tmp = av_realloc_array(st->side_data,
-   st->nb_side_data + 1, sizeof(*tmp));
-if (!tmp)
-return AVERROR(ENOMEM);
-
-st->side_data = tmp;
-st->nb_side_data++;
+ret = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, 
(uint8_t*)sc->display_matrix,
+  sizeof(int32_t) * 9);
+if (ret < 0)
+return ret;
 
-sd = &st->side_data[st->nb_side_data - 1];
-sd->type = AV_PKT_DATA_DISPLAYMATRIX;
-sd->size = sizeof(int32_t) * 9;
-sd->data = (uint8_t*)sc->display_matrix;
 sc->display_matrix = NULL;
 }
 break;

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