Re: [libav-devel] [PATCH] x86: lavr: fix stack allocation for 7 and 8 channel downmixing on x86-32

2012-11-12 Thread Ronald S. Bultje
Hi,

On Mon, Nov 12, 2012 at 12:41 PM, Luca Barbato  wrote:

> On 11/12/2012 07:35 PM, Justin Ruggles wrote:
> > Fixes crashes on Win32 and stack overruns on x86-32 in general.
>
> Who can test it?
>

http://bugzilla.libav.org/show_bug.cgi?id=338

Reproducible on x86-32 Linux/Mac with asan.

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


Re: [libav-devel] [PATCH 3/4] avcodec: split avpicture from imgconvert

2012-11-12 Thread Luca Barbato
On 11/12/2012 02:13 AM, Kieran Kunhya wrote:
> On Mon, Nov 12, 2012 at 1:09 AM, Kieran Kunhya  wrote:
>> On Mon, Nov 12, 2012 at 12:25 AM, Luca Barbato  wrote:
>>> All the non deprecated functions are in avpicture.c now.
>>> ---
>>>  libavcodec/Makefile |   1 +
>>>  libavcodec/avpicture.c  | 123 
>>> 
>>>  libavcodec/imgconvert.c |  85 -
>>
>> These functions are now lavc internal? av_image_alloc and similar were
>> quite useful for custom get_buffer functions amongst
>> other things.
> 
> Oh ignore me, imgconvert.h is still there.

It doesn't exist. The functions you are referring to are part of avutil
already.

The whole thing aims to remove

av_picture_pad and av_picture_crop since they won't work on quite used
pixel formats and are superceeded by swscale.

avpicture_deinterlace since it is superceeded by yadif


avcodec_find_best_pix_fmt* got a bit pointless since we aren't using
pixel formats to describe the color model, so it is at best provides an
hint.

I have a patch to simplify it, but I doubt it is of any use so we might
just remove it if nobody is using it.

lu


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


Re: [libav-devel] [PATCH] hlsenc: stand alone hls segmenter

2012-11-12 Thread Luca Barbato
On 11/10/2012 03:56 PM, Martin Storsjö wrote:
> On Sat, 10 Nov 2012, Luca Barbato wrote:
> 
>> Simplifies usage but has higher latency.
>> ---
>>
>> Yet another run of fixes, I hate this cold =_=
>>
>> doc/muxers.texi  |  21 +++
>> libavformat/Makefile |   1 +
>> libavformat/allformats.c |   2 +-
>> libavformat/hlsenc.c | 349
>> +++
>> 4 files changed, 372 insertions(+), 1 deletion(-)
>> create mode 100644 libavformat/hlsenc.c
> 
> Looks ok to me now, on a quick read through, if it is tested to work and
> not leak memory and so on.
> 
> The code is a bit scattered in small functions, which might be more
> readable if some of them were merged, but that can be improved later.
> 

Changed while I was at it, new version on ml.

lu

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


[libav-devel] [PATCH] hlsenc: stand alone hls segmenter

2012-11-12 Thread Luca Barbato
Simplifies usage but has higher latency.
---

Refactored a little more, I'd push this version.

 doc/muxers.texi  |  21 +++
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   2 +-
 libavformat/hlsenc.c | 324 +++
 4 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/hlsenc.c

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 4bb6d56..570041d 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -90,6 +90,27 @@ avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
 
 See also the @ref{crc} muxer.
 
+@anchor{hls}
+@section hls
+
+Apple HTTP Live Streaming muxer that segments MPEG-TS according to
+the HTTP Live Streaming specification.
+
+It creates a playlist file and numbered segment files. The output
+filename specifies the playlist filename; the segment filenames
+receive the same basename as the playlist, a sequential number and
+a .ts extension.
+
+@example
+avconv -i in.nut out.m3u8
+@end example
+
+@table @option
+@item -hls_time segment length in seconds
+@item -hls_list_size maximum number of playlist entries
+@item -hls_wrap number after which index wraps
+@end table
+
 @anchor{image2}
 @section image2
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index ed030bd..c589316 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -111,6 +111,7 @@ OBJS-$(CONFIG_H263_MUXER)+= rawenc.o
 OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
+OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o mpegtsenc.o
 OBJS-$(CONFIG_IDCIN_DEMUXER) += idcin.o
 OBJS-$(CONFIG_IFF_DEMUXER)   += iff.o
 OBJS-$(CONFIG_ILBC_DEMUXER)  += ilbc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 39daec7..c7c4be9 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -106,7 +106,7 @@ void av_register_all(void)
 REGISTER_MUXDEMUX (H261, h261);
 REGISTER_MUXDEMUX (H263, h263);
 REGISTER_MUXDEMUX (H264, h264);
-REGISTER_DEMUXER  (HLS, hls);
+REGISTER_MUXDEMUX (HLS, hls);
 REGISTER_DEMUXER  (IDCIN, idcin);
 REGISTER_DEMUXER  (IFF, iff);
 REGISTER_MUXDEMUX (ILBC, ilbc);
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
new file mode 100644
index 000..88f47e0
--- /dev/null
+++ b/libavformat/hlsenc.c
@@ -0,0 +1,324 @@
+/*
+ * Apple HTTP Live Streaming segmenter
+ * Copyright (c) 2012, 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
+ */
+
+#include 
+
+#include "libavutil/mathematics.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/avstring.h"
+#include "libavutil/opt.h"
+#include "libavutil/log.h"
+
+#include "avformat.h"
+#include "internal.h"
+
+typedef struct ListEntry {
+char  name[1024];
+int   duration;
+struct ListEntry *next;
+} ListEntry;
+
+typedef struct HLSContext {
+const AVClass *class;  // Class for private options.
+int number;
+AVOutputFormat *oformat;
+AVFormatContext *avf;
+float time;// Set by a private option.
+int  size; // Set by a private option.
+int  wrap; // Set by a private option.
+int64_t recording_time;
+int has_video;
+int64_t start_pts;
+int64_t end_pts;
+ListEntry *list;
+ListEntry *end_list;
+char *basename;
+AVIOContext *pb;
+} HLSContext;
+
+static int hls_mux_init(AVFormatContext *s)
+{
+HLSContext *hls = s->priv_data;
+AVFormatContext *oc;
+int i;
+
+hls->avf = oc = avformat_alloc_context();
+if (!oc)
+return AVERROR(ENOMEM);
+
+oc->oformat= hls->oformat;
+oc->interrupt_callback = s->interrupt_callback;
+
+for (i = 0; i < s->nb_streams; i++) {
+AVStream *st;
+if (!(st = avformat_new_stream(oc, NULL)))
+return AVERROR(ENOMEM);
+avcodec_copy_context(st->codec, s->streams[i]->codec);
+st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+}
+
+return 0;
+}
+
+static int append_entry(HLSContext *hls, uint64_t duration)
+{
+ListEntry *en = av_malloc(sizeof(*en));
+
+if (!en)
+

Re: [libav-devel] [PATCH] x86: lavr: fix stack allocation for 7 and 8 channel downmixing on x86-32

2012-11-12 Thread Luca Barbato
On 11/12/2012 07:35 PM, Justin Ruggles wrote:
> Fixes crashes on Win32 and stack overruns on x86-32 in general.

Who can test it?
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] x86: lavr: fix stack allocation for 7 and 8 channel downmixing on x86-32

