Re: [libav-devel] [PATCH] h2645_parse: Allocate a single buffer per packet

2017-11-03 Thread Luca Barbato

On 03/11/2017 20:52, James Almer wrote:

From: Kieran Kunhya 

Drastically reduces memory usage on pathological streams.
---
Fixed so it may apply cleanly, and with the memset() change removed.


Thank you :)

I'm happy with it now, anybody is against landing it?

lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] PATCH] h2645: Allocate a single buffer per packet. Drastically reduces memory usage on pathological streams.

2017-11-03 Thread James Almer
On 11/3/2017 5:04 PM, Diego Biurrun wrote:
> On Fri, Nov 03, 2017 at 04:50:56PM -0300, James Almer wrote:
>> On 11/3/2017 4:42 PM, Luca Barbato wrote:
>>> On 03/11/2017 19:23, Kieran Kunhya wrote:
 This patch fixes very high memory usage on pathological streams.
>>>
>>> this hunk seems spurious (and should not even compile with gcc).
>>
>> It does, but complains about mixed declarations and code.
> 
> It does not because of -Werror=declaration-after-statement.
> 
> Diego

Right, didn't try to compile it before removing it locally so i didn't
even notice declaration-after-statement was forced as an error.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] PATCH] h2645: Allocate a single buffer per packet. Drastically reduces memory usage on pathological streams.

2017-11-03 Thread Diego Biurrun
On Fri, Nov 03, 2017 at 04:50:56PM -0300, James Almer wrote:
> On 11/3/2017 4:42 PM, Luca Barbato wrote:
> > On 03/11/2017 19:23, Kieran Kunhya wrote:
> >> This patch fixes very high memory usage on pathological streams.
> > 
> > this hunk seems spurious (and should not even compile with gcc).
> 
> It does, but complains about mixed declarations and code.

It does not because of -Werror=declaration-after-statement.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] h2645_parse: Allocate a single buffer per packet

2017-11-03 Thread James Almer
From: Kieran Kunhya 

Drastically reduces memory usage on pathological streams.
---
Fixed so it may apply cleanly, and with the memset() change removed.

 libavcodec/h2645_parse.c | 22 --
 libavcodec/h2645_parse.h | 10 --
 libavcodec/h264_parser.c | 11 ---
 libavcodec/qsvenc_hevc.c | 13 +
 4 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index b507b19ecb..2ee7672c05 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -30,7 +30,7 @@
 #include "h2645_parse.h"
 
 int ff_h2645_extract_rbsp(const uint8_t *src, int length,
-  H2645NAL *nal)
+  H2645RBSP *rbsp, H2645NAL *nal)
 {
 int i, si, di;
 uint8_t *dst;
@@ -88,11 +88,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
 return length;
 }
 
-av_fast_malloc(>rbsp_buffer, >rbsp_buffer_size,
-   length + AV_INPUT_BUFFER_PADDING_SIZE);
-if (!nal->rbsp_buffer)
-return AVERROR(ENOMEM);
-
+nal->rbsp_buffer = >rbsp_buffer[rbsp->rbsp_buffer_size];
 dst = nal->rbsp_buffer;
 
 memcpy(dst, src, i);
@@ -125,6 +121,8 @@ nsc:
 nal->size = di;
 nal->raw_data = src;
 nal->raw_size = si;
+rbsp->rbsp_buffer_size += si;
+
 return si;
 }
 
@@ -220,6 +218,11 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t 
*buf, int length,
 size_t next_avc = is_nalff ? 0 : length;
 
 bytestream2_init(, buf, length);
+av_fast_padded_malloc(>rbsp.rbsp_buffer, 
>rbsp.rbsp_buffer_alloc_size, length);
+if (!pkt->rbsp.rbsp_buffer)
+return AVERROR(ENOMEM);
+
+pkt->rbsp.rbsp_buffer_size = 0;
 
 pkt->nb_nals = 0;
 while (bytestream2_get_bytes_left() >= 4) {
@@ -287,7 +290,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t 
*buf, int length,
 }
 nal = >nals[pkt->nb_nals++];
 
-consumed = ff_h2645_extract_rbsp(bc.buffer, extract_length, nal);
+consumed = ff_h2645_extract_rbsp(bc.buffer, extract_length, 
>rbsp, nal);
 if (consumed < 0)
 return consumed;
 
