[FFmpeg-cvslog] Merge commit '00332e0a064dad866812de9162b009cbaba6f5df'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
13:25:25 2015 +0200| [037b44a3b44ead1cef8910c52fdd1343779b5203] | committer: 
Hendrik Leppkes

Merge commit '00332e0a064dad866812de9162b009cbaba6f5df'

* commit '00332e0a064dad866812de9162b009cbaba6f5df':
  wrapped_avframe: Initial implementation

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] wrapped_avframe: Initial implementation

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Fri Oct  9 
14:12:04 2015 +0200| [00332e0a064dad866812de9162b009cbaba6f5df] | committer: 
Luca Barbato

wrapped_avframe: Initial implementation

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

 libavcodec/Makefile  |1 +
 libavcodec/allcodecs.c   |1 +
 libavcodec/avcodec.h |1 +
 libavcodec/codec_desc.c  |7 
 libavcodec/version.h |2 +-
 libavcodec/wrapped_avframe.c |   74 ++
 6 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index ba711ae..3e57a0d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -472,6 +472,7 @@ OBJS-$(CONFIG_WMV2_ENCODER)+= wmv2enc.o wmv2.o \
   msmpeg4.o msmpeg4enc.o msmpeg4data.o
 OBJS-$(CONFIG_WNV1_DECODER)+= wnv1.o
 OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
+OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER) += wrapped_avframe.o
 OBJS-$(CONFIG_XAN_DPCM_DECODER)+= dpcm.o
 OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
 OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2d8474a..46febd5 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -292,6 +292,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(VP9,   vp9);
 REGISTER_DECODER(VQA,   vqa);
 REGISTER_DECODER(WEBP,  webp);
+REGISTER_ENCODER(WRAPPED_AVFRAME,   wrapped_avframe);
 REGISTER_ENCDEC (WMV1,  wmv1);
 REGISTER_ENCDEC (WMV2,  wmv2);
 REGISTER_DECODER(WMV3,  wmv3);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 11ae1fc..5f1755a 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -477,6 +477,7 @@ enum AVCodecID {
 AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 
Systems
 * stream (only used by libavformat) */
 AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams 
containing only metadata information.
+AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames 
wrapped in AVPacket
 };
 
 /**
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index d2c7a91..91c77c8 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1169,6 +1169,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Screenpresso"),
 .props = AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_WRAPPED_AVFRAME,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "wrapped_avframe",
+.long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"),
+.props = AV_CODEC_PROP_LOSSLESS,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 4b487ca..27d13b0 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR  3
+#define LIBAVCODEC_VERSION_MINOR  4
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavcodec/wrapped_avframe.c b/libavcodec/wrapped_avframe.c
new file mode 100644
index 000..9d504db
--- /dev/null
+++ b/libavcodec/wrapped_avframe.c
@@ -0,0 +1,74 @@
+/*
+ * AVFrame wrapper
+ * Copyright (c) 2015 Luca Barbato
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Simple wrapper to store an AVFrame and forward it as AVPacket.
+ */
+
+#include "avcodec.h"
+#include "internal.h"
+
+#include "libavutil/internal.h"
+#include "libavutil/frame.h"
+#include "libavutil/buffer.h"
+#include "libavutil/pixdesc.h"
+
+static void wrapped_avframe_release_buffer(void *unused, uint8_t *data)
+{
+AVFrame *frame = (AVFrame *)data;
+
+av_frame_free(&frame);
+}
+
+static int wrapped_avframe_encode(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+AVFrame *wrapp

[FFmpeg-cvslog] Merge commit 'd00a8fd417ad20cecbc7ca17b25f352655148fb1'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
13:44:33 2015 +0200| [1dd5f3340e002bf923fbfd4774afe3fafc6ad713] | committer: 
Hendrik Leppkes

Merge commit 'd00a8fd417ad20cecbc7ca17b25f352655148fb1'

* commit 'd00a8fd417ad20cecbc7ca17b25f352655148fb1':
  yuv4mpeg: Use the wrapped avframe pseudo-encoder

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] yuv4mpeg: Use the wrapped avframe pseudo-encoder

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Fri Oct  9 
16:22:42 2015 +0200| [d00a8fd417ad20cecbc7ca17b25f352655148fb1] | committer: 
Luca Barbato

yuv4mpeg: Use the wrapped avframe pseudo-encoder

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

 libavformat/yuv4mpegenc.c |   23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index 2caa364..ef1e775 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -88,7 +88,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 {
 AVStream *st = s->streams[pkt->stream_index];
 AVIOContext *pb = s->pb;
-AVPicture *picture;
+AVFrame *frame;
 int* first_pkt = s->priv_data;
 int width, height, h_chroma_shift, v_chroma_shift;
 int i;
@@ -96,7 +96,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 char buf1[20];
 uint8_t *ptr, *ptr1, *ptr2;
 
-picture = (AVPicture *)pkt->data;
+frame = (AVFrame *)pkt->data;
 
 /* for the first packet we have to output the header as well */
 if (*first_pkt) {
@@ -118,10 +118,10 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 width  = st->codec->width;
 height = st->codec->height;
 
-ptr = picture->data[0];
+ptr = frame->data[0];
 for (i = 0; i < height; i++) {
 avio_write(pb, ptr, width);
-ptr += picture->linesize[0];
+ptr += frame->linesize[0];
 }
 
 if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) {
@@ -132,15 +132,15 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 width  = -(-width  >> h_chroma_shift);
 height = -(-height >> v_chroma_shift);
 
-ptr1 = picture->data[1];
-ptr2 = picture->data[2];
+ptr1 = frame->data[1];
+ptr2 = frame->data[2];
 for (i = 0; i < height; i++) { /* Cb */
 avio_write(pb, ptr1, width);
-ptr1 += picture->linesize[1];
+ptr1 += frame->linesize[1];
 }
 for (i = 0; i < height; i++) { /* Cr */
 avio_write(pb, ptr2, width);
-ptr2 += picture->linesize[2];
+ptr2 += frame->linesize[2];
 }
 }
 return 0;
@@ -153,8 +153,8 @@ static int yuv4_write_header(AVFormatContext *s)
 if (s->nb_streams != 1)
 return AVERROR(EIO);
 
-if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) {
-av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n");
+if (s->streams[0]->codec->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME) {
+av_log(s, AV_LOG_ERROR, "ERROR: Codec not supported.\n");
 return AVERROR_INVALIDDATA;
 }
 
@@ -182,8 +182,7 @@ AVOutputFormat ff_yuv4mpegpipe_muxer = {
 .extensions= "y4m",
 .priv_data_size= sizeof(int),
 .audio_codec   = AV_CODEC_ID_NONE,
-.video_codec   = AV_CODEC_ID_RAWVIDEO,
+.video_codec   = AV_CODEC_ID_WRAPPED_AVFRAME,
 .write_header  = yuv4_write_header,
 .write_packet  = yuv4_write_packet,
-.flags = AVFMT_RAWPICTURE,
 };

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


[FFmpeg-cvslog] Merge commit 'b9ece15a01782b4f301c0c139d1d7b20f848914c'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
13:48:22 2015 +0200| [64ceeac26a441ede6eaf4bb99a5c3224b1803745] | committer: 
Hendrik Leppkes

Merge commit 'b9ece15a01782b4f301c0c139d1d7b20f848914c'

* commit 'b9ece15a01782b4f301c0c139d1d7b20f848914c':
  nullenc: Use the wrapped avframe pseudo-encoder

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] nullenc: Use the wrapped avframe pseudo-encoder

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Fri Oct  9 
16:24:05 2015 +0200| [b9ece15a01782b4f301c0c139d1d7b20f848914c] | committer: 
Luca Barbato

nullenc: Use the wrapped avframe pseudo-encoder

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

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

diff --git a/libavformat/nullenc.c b/libavformat/nullenc.c
index 829f2a8..0da5940 100644
--- a/libavformat/nullenc.c
+++ b/libavformat/nullenc.c
@@ -30,7 +30,7 @@ AVOutputFormat ff_null_muxer = {
 .name  = "null",
 .long_name = NULL_IF_CONFIG_SMALL("raw null video"),
 .audio_codec   = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-.video_codec   = AV_CODEC_ID_RAWVIDEO,
+.video_codec   = AV_CODEC_ID_WRAPPED_AVFRAME,
 .write_packet  = null_write_packet,
-.flags = AVFMT_NOFILE | AVFMT_NOTIMESTAMPS | AVFMT_RAWPICTURE,
+.flags = AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
 };

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


[FFmpeg-cvslog] Merge commit 'c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
13:54:50 2015 +0200| [fcfb66ba9b6e8e8026fa38ea99e0458b31321217] | committer: 
Hendrik Leppkes

Merge commit 'c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b'

* commit 'c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b':
  build: add Solaris symbol versioning

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] build: add Solaris symbol versioning

2015-10-14 Thread Sean McGovern
ffmpeg | branch: master | Sean McGovern  | Wed Oct  7 
17:39:37 2015 -0400| [c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b] | committer: 
Luca Barbato

build: add Solaris symbol versioning

The versioning facility in the Solaris linker differs from Linux in 3 ways:

1. It does not support globs in linker scripts for
symbol versioning -- this is a GNU extension.

2. The linker argument is '-M', instead of '--version-script'.

3. It is picky about line endings.
Each symbol or directive must be on a line of it's own.

Let's use make_sunver.pl from GCC to generate a version script that works
correctly with the Solaris linker. It's function is to correctly expand the
globs in the original generated version script.

Signed-off-by: Luca Barbato 

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

 Makefile  |4 +-
 common.mak|2 +-
 compat/solaris/make_sunver.pl |  352 +
 configure |   10 +-
 4 files changed, 363 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index e9a95aa..a453be7 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,9 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
$(Q)echo '#include "$*.h"' >$@
 
 %.ver: %.v
-   $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
+   $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ | sed -e 
's/:/:\
+/' -e 's/; /;\
+/g' > $@
 
 %.c %.h: TAG = GEN
 
diff --git a/common.mak b/common.mak
index adab9d1..ed9cbd4 100644
--- a/common.mak
+++ b/common.mak
@@ -52,7 +52,7 @@ $(TOOLOBJS): | tools
 
 OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
 
-CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.gcno *.gcda
+CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ver-sol2 *.gcno *.gcda
 DISTCLEANSUFFIXES = *.pc
 LIBSUFFIXES   = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 