2012-11-12 Thread Justin Ruggles
From: Ronald S. Bultje 

Fixes crashes on Win32 and stack overruns on x86-32 in general.
---
I don't think it was correct to hard-code the stack offsets. Those stack src
pointers are used in 8 different functions, each of which has a different
number of matrix elements on the stack.

 libavresample/x86/audio_mix.asm |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/libavresample/x86/audio_mix.asm b/libavresample/x86/audio_mix.asm
index 47c23e4..daf0a7b 100644
--- a/libavresample/x86/audio_mix.asm
+++ b/libavresample/x86/audio_mix.asm
@@ -272,7 +272,15 @@ cglobal mix_%1_to_%2_%3_flt, 
3,in_channels+2,needed_mmregs+matrix_elements_mm, s
 and   rsp, ~(mmsize-1)
 sub   rsp, matrix_elements_stack * mmsize
 %else
-%assign pad matrix_elements_stack * mmsize + (mmsize - gprsize) - 
(stack_offset & (mmsize - gprsize))
+%assign matrix_stack_size matrix_elements_stack * mmsize
+%assign pad matrix_stack_size + (mmsize - gprsize) - (stack_offset & 
(mmsize - gprsize))
+; on x86-32 for 7 and 8 channels we need more stack space for src pointers
+%if ARCH_X86_32 && in_channels >= 7
+%assign pad pad + 0x10
+%define src5m [rsp+matrix_stack_size+0]
+%define src6m [rsp+matrix_stack_size+4]
+%define src7m [rsp+matrix_stack_size+8]
+%endif
 SUB   rsp, pad
 %endif
 %endif
-- 
1.7.1

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


Re: [libav-devel] [libav-commits] crc: move doxy to the header

2012-11-12 Thread Diego Biurrun
On Fri, Nov 02, 2012 at 06:58:08PM +0100, Anton Khirnov wrote:
> 
> crc: move doxy to the header
> 
> --- a/libavutil/crc.c
> +++ b/libavutil/crc.c
> @@ -108,13 +87,6 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id)
>  
> -/**
> - * Calculate the CRC of a block.
> - * @param crc CRC of previous blocks if any or initial value for CRC
> - * @return CRC updated with the data from the given block
> - *
> - * @see av_crc_init() "le" parameter
> - */
>  uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
>  const uint8_t *buffer, size_t length)
> --- a/libavutil/crc.h
> +++ b/libavutil/crc.h
> @@ -36,8 +36,38 @@ typedef enum {
> +/**
> + * Calculate the CRC of a block.
> + * @param crc CRC of previous blocks if any or initial value for CRC
> + * @return CRC updated with the data from the given block
> + *
> + * @see av_crc_init() "le" parameter
> + */
>  uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, 
> size_t length) av_pure;

The names of the function parameters do not match between .c and .h file
(why does gcc not have an option to warn about this?), thus the Doxygen
in the header is now incorrect.

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


Re: [libav-devel] [PATCH] configure: Refactor CPPFLAGS settings for glibc

2012-11-12 Thread Diego Biurrun
On Sat, Oct 13, 2012 at 07:20:17PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> > On Sat, Oct 13, 2012 at 06:27:57PM +0100, Måns Rullgård wrote:
> >> Diego Biurrun  writes:
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -2819,7 +2819,6 @@ case $target_os in
> >> >  add_cppflags -U__STRICT_ANSI__
> >> >  ;;
> >> >  linux)
> >> > -add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
> >> >  enable dv1394
> >> >  ;;
> >> > @@ -2850,10 +2849,9 @@ case $target_os in
> >> >  enable dos_paths
> >> >  ;;
> >> >  gnu/kfreebsd)
> >> > -add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 
> >> > -D_BSD_SOURCE
> >> > +add_cppflags -D_BSD_SOURCE
> >> >  ;;
> >> >  gnu)
> >> > -add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
> >> >  ;;
> >> >  qnx)
> >> > @@ -2890,6 +2888,7 @@ if check_cpp_condition features.h "defined 
> >> > __UCLIBC__"; then
> >> >  libc_type=uclibc
> >> >  elif check_cpp_condition features.h "defined __GLIBC__"; then
> >> >  libc_type=glibc
> >> > +add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
> >> >  elif check_header _mingw.h; then
> >> >  libc_type=mingw
> >> >  check_cpp_condition _mingw.h \
> >> 
> >> This might need adjusting for linux/uclibc to work.
> >
> > Do you have a system at hand to test?  Or do you suggest just adding
> > the flags to the uclibc section as well?
> 
> I have more than one.  I'll test it and report back.

.. ping ..

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


Re: [libav-devel] [PATCH] configure: properly support DEC/Compaq compiler

2012-11-12 Thread Diego Biurrun
On Mon, Nov 12, 2012 at 11:07:07AM +, Mans Rullgard wrote:
> --- a/configure
> +++ b/configure
> @@ -2108,6 +2108,24 @@ EOF
>  
> +ccc_flags(){
> +for flag; do
> +case $flag in
> +-O*|-fast)  echo $flag  ;;
> +-f*|-W*);;
> +*)  echo $flag  ;;

Listing -O* with -fast seems unnecessary.
Otherwise LGTM.

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


Re: [libav-devel] [PATCH 4/4] pixdesc: add PIX_FMT_ALPHA flag

2012-11-12 Thread Luca Barbato

On 11/12/12 9:02 AM, Kostya Shishkov wrote:

On Mon, Nov 12, 2012 at 01:25:46AM +0100, Luca Barbato wrote:

---
  libavutil/pixdesc.h | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index c30ae1f..b4c01e2 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -96,6 +96,9 @@ typedef struct AVPixFmtDescriptor{
   */
  #define PIX_FMT_PSEUDOPAL 64

+#define PIX_FMT_ALPHA   128 ///< The pixel formats has an alpha channel
+
+
  #if FF_API_PIX_FMT_DESC
  /**
   * The array of all the pixel format descriptors.
--


Why not add it to the needed pixdesc entries too?


Because it takes time so a yes will make the update magically appear, a 
no would spare me 30 min =)


lu

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


Re: [libav-devel] [PATCH] configure: properly support DEC/Compaq compiler

2012-11-12 Thread Luca Barbato

On 11/12/12 12:07 PM, Mans Rullgard wrote:

Signed-off-by: Mans Rullgard 
---
Although obscure, we should either support this compiler properly or
not pretend to support it at all.  Since it does produce a working
build and provides some useful warnings rarely found in other compilers,
keeping it seems like a good choice.
---
  configure | 40 +++-
  1 file changed, 31 insertions(+), 9 deletions(-)


ok.

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


Re: [libav-devel] [PATCH 1/2] lavc: initialize output AVFrame before decoding.

2012-11-12 Thread Anton Khirnov

On Mon, 12 Nov 2012 12:10:33 +, Gil Pedersen  wrote:
> On 12/11/2012, at 12.32, Anton Khirnov 
> mailto:an...@khirnov.net>>
>  wrote:
> 
> This patch breaks the API for avcodec_decode_audio4(). The frame parameter is
> specified as an "out" option, but it now requires the input data to be
> zero'ed, otherwise you risk free() being called on a random location.
> 
> What would cause the frame to be filled with random data? Both
> avcodec_alloc_frame() and avcodec_get_frame_defaults() initialize the frame
> properly.
> 
> The patch broke the code in my application where I call it with a
> stack-allocated AVFrame. I never call avcodec_get_frame_defaults() on it, so
> that would explain it. However, from the documentation on
> avcodec_decode_audio4() it is not clear that it is expected to be allocated in
> any other way. Now I realise that I was doing it wrong all the time.
> 

You must never allocate AVFrame on stack. The API requires that you allocate it
with avcodec_alloc_frame(). This follows from the
'sizeof(AVFrame) must not be used outside libav*.'
line in the doxy, but I agree that it should be more clear. I will look into
fixing the docs.

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


Re: [libav-devel] [PATCH 1/2] lavc: initialize output AVFrame before decoding.

2012-11-12 Thread Gil Pedersen
On 12/11/2012, at 12.32, Anton Khirnov 
mailto:an...@khirnov.net>>
 wrote:

This patch breaks the API for avcodec_decode_audio4(). The frame parameter is
specified as an "out" option, but it now requires the input data to be
zero'ed, otherwise you risk free() being called on a random location.

What would cause the frame to be filled with random data? Both
avcodec_alloc_frame() and avcodec_get_frame_defaults() initialize the frame
properly.

The patch broke the code in my application where I call it with a 
stack-allocated AVFrame. I never call avcodec_get_frame_defaults() on it, so 
that would explain it. However, from the documentation on 
avcodec_decode_audio4() it is not clear that it is expected to be allocated in 
any other way. Now I realise that I was doing it wrong all the time.

Since the result of avcodec_decode_audio4() is affected by the frame parameter, 
I suggest you add an "in" designation in the documentation. The same goes for 
avcodec_decode_video2() and the picture parameter.

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


Re: [libav-devel] [PATCH 1/2] lavc: initialize output AVFrame before decoding.

2012-11-12 Thread Anton Khirnov

On Mon, 12 Nov 2012 10:57:30 +, Gil Pedersen  wrote:
> On 23/10/2012, at 08.33, Anton Khirnov  wrote:
> 
> > Avoids memleaks with audio when extended_data is nontrivial and the user
> > doesn't reset the frame.
> > Shouldn't have any effect for video for now, but might be useful in the
> > future.
> > ---
> > libavcodec/utils.c |4 
> > 1 file changed, 4 insertions(+)
> > 
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index 5e22b9f..da798d9 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -1305,6 +1305,8 @@ int attribute_align_arg 
> > avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
> > avctx->pkt = avpkt;
> > apply_param_change(avctx, avpkt);
> > 
> > +avcodec_get_frame_defaults(picture);
> > +
> > if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || 
> > (avctx->active_thread_type & FF_THREAD_FRAME)) {
> > if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
> > ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
> > @@ -1400,6 +1402,8 @@ int attribute_align_arg 
> > avcodec_decode_audio4(AVCodecContext *avctx,
> > 
> > apply_param_change(avctx, avpkt);
> > 
> > +avcodec_get_frame_defaults(frame);
> > +
> > if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
> > ret = avctx->codec->decode(avctx, frame, got_frame_ptr, avpkt);
> > if (ret >= 0 && *got_frame_ptr) {
> 
> This patch breaks the API for avcodec_decode_audio4(). The frame parameter is
> specified as an "out" option, but it now requires the input data to be
> zero'ed, otherwise you risk free() being called on a random location.

What would cause the frame to be filled with random data? Both
avcodec_alloc_frame() and avcodec_get_frame_defaults() initialize the frame
properly.

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


[libav-devel] [PATCH] configure: properly support DEC/Compaq compiler

2012-11-12 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
Although obscure, we should either support this compiler properly or
not pretend to support it at all.  Since it does produce a working
build and provides some useful warnings rarely found in other compilers,
keeping it seems like a good choice.
---
 configure | 40 +++-
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ae122e7..b6505ca 100755
--- a/configure
+++ b/configure
@@ -2108,6 +2108,24 @@ EOF
 die "Sanity test failed."
 fi
 
+ccc_flags(){
+for flag; do
+case $flag in
+-std=c99)   echo -c99   ;;
+-mcpu=*)echo -arch ${flag#*=}   ;;
+-mieee) echo -ieee  ;;
+-O*|-fast)  echo $flag  ;;
+-fno-math-errno)echo -assume nomath_errno   ;;
+-g) echo -g3;;
+-Wall)  echo -msg_enable level2 ;;
+-Wno-pointer-sign)  echo -msg_disable ptrmismatch1  ;;
+-Wl,*)  echo $flag  ;;
+-f*|-W*);;
+*)  echo $flag  ;;
+esac
+   done
+}
+
 msvc_flags(){
 for flag; do
 case $flag in
@@ -2258,10 +2276,9 @@ probe_cc(){
 _type=ccc
 _ident=$($_cc -V | head -n 1 | cut -d ' ' -f 1-3)
 _DEPFLAGS='-M'
-debuglevel=3
-_ldflags='-Wl,-z,now' # calls to libots crash without this
 _cflags_speed='-fast'
 _cflags_size='-O1'
+_flags_filter=ccc_flags
 elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
 test -d "$sysroot" || die "No valid sysroot specified."
 _type=armcc
@@ -2609,7 +2626,7 @@ elif enabled arm; then
 
 elif enabled alpha; then
 
-enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
+cpuflags="-mcpu=$cpu"
 
 elif enabled bfin; then
 
@@ -2960,6 +2977,10 @@ if enabled_all tms470 glibc; then
 add_cflags   -pds=48# incompatible redefinition of macro
 fi
 
+if enabled_all ccc glibc; then
+add_ldflags -Wl,-z,now  # calls to libots crash without this
+fi
+
 esc(){
 echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
 }
@@ -3538,12 +3559,10 @@ if enabled icc; then
 fi
 elif enabled ccc; then
 # disable some annoying warnings
-add_cflags -msg_disable cvtu32to64
-add_cflags -msg_disable embedcomment
-add_cflags -msg_disable needconstext
-add_cflags -msg_disable nomainieee
-add_cflags -msg_disable ptrmismatch1
-add_cflags -msg_disable unreachcode
+add_cflags -msg_disable bitnotint
+add_cflags -msg_disable mixfuncvoid
+add_cflags -msg_disable nonstandcast
+add_cflags -msg_disable unsupieee
 elif enabled gcc; then
 check_optflags -fno-tree-vectorize
 check_cflags -Werror=implicit-function-declaration
@@ -3572,6 +3591,9 @@ elif enabled msvc; then
 fi
 
 case $target_os in
+osf1)
+enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
+;;
 plan9)
 add_cppflags -Dmain=plan9_main
 ;;
-- 
1.8.0

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


Re: [libav-devel] [PATCH 1/2] lavc: initialize output AVFrame before decoding.

2012-11-12 Thread Gil Pedersen
On 23/10/2012, at 08.33, Anton Khirnov  wrote:

> Avoids memleaks with audio when extended_data is nontrivial and the user
> doesn't reset the frame.
> Shouldn't have any effect for video for now, but might be useful in the
> future.
> ---
> libavcodec/utils.c |4 
> 1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 5e22b9f..da798d9 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1305,6 +1305,8 @@ int attribute_align_arg 
> avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
> avctx->pkt = avpkt;
> apply_param_change(avctx, avpkt);
> 
> +avcodec_get_frame_defaults(picture);
> +
> if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || 
> (avctx->active_thread_type & FF_THREAD_FRAME)) {
> if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
> ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
> @@ -1400,6 +1402,8 @@ int attribute_align_arg 
> avcodec_decode_audio4(AVCodecContext *avctx,
> 
> apply_param_change(avctx, avpkt);
> 
> +avcodec_get_frame_defaults(frame);
> +
> if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
> ret = avctx->codec->decode(avctx, frame, got_frame_ptr, avpkt);
> if (ret >= 0 && *got_frame_ptr) {

This patch breaks the API for avcodec_decode_audio4(). The frame parameter is 
specified as an "out" option, but it now requires the input data to be zero'ed, 
otherwise you risk free() being called on a random location.

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


Re: [libav-devel] [PATCH 42/42] yop: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/yop.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/yop.c b/libavformat/yop.c
index 51d088b..351938b 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -22,6 +22,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -74,6 +75,7 @@ static int yop_read_header(AVFormatContext *s)
audio_dec->codec_type   = AVMEDIA_TYPE_AUDIO;
audio_dec->codec_id = AV_CODEC_ID_ADPCM_IMA_APC;
audio_dec->channels = 1;
+audio_dec->channels = AV_CH_LAYOUT_MONO;
audio_dec->sample_rate  = 22050;

// Video
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 41/42] wtv: set channel layout for mpeg audio

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/wtv.c |   11 +--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index 57d239e..7bb421b 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -25,6 +25,7 @@
 * @author Peter Ross 
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
@@ -618,8 +619,14 @@ static void parse_mpeg1waveformatex(AVStream *st)

/* dwHeadMode */
switch (AV_RL16(st->codec->extradata + 6)) {
-case 1 : case 2 : case 4 : st->codec->channels = 2; break;
-case 8 :   st->codec->channels = 1; break;
+case 1 :
+case 2 :
+case 4 : st->codec->channels   = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ break;
+case 8 : st->codec->channels   = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ break;
}
}