@@ -322,9 +325,8 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t 
*buf, int length,
 
 void ff_h2645_packet_uninit(H2645Packet *pkt)
 {
-int i;
-for (i = 0; i < pkt->nals_allocated; i++)
-av_freep(>nals[i].rbsp_buffer);
 av_freep(>nals);
 pkt->nals_allocated = 0;
+av_freep(>rbsp.rbsp_buffer);
+pkt->rbsp.rbsp_buffer_alloc_size = pkt->rbsp.rbsp_buffer_size = 0;
 }
diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h
index 9cc4441d9e..63ec493622 100644
--- a/libavcodec/h2645_parse.h
+++ b/libavcodec/h2645_parse.h
@@ -28,7 +28,6 @@
 
 typedef struct H2645NAL {
 uint8_t *rbsp_buffer;
-int rbsp_buffer_size;
 
 int size;
 const uint8_t *data;
@@ -60,9 +59,16 @@ typedef struct H2645NAL {
 int ref_idc;
 } H2645NAL;
 
+typedef struct H2645RBSP {
+uint8_t *rbsp_buffer;
+int rbsp_buffer_alloc_size;
+int rbsp_buffer_size;
+} H2645RBSP;
+
 /* an input packet split into unescaped NAL units */
 typedef struct H2645Packet {
 H2645NAL *nals;
+H2645RBSP rbsp;
 int nb_nals;
 int nals_allocated;
 } H2645Packet;
@@ -71,7 +77,7 @@ typedef struct H2645Packet {
  * Extract the raw (unescaped) bitstream.
  */
 int ff_h2645_extract_rbsp(const uint8_t *src, int length,
-  H2645NAL *nal);
+  H2645RBSP *rbsp, H2645NAL *nal);
 
 /**
  * Split an input packet into NAL units.
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 0bb78e09c8..710b4180f5 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -207,6 +207,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
 H264ParseContext *p = s->priv_data;
 const uint8_t *buf_end = buf + buf_size;
 
+H2645RBSP rbsp = { NULL };
 H2645NAL nal = { NULL };
 
 unsigned int pps_id;
@@ -225,6 +226,10 @@ static inline int parse_nal_units(AVCodecParserContext *s,
 if (!buf_size)
 return 0;
 
+av_fast_padded_malloc(_buffer, _buffer_alloc_size, 
buf_size);
+if (!rbsp.rbsp_buffer)
+return AVERROR(ENOMEM);
+
 for (;;) {
 const SPS *sps;
 int src_length, consumed;
@@ -250,7 +255,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
 break;
 }
 
-consumed = ff_h2645_extract_rbsp(buf, src_length, );
+consumed = ff_h2645_extract_rbsp(buf, src_length, , );
 if (consumed < 0)
 break;
 
@@ -463,7 +468,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
 s->field_order = AV_FIELD_UNKNOWN;
 }
 
-av_freep(_buffer);
+av_freep(_buffer);
 return 0; /* no need to evaluate the rest */
 }
 buf += consumed;
@@ -471,7 +476,7 @@ static inline int 

Re: [libav-devel] PATCH] h2645: Allocate a single buffer per packet. Drastically reduces memory usage on pathological streams.

2017-11-03 Thread James Almer
On 11/3/2017 4:42 PM, Luca Barbato wrote:
> On 03/11/2017 19:23, Kieran Kunhya wrote:
>> This patch fixes very high memory usage on pathological streams.
> 
> this hunk seems spurious (and should not even compile with gcc).

It does, but complains about mixed declarations and code.

It's in any case a pointless change. zero initialization like it's
currently doing is valid.

> 
> diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
> index a7c71d9..2ddbbf9 100644
> --- a/libavcodec/h264_parse.c
> +++ b/libavcodec/h264_parse.c
> @@ -349,7 +349,8 @@ int ff_h264_init_poc(int pic_field_poc[2], int
> *pic_poc,
>  static int decode_extradata_ps(const uint8_t *data, int size,
> H264ParamSets *ps,
>     int is_avc, void *logctx)
>  {
> -    H2645Packet pkt = { 0 };
> +    H2645Packet pkt;
> +    memset(, 0, sizeof(pkt));
>  int i, ret = 0;
> 
>  ret = ff_h2645_packet_split(, data, size, logctx, is_avc, 2,
> AV_CODEC_ID_H264, 1);
> 
> lu
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] PATCH] h2645: Allocate a single buffer per packet. Drastically reduces memory usage on pathological streams.