diff --git a/compat/solaris/make_sunver.pl b/compat/solaris/make_sunver.pl
new file mode 100755
index 000..929bdda
--- /dev/null
+++ b/compat/solaris/make_sunver.pl
@@ -0,0 +1,352 @@
+#!/usr/bin/perl -w
+
+# make_sunver.pl
+#
+#   Copyright (C) 2010, 2011, 2012, 2013
+#   Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.GPLv3.  If not see
+# .
+
+# This script takes at least two arguments, a GNU style version script and
+# a list of object and archive files, and generates a corresponding Sun
+# style version script as follows:
+#
+# Each glob pattern, C++ mangled pattern or literal in the input script is
+# matched against all global symbols in the input objects, emitting those
+# that matched (or nothing if no match was found).
+# A comment with the original pattern and its type is left in the output
+# file to make it easy to understand the matches.
+#
+# It uses elfdump when present (native), GNU readelf otherwise.
+# It depends on the GNU version of c++filt, since it must understand the
+# GNU mangling style.
+
+use FileHandle;
+use IPC::Open2;
+
+# Enforce C locale.
+$ENV{'LC_ALL'} = "C";
+$ENV{'LANG'} = "C";
+
+# Input version script, GNU style.
+my $symvers = shift;
+
+##
+# Get all the symbols from the library, match them, and add them to a hash.
+
+my %sym_hash = ();
+
+# List of objects and archives to process.
+my @OBJECTS = ();
+
+# List of shared objects to omit from processing.
+my @SHAREDOBJS = ();
+
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
+foreach $file (@ARGV) {
+if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
+printf STDERR "omitted $file -> $so\n";
+push (@SHAREDOBJS, $so);
+} else {
+push (@OBJECTS, $file);
+}
+}
+
+# We need to detect and ignore hidden symbols.  Solaris nm can only detect
+# this in the harder to parse default output format, and GNU nm not at all,
+# so use elfdump -s in the native case and GNU readelf -s otherwise.
+# GNU objdump -t cannot be used since it produces a variable number of
+# columns.
+
+# The path to elfdump.
+my $elfdump = "/usr/ccs/bin/elfdump";
+
+if (-f $elfdump) {
+open ELFDUMP,$elfdump.' -s '.(join ' ',@OBJECTS).'|' or die $!;
+my $skip_arsym = 0;
+
+while () {
+chomp;
+
+# Ignore empty lines.
+if (/^$/) {
+# End of archive s

[FFmpeg-cvslog] dict: Change return type of av_dict_copy()

2015-10-14 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Sun 
Oct  4 13:27:15 2015 +0200| [11c5f438ff83da5040e85bfa6299f56b321d32ef] | 
committer: Vittorio Giovara

dict: Change return type of av_dict_copy()

av_dict_set() could return an error, so forward it appropriately.

Signed-off-by: Vittorio Giovara 

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

 doc/APIchanges  |4 
 libavutil/dict.c|   11 ---
 libavutil/dict.h|4 +++-
 libavutil/version.h |2 +-
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 144eb79..26f8816 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2015-xx-xx - xxx - lavu 55.2.0 - dict.h
+  Change return type of av_dict_copy() from void to int, so that a proper
+  error code can be reported.
+
 2015-xx-xx - xxx - lavc 57.0.0 - avcodec.h
   Change type of AVPacket.duration from int to int64_t.
 
diff --git a/libavutil/dict.c b/libavutil/dict.c
index 7f48320..7213bf2 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -186,10 +186,15 @@ void av_dict_free(AVDictionary **pm)
 av_freep(pm);
 }
 
-void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
 {
 AVDictionaryEntry *t = NULL;
 
-while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
-av_dict_set(dst, t->key, t->value, flags);
+while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
+int ret = av_dict_set(dst, t->key, t->value, flags);
+if (ret < 0)
+return ret;
+}
+
+return 0;
 }
diff --git a/libavutil/dict.h b/libavutil/dict.h
index e4aee27..b3277ab 100644
--- a/libavutil/dict.h
+++ b/libavutil/dict.h
@@ -130,8 +130,10 @@ int av_dict_parse_string(AVDictionary **pm, const char 
*str,
  * @param src pointer to source AVDictionary struct
  * @param flags flags to use when setting entries in *dst
  * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ * @return 0 on success, negative AVERROR code on failure. If dst was allocated
+ *   by this function, callers should free the associated memory.
  */
-void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
 
 /**
  * Free all the memory allocated for an AVDictionary struct
diff --git a/libavutil/version.h b/libavutil/version.h
index 20059c4..14a1ded 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR  1
+#define LIBAVUTIL_VERSION_MINOR  2
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

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


[FFmpeg-cvslog] Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:01:11 2015 +0200| [b994788353ec39677d9f751da5cf754ef6247773] | committer: 
Hendrik Leppkes

Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'

* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef':
  dict: Change return type of av_dict_copy()

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] configure: Require libkvazaar < 0.7.

2015-10-14 Thread Carl Eugen Hoyos
ffmpeg | branch: release/2.8 | Carl Eugen Hoyos  | Wed Oct 14 
14:15:30 2015 +0200| [c2db8ebc083e5fa35def204321a225960beede84] | committer: 
Carl Eugen Hoyos

configure: Require libkvazaar < 0.7.

Fixes ticket #4925.

Reviewed-by: Arttu Ylä-Outinen

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

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

diff --git a/configure b/configure
index b661157..7f9fed3 100755
--- a/configure
+++ b/configure
@@ -5240,7 +5240,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && 
break;
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc
-enabled libkvazaar&& require_pkg_config kvazaar kvazaar.h kvz_api_get
+enabled libkvazaar&& require_pkg_config "kvazaar < 0.7.0" kvazaar.h 
kvz_api_get
 enabled libmfx&& require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
 enabled libmodplug&& require_pkg_config libmodplug 
libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h 
lame_set_VBR_quality -lmp3lame

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


[FFmpeg-cvslog] avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup

2015-10-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.8 | Michael Niedermayer  | 
Wed Sep 30 13:10:48 2015 +0200| [b46efcb2933c6adc11486104195dcd5054485246] | 
committer: Carl Eugen Hoyos

avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup

The variable is not a constant and can lead to race conditions

Fixes: repro.webm (not reproducable with FFmpeg alone)

Found-by: Dale Curtis 
Tested-by: Dale Curtis 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit dabea74d0e82ea80cd344f630497cafcb3ef872c)

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

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

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 730871a..cb0c7cd 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -164,7 +164,7 @@ int update_dimensions(VP8Context *s, int width, int height, 
int is_vp7)
 s->mb_height = (s->avctx->coded_height + 15) / 16;
 
 s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE &&
-   FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1;
+   avctx->thread_count > 1;
 if (!s->mb_layout) { // Frame threading and one thread
 s->macroblocks_base   = av_mallocz((s->mb_width + s->mb_height * 2 
+ 1) *
sizeof(*s->macroblocks));

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


[FFmpeg-cvslog] avconv: Add loop option.

2015-10-14 Thread Alexandra Hájková
ffmpeg | branch: master | Alexandra Hájková  | 
Fri Oct  9 22:11:56 2015 +0200| [16b0c929621f84983b83b9735ce973acb12723bc] | 
committer: Anton Khirnov

avconv: Add loop option.

Signed-off-by: Anton Khirnov 

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

 avconv.c|  107 ---
 avconv.h|8 +
 avconv_opt.c|8 +
 doc/avconv.texi |3 ++
 4 files changed, 121 insertions(+), 5 deletions(-)

diff --git a/avconv.c b/avconv.c
index 75b00f1..15836db 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1185,6 +1185,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, 
int *got_output)
 decoded_frame->pts = av_rescale_q(decoded_frame->pts,
   ist->st->time_base,
   (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;
@@ -1323,7 +1324,7 @@ static int send_filter_eof(InputStream *ist)
 }
 
 /* pkt = NULL means EOF (needed to flush decoder buffers) */
-static void process_input_packet(InputStream *ist, const AVPacket *pkt)
+static void process_input_packet(InputStream *ist, const AVPacket *pkt, int 
no_eof)
 {
 int i;
 int got_output;
@@ -1402,7 +1403,8 @@ static void process_input_packet(InputStream *ist, const 
AVPacket *pkt)
 }
 
 /* after flushing, send an EOF on all the filter inputs attached to the 
stream */
-if (!pkt && ist->decoding_needed) {
+/* except when looping we need to flush but not to send an EOF */
+if (!pkt && ist->decoding_needed && !no_eof) {
 int ret = send_filter_eof(ist);
 if (ret < 0) {
 av_log(NULL, AV_LOG_FATAL, "Error marking filters as finished\n");
@@ -2270,6 +2272,86 @@ static void reset_eagain(void)
 input_files[i]->eagain = 0;
 }
 
+// set duration to max(tmp, duration) in a proper time base and return 
duration's time_base
+static AVRational duration_max(int64_t tmp, int64_t *duration, AVRational 
tmp_time_base,
+AVRational time_base)
+{
+int ret;
+
+if (!*duration) {
+*duration = tmp;
+return tmp_time_base;
+}
+
+ret = av_compare_ts(*duration, time_base, tmp, tmp_time_base);
+if (ret < 0) {
+*duration = tmp;
+return tmp_time_base;
+}
+
+return time_base;
+}
+
+static int seek_to_start(InputFile *ifile, AVFormatContext *is)
+{
+InputStream *ist;
+AVCodecContext *avctx;
+int i, ret, has_audio = 0;
+int64_t duration = 0;
+
+ret = av_seek_frame(is, -1, is->start_time, 0);
+if (ret < 0)
+return ret;
+
+for (i = 0; i < ifile->nb_streams; i++) {
+ist   = input_streams[ifile->ist_index + i];
+avctx = ist->dec_ctx;
+
+// flush decoders
+if (ist->decoding_needed) {
+process_input_packet(ist, NULL, 1);
+avcodec_flush_buffers(avctx);
+}
+
+/* duration is the length of the last frame in a stream
+ * when audio stream is present we don't care about
+ * last video frame length because it's not defined exactly */
+if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && ist->nb_samples)
+has_audio = 1;
+}
+
+for (i = 0; i < ifile->nb_streams; i++) {
+ist   = input_streams[ifile->ist_index + i];
+avctx = ist->dec_ctx;
+
+if (has_audio) {
+if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && ist->nb_samples) {
+AVRational sample_rate = {1, avctx->sample_rate};
+
+duration = av_rescale_q(ist->nb_samples, sample_rate, 
ist->st->time_base);
+} else
+continue;
+} else {
+if (ist->framerate.num) {
+duration = av_rescale_q(1, ist->framerate, ist->st->time_base);
+} else if (ist->st->avg_frame_rate.num) {
+duration = av_rescale_q(1, ist->st->avg_frame_rate, 
ist->st->time_base);
+} else duration = 1;
+}
+if (!ifile->duration)
+ifile->time_base = ist->st->time_base;
+/* the total duration of the stream, max_pts - min_pts is
+ * the duration of the stream without the last frame */
+duration += ist->max_pts - ist->min_pts;
+ifile->time_base = duration_max(duration, &ifile->duration, 
ist->st->time_base,
+ifile->time_base);
+}
+
+ifile->loop--;
+
+return ret;
+}
+
 /*
  * Read one packet from an input file and send it for
  * - decoding -> lavfi (audio/video)
@@ -2289,6 +2371,7 @@ static int process_input(void)
 InputStream *ist;
 AVPacket pkt;
 int ret, i, j;
+int64_t duration;
 
 /* select the stream that we must read now */
 ifile = select_in

[FFmpeg-cvslog] Merge commit '16b0c929621f84983b83b9735ce973acb12723bc'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:28:20 2015 +0200| [9ccd90626f0ecef205faef1d25f0e3649d18e1b3] | committer: 
Hendrik Leppkes

Merge commit '16b0c929621f84983b83b9735ce973acb12723bc'

* commit '16b0c929621f84983b83b9735ce973acb12723bc':
  avconv: Add loop option.

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] Merge commit '34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:43:20 2015 +0200| [1899b2579993c4faca79cade01e374378db128dd] | committer: 
Hendrik Leppkes

Merge commit '34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e'

* commit '34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e':
  avformat: Do not use AVFMT_RAWPICTURE

Removal from ffmpeg.c not merged because some parts of avdevice
still use it

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] avformat: Do not use AVFMT_RAWPICTURE

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Mon Oct 12 
16:06:07 2015 +0200| [34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e] | committer: 
Luca Barbato

avformat: Do not use AVFMT_RAWPICTURE

There are no formats supporting it anymore and it is deprecated.
Update the documentation accordingly.

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

 avconv.c   |   72 +---
 doc/examples/output.c  |   42 
 libavformat/avformat.h |6 ++--
 libavformat/version.h  |3 ++
 4 files changed, 44 insertions(+), 79 deletions(-)

diff --git a/avconv.c b/avconv.c
index 15836db..23f6db6 100644
--- a/avconv.c
+++ b/avconv.c
@@ -452,7 +452,7 @@ static void do_video_out(AVFormatContext *s,
  AVFrame *in_picture,
  int *frame_size)
 {
-int ret, format_video_sync;
+int ret, format_video_sync, got_packet;
 AVPacket pkt;
 AVCodecContext *enc = ost->enc_ctx;
 
@@ -488,57 +488,37 @@ static void do_video_out(AVFormatContext *s,
 if (ost->frame_number >= ost->max_frames)
 return;
 
-if (s->oformat->flags & AVFMT_RAWPICTURE &&
-enc->codec->id == AV_CODEC_ID_RAWVIDEO) {
-/* raw pictures are written as AVPicture structure to
-   avoid any copies. We support temporarily the older
-   method. */
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
-enc->coded_frame->top_field_first  = in_picture->top_field_first;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-pkt.data   = (uint8_t *)in_picture;
-pkt.size   =  sizeof(AVPicture);
-pkt.pts= av_rescale_q(in_picture->pts, enc->time_base, 
ost->st->time_base);
-pkt.flags |= AV_PKT_FLAG_KEY;
+if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | 
AV_CODEC_FLAG_INTERLACED_ME) &&
+ost->top_field_first >= 0)
+in_picture->top_field_first = !!ost->top_field_first;
 
-write_frame(s, &pkt, ost);
-} else {
-int got_packet;
-
-if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | 
AV_CODEC_FLAG_INTERLACED_ME) &&
-ost->top_field_first >= 0)
-in_picture->top_field_first = !!ost->top_field_first;
-
-in_picture->quality = enc->global_quality;
-in_picture->pict_type = 0;
-if (ost->forced_kf_index < ost->forced_kf_count &&
-in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
-in_picture->pict_type = AV_PICTURE_TYPE_I;
-ost->forced_kf_index++;
-}
+in_picture->quality = enc->global_quality;
+in_picture->pict_type = 0;
+if (ost->forced_kf_index < ost->forced_kf_count &&
+in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
+in_picture->pict_type = AV_PICTURE_TYPE_I;
+ost->forced_kf_index++;
+}
 