--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 40/42] westwood_aud: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/westwood_aud.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c
index 806aea6..2a06c29 100644
--- a/libavformat/westwood_aud.c
+++ b/libavformat/westwood_aud.c
@@ -33,6 +33,7 @@
 * qualify a file. Refer to wsaud_probe() for the precise parameters.
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -120,6 +121,8 @@ static int wsaud_read_header(AVFormatContext *s)
avpriv_set_pts_info(st, 64, 1, sample_rate);
st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
st->codec->channels= channels;
+st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
+AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = sample_rate;

return 0;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 39/42] wc3movie: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/wc3movie.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index 117e4ea..c894253 100644
--- a/libavformat/wc3movie.c
+++ b/libavformat/wc3movie.c
@@ -27,6 +27,7 @@
 *   http://www.pcisys.net/~melanson/codecs/
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -183,6 +184,7 @@ static int wc3_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
st->codec->codec_tag = 1;
st->codec->channels = WC3_AUDIO_CHANNELS;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->bits_per_coded_sample = WC3_AUDIO_BITS;
st->codec->sample_rate = WC3_SAMPLE_RATE;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 38/42] tmv: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/tmv.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index 100e12f..103ac4a 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -26,6 +26,7 @@
 * @see http://www.oldskool.org/pc/8088_Corruption
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -112,7 +113,13 @@ static int tmv_read_header(AVFormatContext *s)

ast->codec->codec_type= AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id  = AV_CODEC_ID_PCM_U8;
-ast->codec->channels  = features & TMV_STEREO ? 2 : 1;
+if (features & TMV_STEREO) {
+ast->codec->channels   = 2;
+ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+ast->codec->channels   = 1;
+ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
ast->codec->bits_per_coded_sample = 8;
ast->codec->bit_rate  = ast->codec->sample_rate *
ast->codec->bits_per_coded_sample;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 37/42] tiertexseq: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/tiertexseq.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c
index 5582890..45300f9 100644
--- a/libavformat/tiertexseq.c
+++ b/libavformat/tiertexseq.c
@@ -24,6 +24,7 @@
 * Tiertex Limited SEQ file demuxer
 */

+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"

@@ -231,6 +232,7 @@ static int seq_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
st->codec->codec_tag = 0;  /* no tag */
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = SEQ_SAMPLE_RATE;
st->codec->bits_per_coded_sample = 16;
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * 
st->codec->channels;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 36/42] swfdec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/swfdec.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index ff44452..f105c14 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -20,6 +20,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "swf.h"

@@ -139,7 +140,13 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
if (!ast)
return -1;
ast->id = -1; /* -1 to avoid clash with video stream ch_id */
-ast->codec->channels = 1 + (v&1);
+if (v & 1) {
+ast->codec->channels   = 2;
+ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+ast->codec->channels   = 1;
+ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) 
& 15);
ast->need_parsing = AVSTREAM_PARSE_FULL;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 35/42] sol: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/sol.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/sol.c b/libavformat/sol.c
index da84600..92599b1 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -23,6 +23,7 @@
 * Based on documents from Game Audio Player and own research
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -116,6 +117,8 @@ static int sol_read_header(AVFormatContext *s)
st->codec->codec_tag = id;
st->codec->codec_id = codec;
st->codec->channels = channels;
+st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
+AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = rate;
avpriv_set_pts_info(st, 64, 1, rate);
return 0;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 34/42] smacker: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/smacker.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index dcca1af..17c7c52 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -24,6 +24,7 @@
 */

#include "libavutil/bswap.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -191,7 +192,13 @@ static int smacker_read_header(AVFormatContext *s)
} else {
ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8;
}
-ast[i]->codec->channels = (smk->aflags[i] & SMK_AUD_STEREO) ? 2 : 
1;
+if (smk->aflags[i] & SMK_AUD_STEREO) {
+ast[i]->codec->channels   = 2;
+ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+ast[i]->codec->channels   = 1;
+ast[i]->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
ast[i]->codec->sample_rate = smk->rates[i];
ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & 
SMK_AUD_16BITS) ? 16 : 8;
if(ast[i]->codec->bits_per_coded_sample == 16 && 
ast[i]->codec->codec_id == AV_CODEC_ID_PCM_U8)
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 33/42] siff: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/siff.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/siff.c b/libavformat/siff.c
index 02af80b..8ba7c60 100644
--- a/libavformat/siff.c
+++ b/libavformat/siff.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -78,6 +79,7 @@ static int create_audio_stream(AVFormatContext *s, 
SIFFContext *c)
ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id= AV_CODEC_ID_PCM_U8;
ast->codec->channels= 1;
+ast->codec->channel_layout  = AV_CH_LAYOUT_MONO;
ast->codec->bits_per_coded_sample = 8;
ast->codec->sample_rate = c->rate;
avpriv_set_pts_info(ast, 16, 1, c->rate);
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 32/42] sierravmd: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/sierravmd.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 6490fdd..359282c 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -27,6 +27,7 @@
 *   http://www.pcisys.net/~melanson/codecs/
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -132,7 +133,13 @@ static int vmd_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_VMDAUDIO;
st->codec->codec_tag = 0;  /* no fourcc */
-st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
+if (vmd->vmd_header[811] & 0x80) {
+st->codec->channels   = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
st->codec->sample_rate = vmd->sample_rate;
st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
if (st->codec->block_align & 0x8000) {
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 30/42] rsodec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/rsodec.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c
index f5bcebb..c3016ca 100644
--- a/libavformat/rsodec.c
+++ b/libavformat/rsodec.c
@@ -20,6 +20,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -63,6 +64,7 @@ static int rso_read_header(AVFormatContext *s)
st->codec->codec_tag= id;
st->codec->codec_id = codec;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate  = rate;

avpriv_set_pts_info(st, 64, 1, rate);
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 29/42] rmdec: set channel layout for RA version 3

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/rmdec.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 07d218e..aff21fb 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -20,6 +20,7 @@
 */