2017-11-03 Thread Luca Barbato

On 03/11/2017 19:23, Kieran Kunhya wrote:

This patch fixes very high memory usage on pathological streams.


this hunk seems spurious (and should not even compile with gcc).

diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index a7c71d9..2ddbbf9 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -349,7 +349,8 @@ int ff_h264_init_poc(int pic_field_poc[2], int *pic_poc,
 static int decode_extradata_ps(const uint8_t *data, int size, 
H264ParamSets *ps,

int is_avc, void *logctx)
 {
-H2645Packet pkt = { 0 };
+H2645Packet pkt;
+memset(, 0, sizeof(pkt));
 int i, ret = 0;

 ret = ff_h2645_packet_split(, data, size, logctx, is_avc, 2, 
AV_CODEC_ID_H264, 1);


lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] PATCH] h2645: Allocate a single buffer per packet. Drastically reduces memory usage on pathological streams.

2017-11-03 Thread Kieran Kunhya
This patch fixes very high memory usage on pathological streams.


0001-h2645-Allocate-a-single-buffer-per-packet.-Drastical.patch
Description: Binary data
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 4/5] configure: Improve restrict keyword handling

2017-11-03 Thread Diego Biurrun
---
 configure| 23 +--
 libavcodec/binkdsp.h |  2 --
 libavcodec/dnxhdenc.h|  2 --
 libavcodec/h263.h|  2 --
 libavcodec/idctdsp.h |  2 --
 libavcodec/pixblockdsp.h |  2 --
 libavutil/float_dsp.h|  2 --
 7 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/configure b/configure
index 21f24e8e0f..e776e3b432 100755
--- a/configure
+++ b/configure
@@ -4134,12 +4134,11 @@ extern_prefix=${sym%%ff_extern*}
 
 ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
 
-_restrict=
-for restrict_keyword in restrict __restrict__ __restrict; do
-check_cc <= 12" || disable 
log2
-# The CRT headers contain __declspec(restrict) in a few places, but if 
redefining
-# restrict, this might break. MSVC 2010 and 2012 fail with 
__declspec(__restrict)
-# (as it ends up if the restrict redefine is done before including 
stdlib.h), while
-# MSVC 2013 and newer can handle it fine.
-# If this declspec fails, force including stdlib.h before the restrict 
redefinition
-# happens in config.h.
-if [ $_restrict != restrict ]; then
-check_cc < $TMPH <
 
-#include "config.h"
-
 typedef struct BinkDSPContext {
 void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int32_t 
*block/*align 16*/);
 void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int32_t 
*block/*align 16*/);
diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
index c6755f7b59..823d564ca8 100644
--- a/libavcodec/dnxhdenc.h
+++ b/libavcodec/dnxhdenc.h
@@ -26,8 +26,6 @@
 
 #include 
 
-#include "config.h"
-
 #include "mpegvideo.h"
 #include "dnxhddata.h"
 
diff --git a/libavcodec/h263.h b/libavcodec/h263.h
index ce697da20e..02dc7c8ee9 100644
--- a/libavcodec/h263.h
+++ b/libavcodec/h263.h
@@ -22,8 +22,6 @@
 
 #include 
 
-#include "config.h"
-
 #include "libavutil/rational.h"
 
 #include "get_bits.h"
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index c6b7aeda5f..b2e905f86e 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -21,8 +21,6 @@
 
 #include 
 