-ost->frames_encoded++;
+ost->frames_encoded++;
 
-ret = avcodec_encode_video2(enc, &pkt, in_picture, &got_packet);
-if (ret < 0) {
-av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n");
-exit_program(1);
-}
+ret = avcodec_encode_video2(enc, &pkt, in_picture, &got_packet);
+if (ret < 0) {
+av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n");
+exit_program(1);
+}
 
-if (got_packet) {
-av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
-write_frame(s, &pkt, ost);
-*frame_size = pkt.size;
+if (got_packet) {
+av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
+write_frame(s, &pkt, ost);
+*frame_size = pkt.size;
 
-/* if two pass, output log */
-if (ost->logfile && enc->stats_out) {
-fprintf(ost->logfile, "%s", enc->stats_out);
-}
+/* if two pass, output log */
+if (ost->logfile && enc->stats_out) {
+fprintf(ost->logfile, "%s", enc->stats_out);
 }
 }
+
 ost->sync_opts++;
 /*
  * For video, number of frames in == number of packets out.
@@ -959,8 +939,6 @@ static void flush_encoders(void)
 
 if (enc->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <= 1)
 continue;
-if (enc->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & 
AVFMT_RAWPICTURE) && enc->codec->id == AV_CODEC_ID_RAWVIDEO)
-continue;
 
 for (;;) {
 int (*encode)(AVCodecContext*, AVPacket*, const AVFrame*, int*) = 
NULL;
diff --git a/doc/examples/output.c b/doc/examples/output.c
index af5445b..c883429 100644
--- a/doc/examples/output.c
+++ b/doc/examples/output.c
@@ -491,48 +491,30 @@ static int write_video_frame(AVFormatContext *oc, 
OutputStream *ost)
 int ret;
 AVCodecContext *c;
 AVFrame *frame;
+AVPacket pkt   = { 0 };
 int got_packet = 0;

[FFmpeg-cvslog] ffmpeg: add deprecation guards around remaining AVFMT_RAWPICTURE usage

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:46:40 2015 +0200| [a34dfc93efe380dd9c2b147e227caa14b063d32f] | committer: 
Hendrik Leppkes

ffmpeg: add deprecation guards around remaining AVFMT_RAWPICTURE usage

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

 ffmpeg.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index e121d55..36a68fb 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1099,6 +1099,7 @@ static void do_video_out(AVFormatContext *s,
 #endif
 return;
 
+#if FF_API_LAVF_FMT_RAWPICTURE
 if (s->oformat->flags & AVFMT_RAWPICTURE &&
 enc->codec->id == AV_CODEC_ID_RAWVIDEO) {
 /* raw pictures are written as AVPicture structure to
@@ -1114,7 +1115,9 @@ static void do_video_out(AVFormatContext *s,
 pkt.flags |= AV_PKT_FLAG_KEY;
 
 write_frame(s, &pkt, ost);
-} else {
+} else
+#endif
+{
 int got_packet, forced_keyframe = 0;
 double pts_time;
 
@@ -1704,8 +1707,10 @@ static void flush_encoders(void)
 
 if (enc->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <= 1)
 continue;
+#if FF_API_LAVF_FMT_RAWPICTURE
 if (enc->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & 
AVFMT_RAWPICTURE) && enc->codec->id == AV_CODEC_ID_RAWVIDEO)
 continue;
+#endif
 
 for (;;) {
 int (*encode)(AVCodecContext*, AVPacket*, const AVFrame*, int*) = 
NULL;
@@ -1880,6 +1885,7 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 }
 av_copy_packet_side_data(&opkt, pkt);
 
+#if FF_API_LAVF_FMT_RAWPICTURE
 if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
 ost->st->codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
 (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
@@ -1894,6 +1900,7 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 opkt.size = sizeof(AVPicture);
 opkt.flags |= AV_PKT_FLAG_KEY;
 }
+#endif
 
 write_frame(of->ctx, &opkt, ost);
 }

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


[FFmpeg-cvslog] ffmpeg: remove trailing whitespace that sneaked into the previous merge

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:51:49 2015 +0200| [435dfc15dfa91681c0e3dc8bd42f92af6bec2c8f] | committer: 
Hendrik Leppkes

ffmpeg: remove trailing whitespace that sneaked into the previous merge

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

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

diff --git a/ffmpeg.c b/ffmpeg.c
index 1b36583..e121d55 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3861,7 +3861,7 @@ static int process_input(int file_index)
 pkt.pts -= av_rescale_q(delta, AV_TIME_BASE_Q, 
ist->st->time_base);
 }
 }
-
+
 duration = av_rescale_q(ifile->duration, ifile->time_base, 
ist->st->time_base);
 if (pkt.pts != AV_NOPTS_VALUE) {
 pkt.pts += duration;

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


[FFmpeg-cvslog] Merge commit '17e41cf3614973258c24aa2452215ef7e3bfa5ed'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:54:04 2015 +0200| [628174990971e05277dc638876fc7f00052dbb8a] | committer: 
Hendrik Leppkes

Merge commit '17e41cf3614973258c24aa2452215ef7e3bfa5ed'

* commit '17e41cf3614973258c24aa2452215ef7e3bfa5ed':
  avcodec: Do not lock during init if there is no init function

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] avcodec: Do not lock during init if there is no init function

2015-10-14 Thread Derek Buitenhuis
ffmpeg | branch: master | Derek Buitenhuis  | Mon 
Oct 12 10:32:28 2015 -0400| [17e41cf3614973258c24aa2452215ef7e3bfa5ed] | 
committer: Luca Barbato

avcodec: Do not lock during init if there is no init function

Signed-off-by: Derek Buitenhuis 
Signed-off-by: Luca Barbato 

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

 libavcodec/utils.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a1aece7..430926d 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -845,7 +845,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext 
*avctx, const AVCodec *code
 av_dict_copy(&tmp, *options, 0);
 
 /* If there is a user-supplied mutex locking routine, call it. */
-if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE)) {
+if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) 
{
 if (lockmgr_cb) {
 if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
 return -1;
@@ -1086,7 +1086,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 }
 end:
-if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE)) {
+if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) 
{
 entangled_thread_counter--;
 
 /* Release any user-supplied mutex. */

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


[FFmpeg-cvslog] Merge commit '901f9c0a32985f48672fd68594111dc55d88a57a'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
14:56:16 2015 +0200| [9c3f75c29d2938bc3dd77a7733a11059ed2bc488] | committer: 
Hendrik Leppkes

Merge commit '901f9c0a32985f48672fd68594111dc55d88a57a'

* commit '901f9c0a32985f48672fd68594111dc55d88a57a':
  qtrle: Properly use AVFrame API

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] qtrle: Properly use AVFrame API

2015-10-14 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Oct 12 19:00:31 2015 +0200| [901f9c0a32985f48672fd68594111dc55d88a57a] | 
committer: Vittorio Giovara

qtrle: Properly use AVFrame API

Rather than copying data buffers around, just add a reference to
the current frame.

Signed-off-by: Vittorio Giovara 

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

 libavcodec/qtrleenc.c |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c