#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -140,6 +141,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, 
AVIOContext *pb,
avio_skip(pb, header_size + startpos - avio_tell(pb));
st->codec->sample_rate = 8000;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_RA_144;
ast->deint_id = DEINT_ID_INT0;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 28/42] qcp: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/qcp.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index bde5990..30d362f 100644
--- a/libavformat/qcp.c
+++ b/libavformat/qcp.c
@@ -27,6 +27,7 @@
 * http://tools.ietf.org/html/rfc3625
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"

@@ -96,6 +97,7 @@ static int qcp_read_header(AVFormatContext *s)

st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
avio_read(pb, buf, 16);
if (is_qcelp_13k_guid(buf)) {
st->codec->codec_id = AV_CODEC_ID_QCELP;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 27/42] psxstr: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/psxstr.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index 800d9cb..633d61d 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -29,6 +29,7 @@
 * RIFF headers, followed by CD sectors.
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -219,7 +220,13 @@ static int str_read_packet(AVFormatContext *s,
st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id= AV_CODEC_ID_ADPCM_XA;
st->codec->codec_tag   = 0;  /* no fourcc */
-st->codec->channels= (fmt&1)?2:1;
+if (fmt & 1) {
+st->codec->channels   = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
st->codec->sample_rate = (fmt&4)?18900:37800;
//st->codec->bit_rate = 0; //FIXME;
st->codec->block_align = 128;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 26/42] omadec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/omadec.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 022942d..9b22999 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -40,6 +40,7 @@
 * CODEC SUPPORT: Only ATRAC3 codec is currently supported!
 */

+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
@@ -312,6 +313,7 @@ static int oma_read_header(AVFormatContext *s)
framesize = (codec_params & 0x3FF) * 8;
jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for 
joint-stereo */
st->codec->channels= 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = samplerate;
st->codec->bit_rate= st->codec->sample_rate * framesize * 8 / 
1024;

@@ -346,6 +348,7 @@ static int oma_read_header(AVFormatContext *s)
case OMA_CODECID_LPCM:
/* PCM 44.1 kHz 16 bit stereo big-endian */
st->codec->channels = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = 44100;
framesize = 1024;
/* bit rate = sample rate x PCM block align (= 4) x 8 */
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 24/42] nuv: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/nuv.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index fce96b4..2cbf348 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "avformat.h"
@@ -99,6 +100,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
ast->codec->sample_rate = avio_rl32(pb);
ast->codec->bits_per_coded_sample = avio_rl32(pb);
ast->codec->channels = avio_rl32(pb);
+ast->codec->channel_layout = 0;
ast->codec->codec_id =
ff_wav_codec_get_id(ast->codec->codec_tag,
 ast->codec->bits_per_coded_sample);
@@ -179,6 +181,7 @@ static int nuv_header(AVFormatContext *s) {
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
ast->codec->channels = 2;
+ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
ast->codec->sample_rate = 44100;
ast->codec->bit_rate = 2 * 2 * 44100 * 8;
ast->codec->block_align = 2 * 2;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 23/42] mxg: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/mxg.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mxg.c b/libavformat/mxg.c
index 09653ee..8959134 100644
--- a/libavformat/mxg.c
+++ b/libavformat/mxg.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/mjpeg.h"
#include "avformat.h"
@@ -56,6 +57,7 @@ static int mxg_read_header(AVFormatContext *s)
audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
audio_st->codec->codec_id = AV_CODEC_ID_PCM_ALAW;
audio_st->codec->channels = 1;
+audio_st->codec->channel_layout = AV_CH_LAYOUT_MONO;
audio_st->codec->sample_rate = 8000;
audio_st->codec->bits_per_coded_sample = 8;
audio_st->codec->block_align = 1;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 22/42] mvi: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/mvi.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mvi.c b/libavformat/mvi.c
index c5aee5a..10ec8bb 100644
--- a/libavformat/mvi.c
+++ b/libavformat/mvi.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"

@@ -81,6 +82,7 @@ static int read_header(AVFormatContext *s)
ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id= AV_CODEC_ID_PCM_U8;
ast->codec->channels= 1;
+ast->codec->channel_layout  = AV_CH_LAYOUT_MONO;
ast->codec->bits_per_coded_sample = 8;
ast->codec->bit_rate= ast->codec->sample_rate * 8;

--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 21/42] mpc7: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/mpc.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index fbf8e92..5e771ae 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "internal.h"
@@ -91,6 +92,7 @@ static int mpc_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_MUSEPACK7;
st->codec->channels = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->bits_per_coded_sample = 16;

st->codec->extradata_size = 16;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 20/42] mmf: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/mmf.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 06d4a2b..20570f2 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -18,6 +18,8 @@
 * License along with Libav; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */
+
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
@@ -249,6 +251,7 @@ static int mmf_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_ADPCM_YAMAHA;
st->codec->sample_rate = rate;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->bits_per_coded_sample = 4;
st->codec->bit_rate = st->codec->sample_rate * 
st->codec->bits_per_coded_sample;

--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 19/42] mm: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/mm.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mm.c b/libavformat/mm.c
index 13f33a2..83539fa 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -31,6 +31,7 @@
 *  http://wiki.multimedia.cx/index.php?title=American_Laser_Games_MM
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -124,6 +125,7 @@ static int read_header(AVFormatContext *s)
st->codec->codec_tag = 0; /* no fourcc */
st->codec->codec_id = AV_CODEC_ID_PCM_U8;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000;
avpriv_set_pts_info(st, 64, 1, 8000); /* 8000 hz */
}
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 18/42] jvdec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/jvdec.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 47a6142..cf9df8c 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -25,6 +25,7 @@
 * @author Peter Ross 
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -91,6 +92,7 @@ static int read_header(AVFormatContext *s)
ast->codec->codec_tag   = 0; /* no fourcc */
ast->codec->sample_rate = avio_rl16(pb);
ast->codec->channels= 1;
+ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);

avio_skip(pb, 10);
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 17/42] iss: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/iss.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libavformat/iss.c b/libavformat/iss.c
index 14f64d2..3f7f4fe 100644
--- a/libavformat/iss.c
+++ b/libavformat/iss.c
@@ -26,6 +26,7 @@
 * @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS
 */

+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/avstring.h"
@@ -94,7 +95,13 @@ static av_cold int iss_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS;
-st->codec->channels = stereo ? 2 : 1;
+if (stereo) {
+st->codec->channels   = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
st->codec->sample_rate = 44100;
if(rate_divisor > 0)
 st->codec->sample_rate /= rate_divisor;
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 16/42] ipmovie: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/ipmovie.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index b567fb2..60ae939 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -32,6 +32,7 @@
 * up and sending out the chunks.
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -600,6 +601,8 @@ static int ipmovie_read_header(AVFormatContext *s)
st->codec->codec_id = ipmovie->audio_type;
st->codec->codec_tag = 0;  /* no tag */
st->codec->channels = ipmovie->audio_channels;
+st->codec->channel_layout = st->codec->channels == 1 ? 
AV_CH_LAYOUT_MONO :
+   
AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = ipmovie->audio_sample_rate;
st->codec->bits_per_coded_sample = ipmovie->audio_bits;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 14/42] idroqdec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/idroqdec.c |   10 +-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index 521f586..eeaafec 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -27,6 +27,7 @@
 *   http://www.csse.monash.edu.au/~timf/
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -175,7 +176,14 @@ static int roq_read_packet(AVFormatContext *s,
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM;
st->codec->codec_tag = 0;  /* no tag */
-st->codec->channels = roq->audio_channels = chunk_type == 
RoQ_SOUND_STEREO ? 2 : 1;
+if (chunk_type == RoQ_SOUND_STEREO) {
+st->codec->channels   = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+} else {
+st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+}
+roq->audio_channels= st->codec->channels;
st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE;
st->codec->bits_per_coded_sample = 16;
st->codec->bit_rate = st->codec->channels * 
st->codec->sample_rate *
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 13/42] gxfdec: set channel layout when applicable

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/gxf.c |4 
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index 2593c06..6feb3c3 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "avformat.h"
#include "internal.h"
@@ -119,6 +120,7 @@ static int get_sindex(AVFormatContext *s, int id, int 
format) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 48000;
st->codec->bit_rate = 3 * 1 * 48000 * 8;
st->codec->block_align = 3 * 1;
@@ -128,6 +130,7 @@ static int get_sindex(AVFormatContext *s, int id, int 
format) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 48000;
st->codec->bit_rate = 2 * 1 * 48000 * 8;
st->codec->block_align = 2 * 1;
@@ -137,6 +140,7 @@ static int get_sindex(AVFormatContext *s, int id, int 
format) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_AC3;
st->codec->channels = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = 48000;
break;
// timecode tracks:
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 10/42] dv: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/dv.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 5ce73f7..1730972 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -33,6 +33,7 @@
#include "internal.h"
#include "libavcodec/dv_profile.h"
#include "libavcodec/dvdata.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "dv.h"
@@ -246,6 +247,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, 
uint8_t* frame)
}
c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
c->ast[i]->codec->channels= 2;
+c->ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO;
c->ast[i]->codec->bit_rate= 2 * dv_audio_frequency[freq] * 16;
c->ast[i]->start_time = 0;
}
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 15/42] iff: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/iff.c |   10 +-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index c2bc283..ab22e11 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -29,6 +29,7 @@
 * http://wiki.multimedia.cx/index.php?title=IFF
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -120,6 +121,7 @@ static int iff_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);

st->codec->channels = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
avio_skip(pb, 8);
// codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and 
interlaced (ILBM) content
st->codec->codec_tag = avio_rl32(pb);
@@ -154,7 +156,13 @@ static int iff_read_header(AVFormatContext *s)
case ID_CHAN:
if (data_size < 4)
return AVERROR_INVALIDDATA;
-st->codec->channels = (avio_rb32(pb) < 6) ? 1 : 2;
+if (avio_rb32(pb) < 6) {
+st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+} else {
+st->codec->channels   = 2;
+st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+}
break;

case ID_CMAP:
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 11/42] flvdec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/flvdec.c |4 
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 868cc6b..7d5ea56 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -25,6 +25,7 @@
 */

#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/intfloat.h"
@@ -749,6 +750,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
*pkt)
bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
if(!st->codec->channels || !st->codec->sample_rate || 
!st->codec->bits_per_coded_sample) {
st->codec->channels  = channels;
+st->codec->channel_layout= channels == 1 ? 
AV_CH_LAYOUT_MONO :
+   
AV_CH_LAYOUT_STEREO;
st->codec->sample_rate   = sample_rate;
st->codec->bits_per_coded_sample = bits_per_coded_sample;
}
@@ -794,6 +797,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
*pkt)
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
 st->codec->extradata_size * 8, 1);
st->codec->channels = cfg.channels;
+st->codec->channel_layout = 0;
if (cfg.ext_sample_rate)
st->codec->sample_rate = cfg.ext_sample_rate;
else
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 31/42] rtpdec_amr: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/rtpdec_amr.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c
index cc43e31..1e60287 100644
--- a/libavformat/rtpdec_amr.c
+++ b/libavformat/rtpdec_amr.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "rtpdec_formats.h"
#include "libavutil/avstring.h"
@@ -77,6 +78,7 @@ static int amr_handle_packet(AVFormatContext *ctx,
av_log(ctx, AV_LOG_ERROR, "Only mono AMR is supported\n");
return AVERROR_INVALIDDATA;
}
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;

/* The AMR RTP packet consists of one header byte, followed
 * by one TOC byte for each AMR frame in the packet, followed
--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 12/42] gsmdec: set channel layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/gsmdec.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/gsmdec.c b/libavformat/gsmdec.c
index f0cb279..f9ecbaf 100644
--- a/libavformat/gsmdec.c
+++ b/libavformat/gsmdec.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/channel_layout.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avformat.h"
@@ -64,6 +65,7 @@ static int gsm_read_header(AVFormatContext *s)
st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id= s->iformat->raw_codec_id;
st->codec->channels= 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = c->sample_rate;
st->codec->bit_rate= GSM_BLOCK_SIZE * 8 * c->sample_rate / 
GSM_BLOCK_SAMPLES;

--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 01/42] amr: set channel_layout

2012-11-12 Thread Martin Storsjö

On Mon, 12 Nov 2012, Justin Ruggles wrote:


---
libavformat/amr.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/amr.c b/libavformat/amr.c
index cc4842e..ba91d7c 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -25,6 +25,8 @@ Write and read amr data according to RFC3267, 
http://www.ietf.org/rfc/rfc3267.tx
Only mono files are supported.

*/
+
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"

@@ -97,6 +99,7 @@ static int amr_read_header(AVFormatContext *s)
st->codec->sample_rate = 8000;
}
st->codec->channels   = 1;
+st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);

--
1.7.1


Ok

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


Re: [libav-devel] [PATCH 1/4] pixdesc: add av_pix_fmt_get_chroma_sub_sample

2012-11-12 Thread Diego Biurrun
On Mon, Nov 12, 2012 at 01:25:43AM +0100, Luca Barbato wrote:
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -4285,7 +4285,12 @@ int av_picture_pad(AVPicture *dst, const AVPicture 
> *src, int height, int width,
>  
> -void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, 
> int *v_shift);
> +/**
> + *
> + * @deprecated Use av_pix_fmt_get_chroma_sub_sample
> + */
> +
> +void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat 
> pix_fmt, int *h_shift, int *v_shift);

nit: Collapse the Doxygen to one line please.

> --- a/libavutil/pixdesc.h
> +++ b/libavutil/pixdesc.h
> @@ -203,4 +203,19 @@ const AVPixFmtDescriptor *av_pix_fmt_desc_next(const 
> AVPixFmtDescriptor *prev);
>  
> +/**
> + * Utility function to access log2_chroma_w log2_chroma_h from
> + * the pixel format AVPixFmtDescriptor.
> + *
> + * @param pix_fmt the pixel format
> + * @param[out] h_shift store log2_chroma_h
> + * @param[out] v_shift store log2_chroma_w

nit: Please align the parameter descriptions.

> + * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
> + *
> + */