-#include "config.h"
-
 #include "avcodec.h"
 
 /**
diff --git a/libavcodec/pixblockdsp.h b/libavcodec/pixblockdsp.h
index c7587cba16..8e19928d77 100644
--- a/libavcodec/pixblockdsp.h
+++ b/libavcodec/pixblockdsp.h
@@ -21,8 +21,6 @@
 
 #include 
 
-#include "config.h"
-
 #include "avcodec.h"
 
 typedef struct PixblockDSPContext {
diff --git a/libavutil/float_dsp.h b/libavutil/float_dsp.h
index 3142df4fd3..c95dce6fd6 100644
--- a/libavutil/float_dsp.h
+++ b/libavutil/float_dsp.h
@@ -19,8 +19,6 @@
 #ifndef AVUTIL_FLOAT_DSP_H
 #define AVUTIL_FLOAT_DSP_H
 
-#include "config.h"
-
 typedef struct AVFloatDSPContext {
 /**
  * Calculate the product of two vectors of floats and store the result in
-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 5/5] Drop some unnecessary config.h #includes

2017-11-03 Thread Diego Biurrun
---

Noticed while working on the previous patch, spun off into a separate commit.

 libavcodec/thread.h  | 1 -
 libavformat/tls.h| 4 ++--
 libavutil/aarch64/cpu.h  | 1 -
 libavutil/arm/cpu.h  | 1 -
 libavutil/cpu_internal.h | 2 ++
 libavutil/ppc/cpu.h  | 1 -
 libavutil/x86/cpu.h  | 1 -
 7 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index 864e67eb98..b06958de80 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -29,7 +29,6 @@
 
 #include "libavutil/buffer.h"
 
-#include "config.h"
 #include "avcodec.h"
 
 typedef struct ThreadFrame {
diff --git a/libavformat/tls.h b/libavformat/tls.h
index 94f30ab854..846aa8333e 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -22,10 +22,10 @@
 #ifndef AVFORMAT_TLS_H
 #define AVFORMAT_TLS_H
 
-#include "config.h"
-#include "url.h"
 #include "libavutil/opt.h"
 
+#include "url.h"
+
 typedef struct TLSShared {
 char *ca_file;
 int verify;
diff --git a/libavutil/aarch64/cpu.h b/libavutil/aarch64/cpu.h
index f5b1d89132..0f2531b0dc 100644
--- a/libavutil/aarch64/cpu.h
+++ b/libavutil/aarch64/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_AARCH64_CPU_H
 #define AVUTIL_AARCH64_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index 127993e5dd..99986d908b 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_ARM_CPU_H
 #define AVUTIL_ARM_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h
index 18c744a983..4c5e1308aa 100644
--- a/libavutil/cpu_internal.h
+++ b/libavutil/cpu_internal.h
@@ -19,6 +19,8 @@
 #ifndef AVUTIL_CPU_INTERNAL_H
 #define AVUTIL_CPU_INTERNAL_H
 
+#include "config.h"
+
 #include "cpu.h"
 
 #define CPUEXT_SUFFIX(flags, suffix, cpuext)\
diff --git a/libavutil/ppc/cpu.h b/libavutil/ppc/cpu.h
index a8b823f534..bed687125e 100644
--- a/libavutil/ppc/cpu.h
+++ b/libavutil/ppc/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_PPC_CPU_H
 #define AVUTIL_PPC_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/x86/cpu.h b/libavutil/x86/cpu.h
index c0a525dd4e..6373e57db2 100644
--- a/libavutil/x86/cpu.h
+++ b/libavutil/x86/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_X86_CPU_H
 #define AVUTIL_X86_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] the big configure cleanup (act V)

2017-11-03 Thread Diego Biurrun
miscellaneous minor changes and refactorings

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 2/5] configure: Coalesce some arch configuration and PIC handling

2017-11-03 Thread Diego Biurrun
---
 configure | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index 33c52240aa..169a6fa33f 100755
--- a/configure
+++ b/configure
@@ -2595,6 +2595,7 @@ pkg_config_default=pkg-config
 ranlib="ranlib"
 strip="strip"
 version_script='--version-script'
+objformat="elf32"
 
 # machine
 arch_default=$(uname -m)
@@ -3766,45 +3767,42 @@ check_64bit(){
 expr=$3
 check_code cc "" "int test[2*($expr) - 1]" &&
 subarch=$arch64 || subarch=$arch32
+enable $subarch
 }
 
 case "$arch" in
 aarch64|alpha|ia64)
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 mips)
 check_64bit mips mips64 '_MIPS_SIM > 1'
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 parisc)
 check_64bit parisc parisc64 'sizeof(void *) > 4'
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 ppc)
 check_64bit ppc ppc64 'sizeof(void *) > 4'
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 s390)
 check_64bit s390 s390x 'sizeof(void *) > 4'
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 sparc)
 check_64bit sparc sparc64 'sizeof(void *) > 4'
-spic=$shared
+enabled shared && enable_weak pic
 ;;
 x86)
 check_64bit x86_32 x86_64 'sizeof(void *) > 4'
-if test "$subarch" = "x86_64"; then
-spic=$shared
+if enabled x86_64; then
+enabled shared && enable_weak pic
+objformat=elf64
 fi
 ;;
 esac
 
-enable $subarch
-enabled spic && enable_weak pic
-
-enabled x86_64 && objformat=elf64 || objformat="elf32"
-
 # OS specific
 case $target_os in
 aix)
-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 3/5] configure: Factorize check_64_bit()

2017-11-03 Thread Diego Biurrun
---

I'm assuming that the change for MIPS is safe.

 configure | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 169a6fa33f..21f24e8e0f 100755
--- a/configure
+++ b/configure
@@ -3764,8 +3764,7 @@ check_host_cflags $host_cflags_speed
 check_64bit(){
 arch32=$1
 arch64=$2
-expr=$3
-check_code cc "" "int test[2*($expr) - 1]" &&
+check_code cc "" "int test[2*(sizeof(void *) > 4) - 1]" &&
 subarch=$arch64 || subarch=$arch32
 enable $subarch
 }
@@ -3775,27 +3774,27 @@ case "$arch" in
 enabled shared && enable_weak pic
 ;;
 mips)
-check_64bit mips mips64 '_MIPS_SIM > 1'
+check_64bit mips mips64
 enabled shared && enable_weak pic
 ;;
 parisc)
-check_64bit parisc parisc64 'sizeof(void *) > 4'
+check_64bit parisc parisc64
 enabled shared && enable_weak pic
 ;;
 ppc)
-check_64bit ppc ppc64 'sizeof(void *) > 4'
+check_64bit ppc ppc64
 enabled shared && enable_weak pic
 ;;
 s390)
-check_64bit s390 s390x 'sizeof(void *) > 4'
+check_64bit s390 s390x
 enabled shared && enable_weak pic
 ;;
 sparc)
-check_64bit sparc sparc64 'sizeof(void *) > 4'
+check_64bit sparc sparc64
 enabled shared && enable_weak pic
 ;;
 x86)
-check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+check_64bit x86_32 x86_64
 if enabled x86_64; then
 enabled shared && enable_weak pic
 objformat=elf64
-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 1/5] configure: Miscellaneous minor changes

2017-11-03 Thread Diego Biurrun
- Move a variable closer to where it is used
- Add an explanatory comment
- Simplify a crosscompile check
- Minor SHFLAGS simplification
- Coalesce some threads tests
---
 configure | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 6f96a06f03..33c52240aa 100755
--- a/configure
+++ b/configure
@@ -347,8 +347,6 @@ EOF
   exit 0
 }
 
-quotes='""'
-
 log(){
 echo "$@" >> $logfile
 }
@@ -2861,6 +2859,8 @@ done
 
 disabled logging && logfile=/dev/null
 
+# command line configuration sanity checks
+
 # we need to build at least one lib type
 if ! enabled_any static shared; then
 cat < $TMPV
 if test_ldflags -Wl,${version_script},$TMPV; then
 append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
+quotes='""'
 check_cc 

Re: [libav-devel] [PATCH 9/9] Revert "configure: Detect AIX ar command instead of hardcoding it in the OS section"

2017-11-03 Thread Luca Barbato

On 03/11/2017 16:32, Diego Biurrun wrote:

On Wed, Oct 18, 2017 at 03:22:15AM +0200, Diego Biurrun wrote:

This reverts commit 4822ee3ca620a92cd2b0a9a03ea9e34288192c79.
AIX is a fringe oddity. Do not clutter the main codepath with AIX workarounds.
---
  configure | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)


We need a decision between this patch and deleting AIX support outright.
I think Martin expressed a (mild) preference for the former, Sean seemed
to express a (mild) preference for the latter. I'm agnostic and just want
to scratch this off my list. Opinions?


I'd keep aix support for the time being.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 9/9] Revert "configure: Detect AIX ar command instead of hardcoding it in the OS section"

2017-11-03 Thread Diego Biurrun
On Wed, Oct 18, 2017 at 03:22:15AM +0200, Diego Biurrun wrote:
> This reverts commit 4822ee3ca620a92cd2b0a9a03ea9e34288192c79.
> AIX is a fringe oddity. Do not clutter the main codepath with AIX workarounds.
> ---
>  configure | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

We need a decision between this patch and deleting AIX support outright.
I think Martin expressed a (mild) preference for the former, Sean seemed
to express a (mild) preference for the latter. I'm agnostic and just want
to scratch this off my list. Opinions?

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH v2] matroskadec: don't warn about unknown spherical medata when none is present

2017-11-03 Thread Luca Barbato

On 03/11/2017 00:53, James Almer wrote:

track->video.projection.type is set to 0 (a Matroska specific "No spherical
metadata present" value, with no related AVSphericalMapping) by default on
files without the element.

This removes bogus warnings on every single matroska file without Spherical
metadata.

Signed-off-by: James Almer 
---
  libavformat/matroskadec.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c6e1a190a8..3953cd304e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1658,6 +1658,9 @@ static int mkv_parse_video_projection(AVStream *st, const 
MatroskaTrack *track)
  return AVERROR_INVALIDDATA;
  }
  break;
+case MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR:
+/* No Spherical metadata */
+return 0;
  default:
  av_log(NULL, AV_LOG_WARNING,
 "Unknown spherical metadata type %"PRIu64"\n",



Thank you :)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] libspeexenc: Use speex_lib_get_mode instead of the speex_foo_mode data symbols