index 29deb21..bfd988a 100644
--- a/libavcodec/qtrleenc.c
+++ b/libavcodec/qtrleenc.c
@@ -37,7 +37,7 @@
 typedef struct QtrleEncContext {
 AVCodecContext *avctx;
 int pixel_size;
-AVPicture previous_frame;
+AVFrame *previous_frame;
 unsigned int max_buf_size;
 /**
  * This array will contain at ith position the value of the best RLE code
@@ -66,7 +66,7 @@ static av_cold int qtrle_encode_end(AVCodecContext *avctx)
 {
 QtrleEncContext *s = avctx->priv_data;
 
-avpicture_free(&s->previous_frame);
+av_frame_free(&s->previous_frame);
 av_free(s->rlecode_table);
 av_free(s->length_table);
 av_free(s->skip_table);
@@ -105,7 +105,8 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
 av_log(avctx, AV_LOG_ERROR, "Error allocating memory.\n");
 return -1;
 }
-if (avpicture_alloc(&s->previous_frame, avctx->pix_fmt, avctx->width, 
avctx->height) < 0) {
+s->previous_frame = av_frame_alloc();
+if (!s->previous_frame) {
 av_log(avctx, AV_LOG_ERROR, "Error allocating picture\n");
 return -1;
 }
@@ -146,7 +147,7 @@ static void qtrle_encode_line(QtrleEncContext *s, const 
AVFrame *p, int line, ui
 
 uint8_t *this_line = p->   data[0] + line*p->   
linesize[0] +
 (width - 1)*s->pixel_size;
-uint8_t *prev_line = s->previous_frame.data[0] + 
line*s->previous_frame.linesize[0] +
+uint8_t *prev_line = s->previous_frame->data[0] + line * 
s->previous_frame->linesize[0] +
 (width - 1)*s->pixel_size;
 
 s->length_table[width] = 0;
@@ -262,13 +263,13 @@ static int encode_frame(QtrleEncContext *s, const AVFrame 
*p, uint8_t *buf)
 unsigned line_size = s->avctx->width * s->pixel_size;
 for (start_line = 0; start_line < s->avctx->height; start_line++)
 if (memcmp(p->data[0] + start_line*p->linesize[0],
-   s->previous_frame.data[0] + 
start_line*s->previous_frame.linesize[0],
+   s->previous_frame->data[0] + start_line * 
s->previous_frame->linesize[0],
line_size))
 break;
 
 for (end_line=s->avctx->height; end_line > start_line; end_line--)
 if (memcmp(p->data[0] + (end_line - 1)*p->linesize[0],
-   s->previous_frame.data[0] + (end_line - 
1)*s->previous_frame.linesize[0],
+   s->previous_frame->data[0] + (end_line - 1) * 
s->previous_frame->linesize[0],
line_size))
 break;
 }
@@ -318,8 +319,12 @@ static int qtrle_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 pkt->size = encode_frame(s, pict, pkt->data);
 
 /* save the current frame */
-av_picture_copy(&s->previous_frame, (const AVPicture *)pict,
-avctx->pix_fmt, avctx->width, avctx->height);
+av_frame_unref(s->previous_frame);
+ret = av_frame_ref(s->previous_frame, pict);
+if (ret < 0) {
+av_log(avctx, AV_LOG_ERROR, "cannot add reference\n");
+return ret;
+}
 
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS

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


[FFmpeg-cvslog] libschroedinger: Properly use AVFrame API

2015-10-14 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Oct 12 18:54:52 2015 +0200| [6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3] | 
committer: Vittorio Giovara

libschroedinger: Properly use AVFrame API

Rather than copying data buffers around, allocate a proper frame, and
use the standard AVFrame functions. This effectively makes the decoder
capable of direct rendering.

Signed-off-by: Vittorio Giovara 

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

 libavcodec/libschroedinger.c|   21 +++--
 libavcodec/libschroedingerdec.c |2 +-
 libavcodec/libschroedingerenc.c |   30 --
 3 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c
index 157433e..16e0fe8 100644
--- a/libavcodec/libschroedinger.c
+++ b/libavcodec/libschroedinger.c
@@ -26,6 +26,7 @@
 #include "libavutil/attributes.h"
 #include "libavutil/mem.h"
 #include "libschroedinger.h"
+#include "internal.h"
 
 static const SchroVideoFormatInfo ff_schro_video_format_info[] = {
 { 640,  480,  24000, 1001},
@@ -167,19 +168,14 @@ int ff_get_schro_frame_format (SchroChromaFormat 
schro_pix_fmt,
 
 static void free_schro_frame(SchroFrame *frame, void *priv)
 {
-AVPicture *p_pic = priv;
-
-if (!p_pic)
-return;
-
-avpicture_free(p_pic);
-av_freep(&p_pic);
+AVFrame *p_pic = priv;
+av_frame_free(&p_pic);
 }
 
 SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
   SchroFrameFormat schro_frame_fmt)
 {
-AVPicture *p_pic;
+AVFrame *p_pic;
 SchroFrame *p_frame;
 int y_width, uv_width;
 int y_height, uv_height;
@@ -190,10 +186,15 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
 uv_width  = y_width  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));
 uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
 
-p_pic = av_mallocz(sizeof(AVPicture));
+p_pic = av_frame_alloc();
 if (!p_pic)
 return NULL;
-avpicture_alloc(p_pic, avctx->pix_fmt, y_width, y_height);
+
+if (ff_get_buffer(avctx, p_pic, AV_GET_BUFFER_FLAG_REF) < 0) {
+av_frame_free(&p_pic);
+av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
+return NULL;
+}
 
 p_frame = schro_frame_new();
 p_frame->format = schro_frame_fmt;
diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c
index d2594c6..cb7374c 100644
--- a/libavcodec/libschroedingerdec.c
+++ b/libavcodec/libschroedingerdec.c
@@ -387,6 +387,6 @@ AVCodec ff_libschroedinger_decoder = {
 .init   = libschroedinger_decode_init,
 .close  = libschroedinger_decode_close,
 .decode = libschroedinger_decode_frame,
-.capabilities   = AV_CODEC_CAP_DELAY,
+.capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
 .flush  = libschroedinger_flush,
 };
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c
index ecf5e37..f390e46 100644
--- a/libavcodec/libschroedingerenc.c
+++ b/libavcodec/libschroedingerenc.c
@@ -32,6 +32,8 @@
 #include 
 
 #include "libavutil/attributes.h"
+#include "libavutil/imgutils.h"
+
 #include "avcodec.h"
 #include "internal.h"
 #include "libschroedinger.h"
@@ -154,9 +156,9 @@ static av_cold int 
libschroedinger_encode_init(AVCodecContext *avctx)
 p_schro_params->format->frame_rate_numerator   = avctx->time_base.den;
 p_schro_params->format->frame_rate_denominator = avctx->time_base.num;
 
-p_schro_params->frame_size = avpicture_get_size(avctx->pix_fmt,
-avctx->width,
-avctx->height);
+p_schro_params->frame_size = av_image_get_buffer_size(avctx->pix_fmt,
+  avctx->width,
+  avctx->height, 1);
 
 if (!avctx->gop_size) {
 schro_encoder_setting_set_double(p_schro_params->encoder,
@@ -233,17 +235,17 @@ static SchroFrame 
*libschroedinger_frame_from_data(AVCodecContext *avctx,
const AVFrame *frame)
 {
 SchroEncoderParams *p_schro_params = avctx->priv_data;
-SchroFrame *in_frame;
-/* Input line size may differ from what the codec supports. Especially
- * when transcoding from one format to another. So use avpicture_layout
- * to copy the frame. */
-in_frame = ff_create_schro_frame(avctx, p_schro_params->frame_format);
-
-if (in_frame)
-avpicture_layout((const AVPicture *)frame, avctx->pix_fmt,
-  avctx->width, avctx->height,
-  in_frame->components[0].data,
-  p_schro_params->frame_size);
+SchroFrame *in_frame = ff_create_schro_frame(avctx,
+  

[FFmpeg-cvslog] Merge commit '6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
15:00:53 2015 +0200| [3d93ff289e0421d71cd63e246727d8ace256f27d] | committer: 
Hendrik Leppkes

Merge commit '6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3'

* commit '6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3':
  libschroedinger: Properly use AVFrame API

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] mimic: drop AVPicture usage

2015-10-14 Thread wm4
ffmpeg | branch: master | wm4  | Tue Oct 13 14:48:55 
2015 +0200| [6a23a34274b747280c1e4a00ad22f97f99bbb48a] | committer: Vittorio 
Giovara

mimic: drop AVPicture usage

Work on the AVFrame references directly.

Instead of setting up a flipped/swapped "view" on the pictures,
flip/swap them when returning decoded frames to the API user.

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

 libavcodec/mimic.c |   31 ++-
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 6c4fc8a..379cffc 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -48,7 +48,6 @@ typedef struct MimicContext {
 int prev_index;
 
 ThreadFrame frames [16];
-AVPicture   flipped_ptrs[16];
 
 DECLARE_ALIGNED(16, int16_t, dct_block)[64];
 
@@ -177,8 +176,6 @@ static int 
mimic_decode_update_thread_context(AVCodecContext *avctx, const AVCod
 dst->cur_index  = src->next_cur_index;
 dst->prev_index = src->next_prev_index;
 
-memcpy(dst->flipped_ptrs, src->flipped_ptrs, sizeof(src->flipped_ptrs));
-
 for (i = 0; i < FF_ARRAY_ELEMS(dst->frames); i++) {
 ff_thread_release_buffer(avctx, &dst->frames[i]);
 if (src->frames[i].f->data[0]) {
@@ -281,9 +278,9 @@ static int decode(MimicContext *ctx, int quality, int 
num_coeffs,
 const int is_chroma = !!plane;
 const int qscale= av_clip(1 - quality, is_chroma ? 1000 : 2000,
   1) << 2;
-const int stride= ctx->flipped_ptrs[ctx->cur_index 
].linesize[plane];
-const uint8_t *src  = ctx->flipped_ptrs[ctx->prev_index].data[plane];
-uint8_t   *dst  = ctx->flipped_ptrs[ctx->cur_index ].data[plane];
+const int stride= ctx->frames[ctx->cur_index ].f->linesize[plane];
+const uint8_t *src  = ctx->frames[ctx->prev_index].f->data[plane];
+uint8_t   *dst  = ctx->frames[ctx->cur_index ].f->data[plane];
 
 for (y = 0; y < ctx->num_vblocks[plane]; y++) {
 for (x = 0; x < ctx->num_hblocks[plane]; x++) {
@@ -306,13 +303,13 @@ static int decode(MimicContext *ctx, int quality, int 
num_coeffs,
 } else {
 unsigned int backref = get_bits(&ctx->gb, 4);
 int index= (ctx->cur_index + backref) & 15;
-uint8_t *p   = 
ctx->flipped_ptrs[index].data[0];
+uint8_t *p   = ctx->frames[index].f->data[0];
 
 if (index != ctx->cur_index && p) {
 ff_thread_await_progress(&ctx->frames[index],
  cur_row, 0);
 p += src -
- 
ctx->flipped_ptrs[ctx->prev_index].data[plane];
+ ctx->frames[ctx->prev_index].f->data[plane];
 ctx->hdsp.put_pixels_tab[1][0](dst, p, stride, 8);
 } else {
 av_log(ctx->avctx, AV_LOG_ERROR,
@@ -339,17 +336,18 @@ static int decode(MimicContext *ctx, int quality, int 
num_coeffs,
 }
 
 /**
- * Flip the buffer upside-down and put it in the YVU order to match the
+ * Flip the buffer upside-down and put it in the YVU order to revert the
  * way Mimic encodes frames.
  */
-static void prepare_avpic(MimicContext *ctx, AVPicture *dst, AVFrame *src)
+static void flip_swap_frame(AVFrame *f)
 {
 int i;
-dst->data[0] = src->data[0] + ( ctx->avctx->height   - 1) * 
src->linesize[0];
-dst->data[1] = src->data[2] + ((ctx->avctx->height >> 1) - 1) * 
src->linesize[2];
-dst->data[2] = src->data[1] + ((ctx->avctx->height >> 1) - 1) * 
src->linesize[1];
+uint8_t *data_1 = f->data[1];
+f->data[0] = f->data[0] + ( f->height   - 1) * f->linesize[0];
+f->data[1] = f->data[2] + ((f->height >> 1) - 1) * f->linesize[2];
+f->data[2] = data_1 + ((f->height >> 1) - 1) * f->linesize[1];
 for (i = 0; i < 3; i++)
-dst->linesize[i] = -src->linesize[i];
+f->linesize[i] *= -1;
 }
 
 static int mimic_decode_frame(AVCodecContext *avctx, void *data,
@@ -419,9 +417,6 @@ static int mimic_decode_frame(AVCodecContext *avctx, void 
*data,
 ctx->next_prev_index = ctx->cur_index;
 ctx->next_cur_index  = (ctx->cur_index - 1) & 15;
 
-prepare_avpic(ctx, &ctx->flipped_ptrs[ctx->cur_index],
-  ctx->frames[ctx->cur_index].f);
-
 ff_thread_finish_setup(avctx);
 
 av_fast_padded_malloc(&ctx->swap_buf, &ctx->swap_buf_size, swap_buf_size);
@@ -446,6 +441,8 @@ static int mimic_decode_frame(AVCodecContext *avctx, void 
*data,
 return res;
 *got_frame  = 1;
 
+flip_swap_frame(data);
+
 ctx->prev_index = ctx->next_prev_index;
 ctx->cur_index  = ctx->next_cur_index;
 

__

[FFmpeg-cvslog] Merge commit '6a23a34274b747280c1e4a00ad22f97f99bbb48a'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
15:01:54 2015 +0200| [8ededd583622359062622cf008144a1511d50bbd] | committer: 
Hendrik Leppkes

Merge commit '6a23a34274b747280c1e4a00ad22f97f99bbb48a'

* commit '6a23a34274b747280c1e4a00ad22f97f99bbb48a':
  mimic: drop AVPicture usage

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] avfilter/all: propagate errors of functions from avfilter/formats

2015-10-14 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Sun Oct 
 4 23:39:25 2015 -0400| [6aaac24d72a7da631173209841a3944fcb4a3309] | committer: 
Ganesh Ajjanagadde

avfilter/all: propagate errors of functions from avfilter/formats

Many of the functions from avfilter/formats can return errors, usually 
AVERROR(ENOMEM).
This propagates the return values.

All of these were found by using av_warn_unused_result, demonstrating its 
utility.

Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it 
should
react to errors.

Fixes: CID 1325680, 1325679, 1325678.

Reviewed-by: Michael Niedermayer 
Previous version Reviewed-by: Nicolas George 
Previous version Reviewed-by: Clément Bœsch 
Signed-off-by: Ganesh Ajjanagadde 

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

 libavfilter/aeval.c|   28 +-
 libavfilter/af_aformat.c   |   14 +
 libavfilter/af_agate.c |3 +-
 libavfilter/af_amerge.c|   21 --
 libavfilter/af_amix.c  |7 +++--
 libavfilter/af_aresample.c |   29 ---
 libavfilter/af_astreamsync.c   |   17 ++-
 libavfilter/af_channelmap.c|   17 +--
 libavfilter/af_channelsplit.c  |   17 ++-
 libavfilter/af_earwax.c|   12 
 libavfilter/af_extrastereo.c   |   12 
 libavfilter/af_join.c  |   17 +--
 libavfilter/af_pan.c   |   20 +++--
 libavfilter/af_replaygain.c|   20 +++--
 libavfilter/af_resample.c  |   31 +++-
 libavfilter/af_sidechaincompress.c |   19 
 libavfilter/af_stereotools.c   |   13 -
 libavfilter/af_stereowiden.c   |   12 
 libavfilter/asrc_anullsrc.c|8 --
 libavfilter/asrc_flite.c   |   14 +
 libavfilter/avf_aphasemeter.c  |   21 ++
 libavfilter/avf_avectorscope.c |   21 ++
 libavfilter/avf_concat.c   |   25 
 libavfilter/avf_showcqt.c  |   21 ++
 libavfilter/avf_showfreqs.c|   21 ++
 libavfilter/avf_showspectrum.c |   21 ++
 libavfilter/avf_showvolume.c   |   21 ++
 libavfilter/avf_showwaves.c|   21 ++
 libavfilter/avfiltergraph.c|   24 +++-
 libavfilter/buffersink.c   |   35 ++
 libavfilter/buffersrc.c|   24 +---
 libavfilter/drawutils.c|6 ++--
 libavfilter/f_drawgraph.c  |6 ++--
 libavfilter/f_ebur128.c|   27 -
 libavfilter/formats.c  |   56 ++--
 libavfilter/src_movie.c|   16 +++
 libavfilter/vf_alphamerge.c|   15 ++
 libavfilter/vf_boxblur.c   |7 +++--
 libavfilter/vf_crop.c  |7 +++--
 libavfilter/vf_detelecine.c|7 +++--
 libavfilter/vf_displace.c  |3 +-
 libavfilter/vf_elbg.c  |6 ++--
 libavfilter/vf_extractplanes.c |8 --
 libavfilter/vf_fieldorder.c|9 +++---
 libavfilter/vf_frei0r.c|7 +++--
 libavfilter/vf_hflip.c |7 +++--
 libavfilter/vf_histogram.c |7 +++--
 libavfilter/vf_il.c|8 --
 libavfilter/vf_maskedmerge.c   |3 +-
 libavfilter/vf_mergeplanes.c   |   15 ++
 libavfilter/vf_neighbor.c  |3 +-
 libavfilter/vf_noise.c |7 +++--
 libavfilter/vf_overlay.c   |   28 +++---
 libavfilter/vf_palettegen.c|6 ++--
 libavfilter/vf_paletteuse.c|8 --
 libavfilter/vf_scale.c |8 +++---
 libavfilter/vf_showpalette.c   |6 ++--
 libavfilter/vf_stack.c |7 +++--
 libavfilter/vf_swapuv.c|6 ++--
 libavfilter/vf_telecine.c  |7 +++--
 libavfilter/vf_transpose.c |7 +++--
 libavfilter/vf_vectorscope.c   |8 --
 libavfilter/vsrc_life.c|5 +---
 63 files changed, 476 insertions(+), 436 deletions(-)

diff --git a/libavfilter/aeval.c b/libavfilter/aeval.c
index b6c420a..ac9dea8 100644
--- a/libavfilter/aeval.c
+++ b/libavfilter/aeval.c
@@ -350,36 +350,34 @@ static int aeval_query_formats(AVFilterContext *ctx)
 static const enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE
 };
+int ret;
 
 // inlink supports any channel layout
 layouts = ff_all_channel_counts();
-ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
+if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) 
< 0)
+return ret;
 
 if (eval->same_chlayout) {
 layouts 

[FFmpeg-cvslog] avfilter/formats: add av_warn_unused_result to function prototypes

2015-10-14 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Mon Oct 
 5 09:20:33 2015 -0400| [bf0d2d6030c239f91e0368a20fb2dc0705bfec99] | committer: 
Ganesh Ajjanagadde

avfilter/formats: add av_warn_unused_result to function prototypes

This uses the av_warn_unused_result attribute liberally to catch some forms of 
improper
usage of functions defined in avfilter/formats.h.

Reviewed-by: Nicolas George 
Signed-off-by: Ganesh Ajjanagadde 

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

 libavfilter/formats.h |   17 +
 1 file changed, 17 insertions(+)

diff --git a/libavfilter/formats.h b/libavfilter/formats.h
index 5a8ee5e..3d730f3 100644
--- a/libavfilter/formats.h
+++ b/libavfilter/formats.h
@@ -125,15 +125,20 @@ AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
  * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct --
  * representing any channel layout (with known disposition)/sample rate.
  */
+av_warn_unused_result
 AVFilterChannelLayouts *ff_all_channel_layouts(void);
+
+av_warn_unused_result
 AVFilterFormats *ff_all_samplerates(void);
 
 /**
  * Construct an AVFilterChannelLayouts coding for any channel layout, with
  * known or unknown disposition.
  */
+av_warn_unused_result
 AVFilterChannelLayouts *ff_all_channel_counts(void);
 
+av_warn_unused_result
 AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
 
 
@@ -142,8 +147,10 @@ AVFilterChannelLayouts *avfilter_make_format64_list(const 
int64_t *fmts);
  * layouts/sample rates. If there are no links hooked to this filter, the list
  * is freed.
  */
+av_warn_unused_result
 int ff_set_common_channel_layouts(AVFilterContext *ctx,
   AVFilterChannelLayouts *layouts);
+av_warn_unused_result
 int ff_set_common_samplerates(AVFilterContext *ctx,
   AVFilterFormats *samplerates);
 
@@ -152,13 +159,16 @@ int ff_set_common_samplerates(AVFilterContext *ctx,
  * formats. If there are no links hooked to this filter, the list of formats is
  * freed.
  */
+av_warn_unused_result
 int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
 
+av_warn_unused_result
 int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
 
 /**
  * Add *ref as a new reference to f.
  */
+av_warn_unused_result
 int ff_channel_layouts_ref(AVFilterChannelLayouts *f,
AVFilterChannelLayouts **ref);
 
@@ -170,6 +180,7 @@ void ff_channel_layouts_unref(AVFilterChannelLayouts **ref);
 void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
   AVFilterChannelLayouts **newref);
 
+av_warn_unused_result
 int ff_default_query_formats(AVFilterContext *ctx);
 
 /**
@@ -178,6 +189,7 @@ int ff_default_query_formats(AVFilterContext *ctx);
  * accepts channel layouts with unknown disposition. It should only be used
  * with audio filters.
  */
+av_warn_unused_result
 int ff_query_formats_all(AVFilterContext *ctx);
 
 
@@ -188,6 +200,7 @@ int ff_query_formats_all(AVFilterContext *ctx);
  * @param fmts list of media formats, terminated by -1
  * @return the format list, with no existing references
  */
+av_warn_unused_result
 AVFilterFormats *ff_make_format_list(const int *fmts);
 
 /**
@@ -198,16 +211,19 @@ AVFilterFormats *ff_make_format_list(const int *fmts);
  * @return a non negative value in case of success, or a negative
  * value corresponding to an AVERROR code in case of error
  */
+av_warn_unused_result
 int ff_add_format(AVFilterFormats **avff, int64_t fmt);
 
 /**
  * Return a list of all formats supported by FFmpeg for the given media type.
  */
+av_warn_unused_result
 AVFilterFormats *ff_all_formats(enum AVMediaType type);
 
 /**
  * Construct a formats list containing all planar sample formats.
  */
+av_warn_unused_result
 AVFilterFormats *ff_planar_sample_fmts(void);
 
 /**
@@ -233,6 +249,7 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, 
AVFilterFormats *b,
  *  | || || ||
  *  |||
  */
+av_warn_unused_result
 int ff_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
 
 /**

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


[FFmpeg-cvslog] doc/filters: fix selectivecolor example

2015-10-14 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Wed Oct 14 
16:34:41 2015 +0200| [c793a271d567e961a3643513adc0463f5b97485b] | committer: 
Clément Bœsch

doc/filters: fix selectivecolor example

Fixes Ticket #4927

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

 doc/filters.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 34008e5..f58f014 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -13097,7 +13097,7 @@ pixels of its range.
 
 @itemize
 @item
-Increase cyan by 55% and reduce yellow by 33% in every green areas, and
+Increase cyan by 50% and reduce yellow by 33% in every green areas, and
 increase magenta by 27% in blue areas:
 @example
 selectivecolor=greens=.5 0 -.33 0:blues=0 .27

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


[FFmpeg-cvslog] lavf/vc1dec: Autodetect raw vc-1 streams.

2015-10-14 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Wed Oct 14 
16:40:57 2015 +0200| [1f2c474cb214b94a31b23967d334fea96dda62e5] | committer: 
Carl Eugen Hoyos

lavf/vc1dec: Autodetect raw vc-1 streams.

Move the demuxer into its own file.

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

 libavformat/Makefile  |2 +-
 libavformat/rawdec.c  |4 ---
 libavformat/vc1dec.c  |   81 +
 libavformat/version.h |2 +-
 4 files changed, 83 insertions(+), 6 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2971912..d118019 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -440,7 +440,7 @@ OBJS-$(CONFIG_TTA_DEMUXER)   += tta.o apetag.o 
img2.o
 OBJS-$(CONFIG_TTY_DEMUXER)   += tty.o sauce.o
 OBJS-$(CONFIG_TXD_DEMUXER)   += txd.o
 OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o
-OBJS-$(CONFIG_VC1_DEMUXER)   += rawdec.o
+OBJS-$(CONFIG_VC1_DEMUXER)   += rawdec.o vc1dec.o
 OBJS-$(CONFIG_VC1_MUXER) += rawenc.o
 OBJS-$(CONFIG_VC1T_DEMUXER)  += vc1test.o
 OBJS-$(CONFIG_VC1T_MUXER)+= vc1testenc.o
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 16fb221..7098ebd 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -205,7 +205,3 @@ static int mjpeg_probe(AVProbeData *p)
 
 FF_DEF_RAWVIDEO_DEMUXER2(mjpeg, "raw MJPEG video", mjpeg_probe, 
"mjpg,mjpeg,mpo", AV_CODEC_ID_MJPEG, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
 #endif
-
-#if CONFIG_VC1_DEMUXER
-FF_DEF_RAWVIDEO_DEMUXER2(vc1, "raw VC-1", NULL, "vc1", AV_CODEC_ID_VC1, 
AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
-#endif
diff --git a/libavformat/vc1dec.c b/libavformat/vc1dec.c
new file mode 100644
index 000..33f8465
--- /dev/null
+++ b/libavformat/vc1dec.c
@@ -0,0 +1,81 @@
+/*
+ * VC-1 demuxer
+ * Copyright (c) 2015 Carl Eugen Hoyos
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawdec.h"
+#include "libavutil/intreadwrite.h"
+#include "libavcodec/vc1_common.h"
+
+static int vc1_probe(AVProbeData *p)
+{
+int seq = 0, entry = 0, frame = 0, i;
+
+for (i = 0; i < p->buf_size + 5; i++) {
+uint32_t code = AV_RB32(p->buf + i);
+if ((code & 0xffe0) == 0x100) {
+int type = code & 0x11f;
+i += 4;
+switch (type) {
+case VC1_CODE_SEQHDR: {
+int profile, level, chromaformat;
+profile = (p->buf[i] & 0xc0) >> 6;
+if (profile != PROFILE_ADVANCED) {
+seq = 0;
+continue;
+}
+level = (p->buf[i] & 0x38) >> 3;
+if (level >= 5) {
+seq = 0;
+continue;
+}
+chromaformat = (p->buf[i] & 0x6) >> 1;
+if (chromaformat != 1) {
+seq = 0;
+continue;
+}
+seq++;
+i += 6;
+break;
+}
+case VC1_CODE_ENTRYPOINT:
+if (!seq)
+continue;
+entry++;
+i += 2;
+break;
+case VC1_CODE_FRAME:
+case VC1_CODE_FIELD:
+case VC1_CODE_SLICE:
+if (seq && entry)
+frame++;
+break;
+}
+}
+}
+
+if (frame > 1)
+return AVPROBE_SCORE_EXTENSION / 2 + 1;
+if (frame == 1)
+return AVPROBE_SCORE_EXTENSION / 4;
+return 0;
+}
+
+FF_DEF_RAWVIDEO_DEMUXER2(vc1, "raw VC-1", vc1_probe, "vc1", AV_CODEC_ID_VC1, 
AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
diff --git a/libavformat/version.h b/libavformat/version.h
index 7e70663..e365636 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
 #define LIBAVFORMAT_VERSION_MINOR   3
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

[FFmpeg-cvslog] Remove test file that accidentally ended up in one commit

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
17:06:07 2015 +0200| [2d0a10e369f133540bc8770ba702a3ad97821f59] | committer: 
Hendrik Leppkes

Remove test file that accidentally ended up in one commit

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

 tst.avi |  Bin 1067722 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/tst.avi b/tst.avi
deleted file mode 100644
index dffeab8..000
Binary files a/tst.avi and /dev/null differ

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


[FFmpeg-cvslog] avutil/intmath: use de Bruijn based ff_ctz

2015-10-14 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Wed Oct 
14 10:26:59 2015 -0400| [55d3e97970888baa173061704a085144c5a014b4] | committer: 
Ronald S. Bultje

avutil/intmath: use de Bruijn based ff_ctz

It has already been demonstrated that the de Bruijn method has benefits
over the current implementation: commit 
971d12b7f9d7be3ca8eb98e6c04ed521f83cbd3c.
That commit implemented it for long long, this extends it to the int version.

Tested with FATE.

Signed-off-by: Ganesh Ajjanagadde 
Signed-off-by: Ronald S. Bultje 

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

 libavutil/intmath.h |   32 +++-
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/libavutil/intmath.h b/libavutil/intmath.h
index 802abe3..5a55123 100644
--- a/libavutil/intmath.h
+++ b/libavutil/intmath.h
@@ -129,33 +129,15 @@ static av_always_inline av_const int 
ff_log2_16bit_c(unsigned int v)
  * @return   the number of trailing 0-bits
  */
 #if !defined( _MSC_VER )
+/* We use the De-Bruijn method outlined in:
+ * http://supertech.csail.mit.edu/papers/debruijn.pdf. */
 static av_always_inline av_const int ff_ctz_c(int v)
 {
-int c;
-
-if (v & 0x1)
-return 0;
-
-c = 1;
-if (!(v & 0x)) {
-v >>= 16;
-c += 16;
-}
-if (!(v & 0xff)) {
-v >>= 8;
-c += 8;
-}
-if (!(v & 0xf)) {
-v >>= 4;
-c += 4;
-}
-if (!(v & 0x3)) {
-v >>= 2;
-c += 2;
-}
-c -= v & 0x1;
-
-return c;
+static const uint8_t debruijn_ctz32[32] = {
+0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
+31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
+};
+return debruijn_ctz32[(uint32_t)((v & -v) * 0x077CB531U) >> 27];
 }
 #else
 static av_always_inline av_const int ff_ctz_c( int v )

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


[FFmpeg-cvslog] avutil/fifo: add function av_fifo_generic_peek_at()

2015-10-14 Thread Zhang Rui
ffmpeg | branch: master | Zhang Rui  | Wed Oct 14 14:20:07 
2015 +0800| [87ff61b9abde99d8cdc2a4332b41f69a80eb3d56] | committer: Michael 
Niedermayer

avutil/fifo: add function av_fifo_generic_peek_at()

Signed-off-by: Michael Niedermayer 

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

 libavutil/fifo.c|   61 +++
 libavutil/fifo.h|   11 ++
 tests/ref/fate/fifo |   27 +++
 3 files changed, 99 insertions(+)

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 1a22708..7bd48a2 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -148,6 +148,44 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int 
size,
 return total - size;
 }
 
+int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int 
buf_size, void (*func)(void*, void*, int))
+{
+uint8_t *rptr = f->rptr;
+
+av_assert2(offset >= 0);
+
+/*
+ * *ndx are indexes modulo 2^32, they are intended to overflow,
+ * to handle *ndx greater than 4gb.
+ */
+av_assert2(buf_size + (unsigned)offset <= f->wndx - f->rndx);
+
+if (offset >= f->end - rptr)
+rptr += offset - (f->end - f->buffer);
+else
+rptr += offset;
+
+while (buf_size > 0) {
+int len;
+
+if (rptr >= f->end)
+rptr -= f->end - f->buffer;
+
+len = FFMIN(f->end - rptr, buf_size);
+if (func)
+func(dest, rptr, len);
+else {
+memcpy(dest, rptr, len);
+dest = (uint8_t *)dest + len;
+}
+
+buf_size -= len;
+rptr += len;
+}
+
+return 0;
+}
+
 int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size,
  void (*func)(void *, void *, int))
 {
@@ -221,6 +259,14 @@ int main(void)
 }
 printf("\n");
 
+/* peek_at at FIFO */
+n = av_fifo_size(fifo) / sizeof(int);
+for (i = 0; i < n; i++) {
+av_fifo_generic_peek_at(fifo, &j, i * sizeof(int), sizeof(j), NULL);
+printf("%d: %d\n", i, j);
+}
+printf("\n");
+
 /* read data */
 for (i = 0; av_fifo_size(fifo) >= sizeof(int); i++) {
 av_fifo_generic_read(fifo, &j, sizeof(int), NULL);
@@ -228,6 +274,21 @@ int main(void)
 }
 printf("\n");
 
+/* test *ndx overflow */
+av_fifo_reset(fifo);
+fifo->rndx = fifo->wndx = ~(uint32_t)0 - 5;
+
+/* fill data */
+for (i = 0; av_fifo_space(fifo) >= sizeof(int); i++)
+av_fifo_generic_write(fifo, &i, sizeof(int), NULL);
+
+/* peek_at at FIFO */
+n = av_fifo_size(fifo) / sizeof(int);
+for (i = 0; i < n; i++) {
+av_fifo_generic_peek_at(fifo, &j, i * sizeof(int), sizeof(j), NULL);
+printf("%d: %d\n", i, j);
+}
+
 av_fifo_free(fifo);
 
 return 0;
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 0e4070b..dc7bc6f 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -84,6 +84,17 @@ int av_fifo_size(const AVFifoBuffer *f);
 int av_fifo_space(const AVFifoBuffer *f);
 
 /**
+ * Feed data at specific position from an AVFifoBuffer to a user-supplied 
callback.
+ * Similar as av_fifo_gereric_read but without discarding data.
+ * @param f AVFifoBuffer to read from
+ * @param offset offset from current read position
+ * @param buf_size number of bytes to read
+ * @param func generic read function
+ * @param dest data destination
+ */
+int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int 
buf_size, void (*func)(void*, void*, int));
+
+/**
  * Feed data from an AVFifoBuffer to a user-supplied callback.
  * Similar as av_fifo_gereric_read but without discarding data.
  * @param f AVFifoBuffer to read from
diff --git a/tests/ref/fate/fifo b/tests/ref/fate/fifo
index 18a5691..162d754 100644
--- a/tests/ref/fate/fifo
+++ b/tests/ref/fate/fifo
@@ -24,4 +24,31 @@
 11: 11
 12: 12
 
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+10: 10
+11: 11
+12: 12
+
 0 1 2 3 4 5 6 7 8 9 10 11 12
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+10: 10
+11: 11
+12: 12

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


[FFmpeg-cvslog] avformat/async: cache some data for fast seek backward

2015-10-14 Thread Zhang Rui
ffmpeg | branch: master | Zhang Rui  | Tue Oct 13 18:30:47 
2015 +0800| [6c7f289fab3429706cb47b81ea02963585f0dd05] | committer: Michael 
Niedermayer

avformat/async: cache some data for fast seek backward

Signed-off-by: Michael Niedermayer 

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

 libavformat/async.c |  123 +++
 1 file changed, 104 insertions(+), 19 deletions(-)

diff --git a/libavformat/async.c b/libavformat/async.c
index a8c8f54..9fac84a 100644
--- a/libavformat/async.c
+++ b/libavformat/async.c
@@ -24,7 +24,6 @@
  /**
  * @TODO
  *  support timeout
- *  support backward short seek
  *  support work with concatdec, hls
  */
 
@@ -43,8 +42,17 @@
 #endif
 
 #define BUFFER_CAPACITY (4 * 1024 * 1024)
+#define READ_BACK_CAPACITY  (4 * 1024 * 1024)
 #define SHORT_SEEK_THRESHOLD(256 * 1024)
 
+typedef struct RingBuffer
+{
+AVFifoBuffer *fifo;
+int   read_back_capacity;
+
+int   read_pos;
+} RingBuffer;
+
 typedef struct Context {
 AVClass*class;
 URLContext *inner;
@@ -61,7 +69,7 @@ typedef struct Context {
 
 int64_t logical_pos;
 int64_t logical_size;
-AVFifoBuffer   *fifo;
+RingBuffer  ring;
 
 pthread_cond_t  cond_wakeup_main;
 pthread_cond_t  cond_wakeup_background;
@@ -72,6 +80,73 @@ typedef struct Context {
 AVIOInterruptCB interrupt_callback;
 } Context;
 
+static int ring_init(RingBuffer *ring, unsigned int capacity, int 
read_back_capacity)
+{
+memset(ring, 0, sizeof(RingBuffer));
+ring->fifo = av_fifo_alloc(capacity + read_back_capacity);
+if (!ring->fifo)
+return AVERROR(ENOMEM);
+
+ring->read_back_capacity = read_back_capacity;
+return 0;
+}
+
+static void ring_destroy(RingBuffer *ring)
+{
+av_fifo_freep(&ring->fifo);
+}
+
+static void ring_reset(RingBuffer *ring)
+{
+av_fifo_reset(ring->fifo);
+ring->read_pos = 0;
+}
+
+static int ring_size(RingBuffer *ring)
+{
+return av_fifo_size(ring->fifo) - ring->read_pos;
+}
+
+static int ring_space(RingBuffer *ring)
+{
+return av_fifo_space(ring->fifo);
+}
+
+static int ring_generic_read(RingBuffer *ring, void *dest, int buf_size, void 
(*func)(void*, void*, int))
+{
+int ret;
+
+av_assert2(buf_size <= ring_size(ring));
+ret = av_fifo_generic_peek_at(ring->fifo, dest, ring->read_pos, buf_size, 
func);
+ring->read_pos += buf_size;
+
+if (ring->read_pos > ring->read_back_capacity) {
+av_fifo_drain(ring->fifo, ring->read_pos - ring->read_back_capacity);
+ring->read_pos = ring->read_back_capacity;
+}
+
+return ret;
+}
+
+static int ring_generic_write(RingBuffer *ring, void *src, int size, int 
(*func)(void*, void*, int))
+{
+av_assert2(size <= ring_space(ring));
+return av_fifo_generic_write(ring->fifo, src, size, func);
+}
+
+static int ring_size_of_read_back(RingBuffer *ring)
+{
+return ring->read_pos;
+}
+
+static int ring_drain(RingBuffer *ring, int offset)
+{
+av_assert2(offset >= -ring_size_of_read_back(ring));
+av_assert2(offset <= -ring_size(ring));
+ring->read_pos += offset;
+return 0;
+}
+
 static int async_check_interrupt(void *arg)
 {
 URLContext *h   = arg;
@@ -102,7 +177,7 @@ static void *async_buffer_task(void *arg)
 {
 URLContext   *h= arg;
 Context  *c= h->priv_data;
-AVFifoBuffer *fifo = c->fifo;
+RingBuffer   *ring = &c->ring;
 int   ret  = 0;
 int64_t   seek_ret;
 
@@ -132,14 +207,14 @@ static void *async_buffer_task(void *arg)
 c->seek_ret   = seek_ret;
 c->seek_request   = 0;
 
-av_fifo_reset(fifo);
+ring_reset(ring);
 
 pthread_cond_signal(&c->cond_wakeup_main);
 pthread_mutex_unlock(&c->mutex);
 continue;
 }
 
-fifo_space = av_fifo_space(fifo);
+fifo_space = ring_space(ring);
 if (c->io_eof_reached || fifo_space <= 0) {
 pthread_cond_signal(&c->cond_wakeup_main);
 pthread_cond_wait(&c->cond_wakeup_background, &c->mutex);
@@ -149,7 +224,7 @@ static void *async_buffer_task(void *arg)
 pthread_mutex_unlock(&c->mutex);
 
 to_copy = FFMIN(4096, fifo_space);
-ret = av_fifo_generic_write(fifo, (void *)h, to_copy, (void 
*)wrapped_url_read);
+ret = ring_generic_write(ring, (void *)h, to_copy, (void 
*)wrapped_url_read);
 
 pthread_mutex_lock(&c->mutex);
 if (ret <= 0) {
@@ -173,11 +248,9 @@ static int async_open(URLContext *h, const char *arg, int 
flags, AVDictionary **
 
 av_strstart(arg, "async:", &arg);
 
-c->fifo = av_fifo_alloc(BUFFER_CAPACITY);
-if (!c->fifo) {
-ret = AVERROR(ENOMEM);
+ret = ring_init(&c->ring, BUFFER_CAPACITY, READ_BACK_CAPACITY);
+if (ret < 0)
 goto fifo_fail;
-}
 
 /* wrap interrupt 

[FFmpeg-cvslog] ffmpeg_opt: rename loop option to stream_loop

2015-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Oct 14 19:52:17 2015 +0200| [dbb03b8e47f905f0f7b10c3eb5ac11f9bfc793ff] | 
committer: Michael Niedermayer

ffmpeg_opt:  rename loop option to stream_loop

The "loop" option is used in several demuxers (like img2dec) and muxers, using 
the same name in ffmpeg_opt
breaks them. Feel free to revert this and replace by any other solution or 
rename both as preferred
This is just as a quick fix to avoid the regression with existing command lines 
and to have both named
the same (which does not work)

Example:
./ffmpeg -loop 1 -i fate-suite/png1/lena-rgb24.png -t 1 test.avi
will produce 25 frames with the img2dec loop but only 1 frame at 25fps with the 
ffmpeg loop option

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 573da72..7139114 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -3158,7 +3158,7 @@ const OptionDef options[] = {
 { "dump_attachment", HAS_ARG | OPT_STRING | OPT_SPEC |
  OPT_EXPERT | OPT_INPUT, { .off = 
OFFSET(dump_attachment) },
 "extract an attachment into a file", "filename" },
-{ "loop", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_INPUT |
+{ "stream_loop", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_INPUT |
 OPT_OFFSET,  { .off = 
OFFSET(loop) }, "set number of times input stream shall be looped", "loop 
count" },
 { "debug_ts",   OPT_BOOL | OPT_EXPERT,   { 
&debug_ts },
 "print timestamp debugging info" },

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


[FFmpeg-cvslog] rtmpproto: Write correct flv packet sizes at the end of packets

2015-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Oct 13 12:17:24 2015 +0300| [e55376a1fd5abebbb0a082aa20739d58c2260a37] | 
committer: Luca Barbato

rtmpproto: Write correct flv packet sizes at the end of packets

In one case it was written as zero, one case left it uninitialized,
missed the 11 bytes for the flv header.

Signed-off-by: Luca Barbato 

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

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

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index ec4b0e7..77a801d 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2213,7 +2213,7 @@ static int append_flv_data(RTMPContext *rt, RTMPPacket 
*pkt, int skip)
 bytestream2_put_byte(&pbc, ts >> 24);
 bytestream2_put_be24(&pbc, 0);
 bytestream2_put_buffer(&pbc, data, size);
-bytestream2_put_be32(&pbc, 0);
+bytestream2_put_be32(&pbc, size + RTMP_HEADER);
 
 return 0;
 }
@@ -2363,8 +2363,9 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket 
*pkt)
 bytestream_put_be24(&p, ts);
 bytestream_put_byte(&p, ts >> 24);
 memcpy(p, next, size + 3 + 4);
+p+= size + 3;
+bytestream_put_be32(&p, size + RTMP_HEADER);
 next += size + 3 + 4;
-p+= size + 3 + 4;
 }
 if (p != rt->flv_data + rt->flv_size) {
 av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
@@ -2554,7 +2555,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt)
 // Finalise object
 bytestream_put_be16(&p, 0); // Empty string
 bytestream_put_byte(&p, AMF_END_OF_OBJECT);
-bytestream_put_be32(&p, 40); // size of data part (sum of all parts below)
+bytestream_put_be32(&p, 40 + RTMP_HEADER); // size of data part (sum of 
all parts above)
 
 return 0;
 }

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


[FFmpeg-cvslog] Merge commit 'e55376a1fd5abebbb0a082aa20739d58c2260a37'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
22:55:55 2015 +0200| [7ac4140c078d12a2227878b3dcd6ec242598b996] | committer: 
Hendrik Leppkes

Merge commit 'e55376a1fd5abebbb0a082aa20739d58c2260a37'

* commit 'e55376a1fd5abebbb0a082aa20739d58c2260a37':
  rtmpproto: Write correct flv packet sizes at the end of packets

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] httpauth: Add space after commas in HTTP/RTSP auth header

2015-10-14 Thread Andrey Utkin
ffmpeg | branch: master | Andrey Utkin  | Tue 
Oct 13 12:44:37 2015 +0300| [c1348506697377b46f844339c178332e3314149a] | 
committer: Luca Barbato

httpauth: Add space after commas in HTTP/RTSP auth header

This fixes access to Grandstream cameras, which return 401 otherwise.
VLC sends Authorization: header with spaces between parameters, and it
is known to work with Grandstream devices and broad range of other HTTP
and RTSP servers, so author considers switching to such behaviour safe.

See RFC 2617 (HTTP Auth).

Signed-off-by: Luca Barbato 

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

 libavformat/httpauth.c |   19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index b96da3e..b0d3c0c 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -220,18 +220,19 @@ static char *make_digest_auth(HTTPAuthState *state, const 
char *username,
 
 /* TODO: Escape the quoted strings properly. */
 av_strlcatf(authstr, len, "username=\"%s\"",   username);
-av_strlcatf(authstr, len, ",realm=\"%s\"", state->realm);
-av_strlcatf(authstr, len, ",nonce=\"%s\"", digest->nonce);
-av_strlcatf(authstr, len, ",uri=\"%s\"",   uri);
-av_strlcatf(authstr, len, ",response=\"%s\"",  response);
+av_strlcatf(authstr, len, ", realm=\"%s\"", state->realm);
+av_strlcatf(authstr, len, ", nonce=\"%s\"", digest->nonce);
+av_strlcatf(authstr, len, ", uri=\"%s\"",   uri);
+av_strlcatf(authstr, len, ", response=\"%s\"",  response);
+
 if (digest->algorithm[0])
-av_strlcatf(authstr, len, ",algorithm=%s",  digest->algorithm);
+av_strlcatf(authstr, len, ", algorithm=%s",  digest->algorithm);
 if (digest->opaque[0])
-av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque);
+av_strlcatf(authstr, len, ", opaque=\"%s\"", digest->opaque);
 if (digest->qop[0]) {
-av_strlcatf(authstr, len, ",qop=\"%s\"",digest->qop);
-av_strlcatf(authstr, len, ",cnonce=\"%s\"", cnonce);
-av_strlcatf(authstr, len, ",nc=%s", nc);
+av_strlcatf(authstr, len, ", qop=\"%s\"",digest->qop);
+av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce);
+av_strlcatf(authstr, len, ", nc=%s", nc);
 }
 
 av_strlcatf(authstr, len, "\r\n");

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


[FFmpeg-cvslog] Merge commit 'c1348506697377b46f844339c178332e3314149a'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
23:01:20 2015 +0200| [0e4528b88e10e3550dd778ac56a1da9d0a136928] | committer: 
Hendrik Leppkes

Merge commit 'c1348506697377b46f844339c178332e3314149a'

* commit 'c1348506697377b46f844339c178332e3314149a':
  httpauth: Add space after commas in HTTP/RTSP auth header

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] dxva: Include last the internal header

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Tue Oct 13 
23:20:33 2015 +0200| [08377f9c3bf6dbe216512a2e05c9fac837b13fc0] | committer: 
Luca Barbato

dxva: Include last the internal header

It redefines _WIN32_WINNT, possibly causing problems with the
w32pthreads.h header.

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

 libavcodec/dxva2_h264.c  |6 +-
 libavcodec/dxva2_hevc.c  |6 +-
 libavcodec/dxva2_mpeg2.c |6 +-
 libavcodec/dxva2_vc1.c   |6 +-
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index a4a88ce..8f7c4a7 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -20,11 +20,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "dxva2_internal.h"
 #include "h264.h"
 #include "h264data.h"
 #include "mpegutils.h"
 
+// The headers above may include w32threads.h, which uses the original
+// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
+// potentially newer version.
+#include "dxva2_internal.h"
+
 struct dxva2_picture_context {
 DXVA_PicParams_H264   pp;
 DXVA_Qmatrix_H264 qm;
diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c
index 88d4782..aa684bb 100644
--- a/libavcodec/dxva2_hevc.c
+++ b/libavcodec/dxva2_hevc.c
@@ -22,9 +22,13 @@
 
 #include "libavutil/avassert.h"
 
-#include "dxva2_internal.h"
 #include "hevc.h"
 
+// The headers above may include w32threads.h, which uses the original
+// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
+// potentially newer version.
+#include "dxva2_internal.h"
+
 #define MAX_SLICES 256
 
 struct hevc_dxva2_picture_context {
diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
index 62308b4..2d88f9b 100644
--- a/libavcodec/dxva2_mpeg2.c
+++ b/libavcodec/dxva2_mpeg2.c
@@ -21,10 +21,14 @@
  */
 
 #include "libavutil/log.h"
-#include "dxva2_internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 
+// The headers above may include w32threads.h, which uses the original
+// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
+// potentially newer version.
+#include "dxva2_internal.h"
+
 #define MAX_SLICES 1024
 struct dxva2_picture_context {
 DXVA_PictureParameters pp;
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index 73f9fb4..d170e18 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -20,11 +20,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "dxva2_internal.h"
 #include "mpegutils.h"
 #include "vc1.h"
 #include "vc1data.h"
 
+// The headers above may include w32threads.h, which uses the original
+// _WIN32_WINNT define, while dxva2_internal.h redefines it to target a
+// potentially newer version.
+#include "dxva2_internal.h"
+
 struct dxva2_picture_context {
 DXVA_PictureParameters pp;
 DXVA_SliceInfo si;

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


[FFmpeg-cvslog] Merge commit '08377f9c3bf6dbe216512a2e05c9fac837b13fc0'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
23:02:00 2015 +0200| [b66a94ab539cbebf8dc6ca53d81dfa47d6dd59ac] | committer: 
Hendrik Leppkes

Merge commit '08377f9c3bf6dbe216512a2e05c9fac837b13fc0'

* commit '08377f9c3bf6dbe216512a2e05c9fac837b13fc0':
  dxva: Include last the internal header

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] thread: Provide no-op variants for pthread_once

2015-10-14 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Wed Oct  7 
22:43:38 2015 +0200| [c53e796f8b69799b7ad6d28fbab981d37edf1bc9] | committer: 
Luca Barbato

thread: Provide no-op variants for pthread_once

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

 libavutil/thread.h |   17 +
 1 file changed, 17 insertions(+)

diff --git a/libavutil/thread.h b/libavutil/thread.h
index 3556544..cf0fbdd 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -39,6 +39,11 @@
 #define ff_mutex_unlock  pthread_mutex_unlock
 #define ff_mutex_destroy pthread_mutex_destroy
 
+#define AVOnce pthread_once_t
+#define AV_ONCE_INIT PTHREAD_ONCE_INIT
+
+#define ff_thread_once(control, routine) pthread_once(control, routine)
+
 #else
 
 #define AVMutex char
@@ -48,6 +53,18 @@
 #define ff_mutex_unlock(mutex) (0)
 #define ff_mutex_destroy(mutex) (0)
 
+#define AVOnce char
+#define AV_ONCE_INIT 0
+
+static inline int ff_thread_once(char *control, void (*routine)(void))
+{
+if (!*control) {
+routine();
+*control = 1;
+}
+return 0;
+}
+
 #endif
 
 #endif /* AVUTIL_THREAD_H */

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


[FFmpeg-cvslog] h264: Run VLC init under pthread_once

2015-10-14 Thread Derek Buitenhuis
ffmpeg | branch: master | Derek Buitenhuis  | Wed 
Oct  7 12:33:01 2015 -0400| [d15368ee3926152a3a301c13cc638fbf7a062ddf] | 
committer: Luca Barbato

h264: Run VLC init under pthread_once

This makes the h.264 decoder threadsafe to initialize.

Signed-off-by: Derek Buitenhuis 
Signed-off-by: Luca Barbato 

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

 libavcodec/h264.c |9 -
 libavcodec/h264.h |1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4c1e135..ec57d6d 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -606,6 +606,8 @@ static int h264_init_context(AVCodecContext *avctx, 
H264Context *h)
 return 0;
 }
 
+static AVOnce h264_vlc_init = AV_ONCE_INIT;
+
 av_cold int ff_h264_decode_init(AVCodecContext *avctx)
 {
 H264Context *h = avctx->priv_data;
@@ -619,7 +621,11 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
 if (!avctx->has_b_frames)
 h->low_delay = 1;
 
-ff_h264_decode_init_vlc();
+ret = ff_thread_once(&h264_vlc_init, ff_h264_decode_init_vlc);
+if (ret != 0) {
+av_log(avctx, AV_LOG_ERROR, "pthread_once has failed.");
+return AVERROR_UNKNOWN;
+}
 
 if (avctx->codec_id == AV_CODEC_ID_H264) {
 if (avctx->ticks_per_frame == 1)
@@ -1801,6 +1807,7 @@ AVCodec ff_h264_decoder = {
 .capabilities  = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ 
AV_CODEC_CAP_DR1 |
  AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
  AV_CODEC_CAP_FRAME_THREADS,
+.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
 .flush = flush_dpb,
 .init_thread_copy  = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
 .update_thread_context = 
ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index bf8b07e..e9fd9cc 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -29,6 +29,7 @@
 #define AVCODEC_H264_H
 
 #include "libavutil/intreadwrite.h"
+#include "libavutil/thread.h"
 #include "cabac.h"
 #include "error_resilience.h"
 #include "get_bits.h"

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


[FFmpeg-cvslog] Merge commit 'd15368ee3926152a3a301c13cc638fbf7a062ddf'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
23:06:06 2015 +0200| [15db457ea8f76cd03a371dee548b7dbc60efcb86] | committer: 
Hendrik Leppkes

Merge commit 'd15368ee3926152a3a301c13cc638fbf7a062ddf'

* commit 'd15368ee3926152a3a301c13cc638fbf7a062ddf':
  h264: Run VLC init under pthread_once

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] Merge commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9'

2015-10-14 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Wed Oct 14 
23:02:35 2015 +0200| [f05021f3f49a45b36411ec9de3cd7522dc9f9110] | committer: 
Hendrik Leppkes

Merge commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9'

* commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9':
  thread: Provide no-op variants for pthread_once

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] doc/examples/muxing: Fix mixed declaration and code

2015-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Oct 15 00:00:45 2015 +0200| [83fc0b9d48d103f091211180bbe38f159790e62b] | 
committer: Michael Niedermayer

doc/examples/muxing: Fix mixed declaration and code

Signed-off-by: Michael Niedermayer 

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

 doc/examples/muxing.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index 041617a..d4dac5c 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -493,12 +493,12 @@ static int write_video_frame(AVFormatContext *oc, 
OutputStream *ost)
 AVCodecContext *c;
 AVFrame *frame;
 int got_packet = 0;
+AVPacket pkt = { 0 };
 
 c = ost->st->codec;
 
 frame = get_video_frame(ost);
 
-AVPacket pkt = { 0 };
 av_init_packet(&pkt);
 
 /* encode the image */

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


[FFmpeg-cvslog] lavf: Remove duplicated latm demuxer.

2015-10-14 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Thu Oct 15 
01:11:17 2015 +0200| [2c2d1624a2e70693045868b8b841a24a9b711507] | committer: 
Carl Eugen Hoyos

lavf: Remove duplicated latm demuxer.

The demuxer used to demux loas files for which a dedicated demuxer exists.

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

 doc/APIchanges   |3 +++
 libavformat/Makefile |1 -
 libavformat/allformats.c |2 +-
 libavformat/rawdec.c |   13 -
 libavformat/version.h|4 ++--
 5 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 71b847d..b9cdce6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2015-10-15 - xxx - lavf 57.4.100
+  Remove the latm demuxer that was a duplicate of the loas demuxer.
+
 2015-10-14 - xxx - lavu 55.4.100 / lavu 55.2.0 - dict.h
   Change return type of av_dict_copy() from void to int, so that a proper
   error code can be reported.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d118019..c58cfb4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -227,7 +227,6 @@ OBJS-$(CONFIG_IVF_MUXER) += ivfenc.o
 OBJS-$(CONFIG_JACOSUB_DEMUXER)   += jacosubdec.o subtitles.o
 OBJS-$(CONFIG_JACOSUB_MUXER) += jacosubenc.o rawenc.o
 OBJS-$(CONFIG_JV_DEMUXER)+= jvdec.o
-OBJS-$(CONFIG_LATM_DEMUXER)  += rawdec.o
 OBJS-$(CONFIG_LATM_MUXER)+= latmenc.o rawenc.o
 OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o
 OBJS-$(CONFIG_LOAS_DEMUXER)  += loasdec.o rawdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0ccde9d..5a18eeb 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -167,7 +167,7 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(IVF,  ivf);
 REGISTER_MUXDEMUX(JACOSUB,  jacosub);
 REGISTER_DEMUXER (JV,   jv);
-REGISTER_MUXDEMUX(LATM, latm);
+REGISTER_MUXER   (LATM, latm);
 REGISTER_DEMUXER (LMLM4,lmlm4);
 REGISTER_DEMUXER (LOAS, loas);
 REGISTER_MUXDEMUX(LRC,  lrc);
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 7098ebd..e5c9918 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -123,19 +123,6 @@ AVInputFormat ff_data_demuxer = {
 };
 #endif
 
-#if CONFIG_LATM_DEMUXER
-
-AVInputFormat ff_latm_demuxer = {
-.name   = "latm",
-.long_name  = NULL_IF_CONFIG_SMALL("raw LOAS/LATM"),
-.read_header= ff_raw_audio_read_header,
-.read_packet= ff_raw_read_partial_packet,
-.flags  = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS,
-.extensions = "latm",
-.raw_codec_id   = AV_CODEC_ID_AAC_LATM,
-};
-#endif
-
 #if CONFIG_MJPEG_DEMUXER
 static int mjpeg_probe(AVProbeData *p)
 {
diff --git a/libavformat/version.h b/libavformat/version.h
index e365636..6944cab 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR   3
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR   4
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

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


[FFmpeg-cvslog] dnxhd: interleave AC levels and flags

2015-10-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Wed Oct 14 19:20:49 2015 +0200| [96b165fae24b84a703728a8d34ef1ecb944471ab] | 
committer: Michael Niedermayer

dnxhd: interleave AC levels and flags

This allows more efficient access to the array as the level and flags
are contiguous. Around 4% faster coefficient decoding.

Signed-off-by: Michael Niedermayer 

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

 libavcodec/dnxhddata.c |  492 ++--
 libavcodec/dnxhddata.h |3 +-
 libavcodec/dnxhddec.c  |7 +-
 libavcodec/dnxhdenc.c  |6 +-
 4 files changed, 231 insertions(+), 277 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 87499c7..82fbfdf 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -334,45 +334,40 @@ static const uint8_t dnxhd_1237_ac_bits[257] = {
 };
 
 /* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
-static const uint8_t dnxhd_1237_ac_level[257] = {
-  3,  3,  5,  0,  7,  9,  5, 11, 13, 15,  7, 17, 19, 21, 23, 25,
-  9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49,
- 51, 53, 55, 17, 19, 57, 59, 61, 63, 65, 67, 69, 21, 23, 25, 71,
- 73, 75, 77, 79, 81, 83, 27, 29, 31, 33, 85, 87, 89, 91, 93, 95,
- 97, 99,101,103,105, 35, 37, 39, 41, 43,107,109,111,113,115,117,
-119,121,123,129,  3, 45, 47, 49, 51, 53, 55,125,127,  5,  7,  9,
- 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41,
- 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73,
- 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,101,103,105,
-107,109,111,113,115,117,119,121,123,125,127,129, 57, 59, 61, 63,
- 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
- 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
-129,  3,  5,  7,  9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
- 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
- 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
- 97, 99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,
-129,
-};
-
-/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
-static const uint8_t dnxhd_1237_ac_flags[257] = {
-0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0,
-2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
-0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0,
-0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
-2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-3,
+static const uint8_t dnxhd_1237_ac_info[2*257] = {
+  3, 0,   3, 2,   5, 0,   0, 0,   7, 0,   9, 0,   5, 2,  11, 0,
+ 13, 0,  15, 0,   7, 2,  17, 0,  19, 0,  21, 0,  23, 0,  25, 0,
+  9, 2,  11, 2,  27, 0,  29, 0,  31, 0,  33, 0,  13, 2,  35, 0,
+ 37, 0,  39, 0,  41, 0,  43, 0,  15, 2,  45, 0,  47, 0,  49, 0,
+ 51, 0,  53, 0,  55, 0,  17, 2,  19, 2,  57, 0,  59, 0,  61, 0,
+ 63, 0,  65, 0,  67, 0,  69, 0,  21, 2,  23, 2,  25, 2,  71, 0,
+ 73, 0,  75, 0,  77, 0,  79, 0,  81, 0,  83, 0,  27, 2,  29, 2,
+ 31, 2,  33, 2,  85, 0,  87, 0,  89, 0,  91, 0,  93, 0,  95, 0,
+ 97, 0,  99, 0, 101, 0, 103, 0, 105, 0,  35, 2,  37, 2,  39, 2,
+ 41, 2,  43, 2, 107, 0, 109, 0, 111, 0, 113, 0, 115, 0, 117, 0,
+119, 0, 121, 0, 123, 0, 129, 0,   3, 1,  45, 2,  47, 2,  49, 2,
+ 51, 2,  53, 2,  55, 2, 125, 0, 127, 0,   5, 1,   7, 1,   9, 1,
+ 11, 1,  13, 1,  15, 1,  17, 1,  19, 1,  21, 1,  23, 1,  25, 1,
+ 27, 1,  29, 1,  31, 1,  33, 1,  35, 1,  37, 1,  39, 1,  41, 1,
+ 43, 1,  45, 1,  47, 1,  49, 1,  51, 1,  53, 1,  55, 1,  57, 1,
+ 59, 1,  61, 1,  63, 1,  65, 1,  67, 1,  69, 1,  71, 1,  73, 1,
+ 75, 1,  77, 1,  79, 1,  81, 1,  83, 1,  85, 1,  87, 1,  89, 1,
+ 91, 1,  93, 1,  95, 1,  97, 1,  99, 1, 101, 1, 103, 1, 105, 1,
+107, 1, 109, 1, 111, 1, 113, 1, 115, 1, 117, 1, 119, 1, 121, 1,
+123, 1, 125, 1, 127, 1, 129, 1,  57, 2,  59, 2,  61, 2,  63, 2,
+ 65, 2,  67, 2,  69, 2,  71, 2,  73, 2,  75, 2,  77, 2,  79, 2,
+ 81, 2,  83, 2,  85, 2,  87, 2,  89, 2,  91, 2,  93, 2,  95, 2,
+ 97, 2,  99, 2, 101, 2, 103, 2, 105, 2, 107, 2, 109, 2, 111, 2,
+113, 2, 115, 2, 117, 2, 119, 2, 121, 2, 123, 2, 125, 2, 127, 2,
+129, 2,   3, 3,   5, 3,   7, 3,   9, 3,  11, 3,  13, 3,  15, 3,
+ 17, 3,  19, 3,  21, 3,  23, 3,  25, 3,  27, 3,  29, 3,  31, 3,
+ 33,

[FFmpeg-cvslog] avfilter/af_tremolo: clean up extra newlines

2015-10-14 Thread Kyle Swanson
ffmpeg | branch: master | Kyle Swanson  | Wed Oct 14 09:56:48 2015 
-0500| [0131636f22b49d1aa67b76d7f1acad6e57eda577] | committer: Michael 
Niedermayer

avfilter/af_tremolo: clean up extra newlines

Signed-off-by: Kyle Swanson 
Signed-off-by: Michael Niedermayer 

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

 libavfilter/af_tremolo.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c
index 0ae7a7c..50df2e4 100644
--- a/libavfilter/af_tremolo.c
+++ b/libavfilter/af_tremolo.c
@@ -131,9 +131,7 @@ static int config_input(AVFilterLink *inlink)
 
 for (i = 0; i < inlink->sample_rate; i++) {
 double env = s->freq * i / inlink->sample_rate;
-
 env = sin(2 * M_PI * fmod(env + 0.25, 1.0));
-
 s->table[i] = env * (1 - fabs(offset)) + offset;
 }
 

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


[FFmpeg-cvslog] doc/ffmpeg: use stream_loop instead of loop

2015-10-14 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Wed Oct 
14 21:51:15 2015 -0400| [76cd82d9257b7eabab806fc7202676d5bd8406c4] | committer: 
Ganesh Ajjanagadde

doc/ffmpeg: use stream_loop instead of loop

Commit dbb03b8e47f905f0f7b10c3eb5ac11f9bfc793ff renamed loop to
stream_loop. This documents the change.

Signed-off-by: Ganesh Ajjanagadde 

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

 doc/ffmpeg.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 5624930..de49618 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -253,7 +253,7 @@ Overwrite output files without asking.
 Do not overwrite output files, and exit immediately if a specified
 output file already exists.
 
-@item -loop @var{number} (@emph{input})
+@item -stream_loop @var{number} (@emph{input})
 Set number of times input stream shall be looped.
 
 @item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})

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