nit: Please drop these two pointless lines to make the Doxygen more compact.

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


Re: [libav-devel] [PATCH 4/4] pixdesc: add PIX_FMT_ALPHA flag

2012-11-12 Thread Diego Biurrun
On Mon, Nov 12, 2012 at 01:25:46AM +0100, Luca Barbato wrote:
> 
> --- a/libavutil/pixdesc.h
> +++ b/libavutil/pixdesc.h
> @@ -96,6 +96,9 @@ typedef struct AVPixFmtDescriptor{
>  
> +#define PIX_FMT_ALPHA   128 ///< The pixel formats has an alpha channel

format_

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


Re: [libav-devel] [PATCH 25/42] oggparsespeex: validate channel count and set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:38:13AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/oggparsespeex.c |7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c
> index 11b50d5..42480a3 100644
> --- a/libavformat/oggparsespeex.c
> +++ b/libavformat/oggparsespeex.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include "libavutil/bswap.h"
>  #include "libavutil/avstring.h"
> +#include "libavutil/channel_layout.h"
>  #include "libavcodec/get_bits.h"
>  #include "libavcodec/bytestream.h"
>  #include "avformat.h"
> @@ -59,6 +60,12 @@ static int speex_header(AVFormatContext *s, int idx) {
>  
>  st->codec->sample_rate = AV_RL32(p + 36);
>  st->codec->channels = AV_RL32(p + 48);
> +if (st->codec->channels < 1 || st->codec->channels > 2) {
> +av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be 
> mono or stereo.\n");
> +return AVERROR_INVALIDDATA;
> +}
> +st->codec->channel_layout = st->codec->channels == 1 ? 
> AV_CH_LAYOUT_MONO :
> +   
> AV_CH_LAYOUT_STEREO;
>  
>  spxp->packet_size  = AV_RL32(p + 56);
>  frames_per_packet  = AV_RL32(p + 64);
> -- 

Maybe they'll go MPEG Audio/ALAC/WavPack/Cooker way and add multichannel via
channel pairs + single channels in the future. But so far LGTM.

All other patches in this patchset LGTM too, though Diego might want to
realign vertically some stuff afterwards.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 09/42] dsicin: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:57AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/dsicin.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
> index 8cba461..ecc8c0b 100644
> --- a/libavformat/dsicin.c
> +++ b/libavformat/dsicin.c
> @@ -24,6 +24,7 @@
>   * Delphine Software International CIN file demuxer
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "libavutil/intreadwrite.h"
>  #include "avformat.h"
>  #include "internal.h"
> @@ -131,6 +132,7 @@ static int cin_read_header(AVFormatContext *s)
>  st->codec->codec_id = AV_CODEC_ID_DSICINAUDIO;
>  st->codec->codec_tag = 0;  /* no tag */
>  st->codec->channels = 1;
> +st->codec->channel_layout = AV_CH_LAYOUT_MONO;
>  st->codec->sample_rate = 22050;
>  st->codec->bits_per_coded_sample = 8;
>  st->codec->bit_rate = st->codec->sample_rate * 
> st->codec->bits_per_coded_sample * st->codec->channels;
> -- 

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


Re: [libav-devel] [PATCH 08/42] daud: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:56AM -0500, Justin Ruggles wrote:
> Update FATE reference due to WAVE channel mask now being set correctly.
> ---
>  libavformat/daud.c |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/daud.c b/libavformat/daud.c
> index dda83f9..3ceb958 100644
> --- a/libavformat/daud.c
> +++ b/libavformat/daud.c
> @@ -18,6 +18,8 @@
>   * License along with Libav; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
> +
> +#include "libavutil/channel_layout.h"
>  #include "avformat.h"
>  
>  static int daud_header(AVFormatContext *s) {
> @@ -28,6 +30,7 @@ static int daud_header(AVFormatContext *s) {
>  st->codec->codec_id = AV_CODEC_ID_PCM_S24DAUD;
>  st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd');
>  st->codec->channels = 6;
> +st->codec->channel_layout = AV_CH_LAYOUT_5POINT1;
>  st->codec->sample_rate = 96000;
>  st->codec->bit_rate = 3 * 6 * 96000 * 8;
>  st->codec->block_align = 3 * 6;
> -- 

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


Re: [libav-devel] [PATCH 07/42] cdxl: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:55AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/cdxl.c |9 -
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/cdxl.c b/libavformat/cdxl.c
> index d61cbd9..a2cba52 100644
> --- a/libavformat/cdxl.c
> +++ b/libavformat/cdxl.c
> @@ -19,6 +19,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/parseutils.h"
>  #include "libavutil/opt.h"
> @@ -101,7 +102,13 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket 
> *pkt)
>  st->codec->codec_type= AVMEDIA_TYPE_AUDIO;
>  st->codec->codec_tag = 0;
>  st->codec->codec_id  = AV_CODEC_ID_PCM_S8;
> -st->codec->channels  = cdxl->header[1] & 0x10 ? 2 : 1;
> +if (cdxl->header[1] & 0x10) {
> +st->codec->channels   = 2;
> +st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
> +} else {
> +st->codec->channels   = 1;
> +st->codec->channel_layout = AV_CH_LAYOUT_MONO;
> +}
>  st->codec->sample_rate   = cdxl->sample_rate;
>  st->start_time   = 0;
>  cdxl->audio_stream_index = st->index;
> -- 

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


Re: [libav-devel] [PATCH 06/42] bmv: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:54AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/bmv.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/bmv.c b/libavformat/bmv.c
> index fe5db3f..ce157e8 100644
> --- a/libavformat/bmv.c
> +++ b/libavformat/bmv.c
> @@ -19,6 +19,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "avformat.h"
>  #include "internal.h"
>  
> @@ -58,6 +59,7 @@ static int bmv_read_header(AVFormatContext *s)
>  ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
>  ast->codec->codec_id= AV_CODEC_ID_BMV_AUDIO;
>  ast->codec->channels= 2;
> +ast->codec->channel_layout  = AV_CH_LAYOUT_STEREO;
>  ast->codec->sample_rate = 22050;
>  avpriv_set_pts_info(ast, 16, 1, 22050);
>  
> -- 

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


Re: [libav-devel] [PATCH 05/42] bink: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:53AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/bink.c |9 -
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/bink.c b/libavformat/bink.c
> index 7254caf..5d3de14 100644
> --- a/libavformat/bink.c
> +++ b/libavformat/bink.c
> @@ -28,6 +28,7 @@
>   *  http://wiki.multimedia.cx/index.php?title=Bink_Container
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "libavutil/intreadwrite.h"
>  #include "avformat.h"
>  #include "internal.h"
> @@ -141,7 +142,13 @@ static int read_header(AVFormatContext *s)
>  flags = avio_rl16(pb);
>  ast->codec->codec_id = flags & BINK_AUD_USEDCT ?
> AV_CODEC_ID_BINKAUDIO_DCT : 
> AV_CODEC_ID_BINKAUDIO_RDFT;
> -ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1;
> +if (flags & BINK_AUD_STEREO) {
> +ast->codec->channels   = 2;
> +ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
> +} else {
> +ast->codec->channels   = 1;
> +ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
> +}
>  ast->codec->extradata = av_mallocz(4 + 
> FF_INPUT_BUFFER_PADDING_SIZE);
>  if (!ast->codec->extradata)
>  return AVERROR(ENOMEM);
> -- 

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


Re: [libav-devel] [PATCH 04/42] bfi: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:52AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/bfi.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/bfi.c b/libavformat/bfi.c
> index c520bea..e60bbf4 100644
> --- a/libavformat/bfi.c
> +++ b/libavformat/bfi.c
> @@ -26,6 +26,7 @@
>   * @see http://wiki.multimedia.cx/index.php?title=BFI
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "libavutil/intreadwrite.h"
>  #include "avformat.h"
>  #include "internal.h"
> @@ -96,6 +97,7 @@ static int bfi_read_header(AVFormatContext * s)
>  astream->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
>  astream->codec->codec_id= AV_CODEC_ID_PCM_U8;
>  astream->codec->channels= 1;
> +astream->codec->channel_layout  = AV_CH_LAYOUT_MONO;
>  astream->codec->bits_per_coded_sample = 8;
>  astream->codec->bit_rate=
>  astream->codec->sample_rate * astream->codec->bits_per_coded_sample;
> -- 

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


Re: [libav-devel] [PATCH 03/42] bethsoftvid: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:51AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/bethsoftvid.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
> index ece230c..3a102c0 100644
> --- a/libavformat/bethsoftvid.c
> +++ b/libavformat/bethsoftvid.c
> @@ -27,6 +27,7 @@
>   * @see http://www.svatopluk.com/andux/docs/dfvid.html
>   */
>  
> +#include "libavutil/channel_layout.h"
>  #include "libavutil/intreadwrite.h"
>  #include "avformat.h"
>  #include "internal.h"
> @@ -239,6 +240,7 @@ static int vid_read_packet(AVFormatContext *s,
>  st->codec->codec_type= AVMEDIA_TYPE_AUDIO;
>  st->codec->codec_id  = AV_CODEC_ID_PCM_U8;
>  st->codec->channels  = 1;
> +st->codec->channel_layout= AV_CH_LAYOUT_MONO;
>  st->codec->bits_per_coded_sample = 8;
>  st->codec->sample_rate   = vid->sample_rate;
>  st->codec->bit_rate  = 8 * 
> st->codec->sample_rate;
> -- 

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


Re: [libav-devel] [PATCH 02/42] apc: set channel layout

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:37:50AM -0500, Justin Ruggles wrote:
> ---
>  libavformat/apc.c |   12 +---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/apc.c b/libavformat/apc.c
> index 7ae2423..0b6c583 100644
> --- a/libavformat/apc.c
> +++ b/libavformat/apc.c
> @@ -20,6 +20,8 @@
>   */
>  
>  #include 
> +
> +#include "libavutil/channel_layout.h"
>  #include "avformat.h"
>  
>  static int apc_probe(AVProbeData *p)
> @@ -58,9 +60,13 @@ static int apc_read_header(AVFormatContext *s)
>  /* initial predictor values for adpcm decoder */
>  avio_read(pb, st->codec->extradata, 2 * 4);
>  
> -st->codec->channels = 1;
> -if (avio_rl32(pb))
> -st->codec->channels = 2;
> +if (avio_rl32(pb)) {
> +st->codec->channels   = 2;
> +st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
> +} else {
> +st->codec->channels   = 1;
> +st->codec->channel_layout = AV_CH_LAYOUT_MONO;
> +}
>  
>  st->codec->bits_per_coded_sample = 4;
>  st->codec->bit_rate = st->codec->bits_per_coded_sample * 
> st->codec->channels
> -- 

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


Re: [libav-devel] [PATCH 2/4] avcodec: remove ff_is_hwaccel_pix_fmt

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:25:44AM +0100, Luca Barbato wrote:
> It is used only in one place and is unlikely it would be needed
> elsewhere.
> ---
>  libavcodec/imgconvert.c | 6 --
>  libavcodec/internal.h   | 5 -
>  libavcodec/utils.c  | 8 +++-
>  3 files changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
> index fd30dc4..dacf3c4 100644
> --- a/libavcodec/imgconvert.c
> +++ b/libavcodec/imgconvert.c
> @@ -415,12 +415,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat 
> pix_fmt, int *h_shift, int
>  *v_shift = desc->log2_chroma_h;
>  }
>  
> -int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
> -{
> -const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> -return desc->flags & PIX_FMT_HWACCEL;
> -}
> -
>  int avpicture_fill(AVPicture *picture, uint8_t *ptr,
> enum AVPixelFormat pix_fmt, int width, int height)
>  {
> diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> index 231d4b6..0f624e2 100644
> --- a/libavcodec/internal.h
> +++ b/libavcodec/internal.h
> @@ -86,11 +86,6 @@ struct AVCodecDefault {
>  };
>  
>  /**
> - * Determine whether pix_fmt is a hardware accelerated format.
> - */
> -int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt);
> -
> -/**
>   * Return the hardware accelerated codec for codec codec_id and
>   * pixel format pix_fmt.
>   *
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 4a41a4b..a3005f3 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -629,9 +629,15 @@ int avcodec_default_execute2(AVCodecContext *c, int 
> (*func)(AVCodecContext *c2,
>  return 0;
>  }
>  
> +static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
> +{
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> +return desc->flags & PIX_FMT_HWACCEL;
> +}
> +
>  enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, 
> const enum AVPixelFormat *fmt)
>  {
> -while (*fmt != AV_PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt))
> +while (*fmt != AV_PIX_FMT_NONE && is_hwaccel_pix_fmt(*fmt))
>  ++fmt;
>  return fmt[0];
>  }
> -- 

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


Re: [libav-devel] [PATCH 4/4] pixdesc: add PIX_FMT_ALPHA flag

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:25:46AM +0100, Luca Barbato wrote:
> ---
>  libavutil/pixdesc.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
> index c30ae1f..b4c01e2 100644
> --- a/libavutil/pixdesc.h
> +++ b/libavutil/pixdesc.h
> @@ -96,6 +96,9 @@ typedef struct AVPixFmtDescriptor{
>   */
>  #define PIX_FMT_PSEUDOPAL 64
>  
> +#define PIX_FMT_ALPHA   128 ///< The pixel formats has an alpha channel
> +
> +
>  #if FF_API_PIX_FMT_DESC
>  /**
>   * The array of all the pixel format descriptors.
> -- 

Why not add it to the needed pixdesc entries too?
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/4] pixdesc: add av_pix_fmt_get_chroma_sub_sample

2012-11-12 Thread Kostya Shishkov
On Mon, Nov 12, 2012 at 01:25:43AM +0100, Luca Barbato wrote:
> Deprecate avcodec_get_chroma_sub_sample.
> ---
>  cmdutils.c |  4 +++-
>  libavcodec/avcodec.h   |  7 ++-
>  libavcodec/ffv1enc.c   |  4 ++--
>  libavcodec/libtheoraenc.c  |  3 ++-
>  libavcodec/mpegvideo.c |  9 +
>  libavcodec/mpegvideo_enc.c | 10 ++
>  libavcodec/tiffenc.c   |  4 ++--
>  libavcodec/utils.c |  3 ++-
>  libavcodec/vp3.c   |  3 ++-
>  libavutil/pixdesc.c| 12 
>  libavutil/pixdesc.h| 15 +++
>  11 files changed, 57 insertions(+), 17 deletions(-)

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