2017-11-03 Thread Luca Barbato

On 03/11/2017 11:05, Martin Storsjö wrote:

This avoids issues linking to a DLL version of libspeex, since the
libspeex headers lack proper dllimport declarations for the data
symbols.

This isn't an issue when building with mingw with GNU binutils, since
GNU ld can fix up that kind of data import automatically.
---
  libavcodec/libspeexenc.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c
index f3a31e9879..eb02e8ec6d 100644
--- a/libavcodec/libspeexenc.c
+++ b/libavcodec/libspeexenc.c
@@ -158,9 +158,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
  
  /* sample rate and encoding mode */

  switch (avctx->sample_rate) {
-case  8000: mode = _nb_mode;  break;
-case 16000: mode = _wb_mode;  break;
-case 32000: mode = _uwb_mode; break;
+case  8000: mode = speex_lib_get_mode(SPEEX_MODEID_NB);  break;
+case 16000: mode = speex_lib_get_mode(SPEEX_MODEID_WB);  break;
+case 32000: mode = speex_lib_get_mode(SPEEX_MODEID_UWB); break;
  default:
  av_log(avctx, AV_LOG_ERROR, "Sample rate of %d Hz is not supported. "
 "Resample to 8, 16, or 32 kHz.\n", avctx->sample_rate);



Ok.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] libspeexenc: Use speex_lib_get_mode instead of the speex_foo_mode data symbols

2017-11-03 Thread Martin Storsjö

On Fri, 3 Nov 2017, Martin Storsjö wrote:


This avoids issues linking to a DLL version of libspeex, since the
libspeex headers lack proper dllimport declarations for the data
symbols.

This isn't an issue when building with mingw with GNU binutils, since
GNU ld can fix up that kind of data import automatically.
---
libavcodec/libspeexenc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)


Locally amended the commit message with "libspeexdec.c already uses 
speex_lib_get_mode as well.", as a further argument for why this might be 
a good idea.


// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] libspeexenc: Use speex_lib_get_mode instead of the speex_foo_mode data symbols

2017-11-03 Thread Martin Storsjö
This avoids issues linking to a DLL version of libspeex, since the
libspeex headers lack proper dllimport declarations for the data
symbols.

This isn't an issue when building with mingw with GNU binutils, since
GNU ld can fix up that kind of data import automatically.
---
 libavcodec/libspeexenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c
index f3a31e9879..eb02e8ec6d 100644
--- a/libavcodec/libspeexenc.c
+++ b/libavcodec/libspeexenc.c
@@ -158,9 +158,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
 
 /* sample rate and encoding mode */
 switch (avctx->sample_rate) {
-case  8000: mode = _nb_mode;  break;
-case 16000: mode = _wb_mode;  break;
-case 32000: mode = _uwb_mode; break;
+case  8000: mode = speex_lib_get_mode(SPEEX_MODEID_NB);  break;
+case 16000: mode = speex_lib_get_mode(SPEEX_MODEID_WB);  break;
+case 32000: mode = speex_lib_get_mode(SPEEX_MODEID_UWB); break;
 default:
 av_log(avctx, AV_LOG_ERROR, "Sample rate of %d Hz is not supported. "
"Resample to 8, 16, or 32 kHz.\n", avctx->sample_rate);
-- 
2.13.6 (Apple Git-96)

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel