Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 09:59:21PM +0100, Reimar Döffinger wrote:
 On Sun, Mar 08, 2015 at 08:44:50PM +0100, Michael Niedermayer wrote:
  On Sun, Mar 08, 2015 at 07:43:29PM +0100, Reimar Döffinger wrote:
   On 08.03.2015, at 19:34, Michael Niedermayer michae...@gmx.at wrote:
On Sun, Mar 08, 2015 at 05:16:43PM +0100, Reimar Döffinger wrote:
Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
in my tests on a G4 7450.

Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de

breaks build:
CC  libavcodec/aliaspixdec.o
libavcodec/aliaspixdec.c: In function ‘decode_frame’:
libavcodec/aliaspixdec.c:35:75: error: expected identifier or ‘(’ 
before ‘unsigned’
   
   What compiler/os/... is this? I only tried on Linux, not OSX for example. 
   Though maybe I just messed up the merge, sorry my PPC machine doesn't 
   have email.
  
  gcc 4.6 (Debian 4.6.3-14)
  
  the problem is the pixel identifer, renaming it make it build the
  affected file
 
 Hm, I don't have that issue with 4.9.
 I guess something's broken with the altivec header?
 Looking at the 4.9 version a #undef pixel right after
 the altivec.h include might fix it?
 Assuming we don't actually use it anywhere as an altivec
 keyword.

your patch with #undef pixel added after the include:

CC  libavcodec/dss_sp.o
libavcodec/dss_sp.c: In function ‘dss_sp_gen_exc’:
libavcodec/dss_sp.c:473:1: error: parameter name omitted
libavcodec/dss_sp.c:482:13: error: expected expression before ‘__attribute__’
libavcodec/dss_sp.c:485:13: error: expected expression before ‘__attribute__’
libavcodec/dss_sp.c:488:26: error: expected expression before ‘__attribute__’
libavcodec/dss_sp.c:489:43: error: expected identifier or ‘(’ before ‘[’ token
libavcodec/dss_sp.c:488:13: warning: unused variable ‘tmp’ [-Wunused-variable]
libavcodec/dss_sp.c: In function ‘dss_sp_update_buf’:
libavcodec/dss_sp.c:505:1: error: parameter name omitted
libavcodec/dss_sp.c:510:9: error: expected expression before ‘__attribute__’
libavcodec/dss_sp.c:513:9: error: expected expression before ‘__attribute__’
libavcodec/dss_sp.c: In function ‘dss_sp_decode_one_frame’:
libavcodec/dss_sp.c:720:24: warning: passing argument 1 of ‘dss_sp_gen_exc’ 
from incompatible pointer type [enabled by default]
libavcodec/dss_sp.c:473:13: note: expected ‘__vector(4) int *’ but argument is 
of type ‘int32_t *’
libavcodec/dss_sp.c:724:9: warning: passing argument 2 of ‘dss_sp_update_buf’ 
from incompatible pointer type [enabled by default]
libavcodec/dss_sp.c:505:13: note: expected ‘__vector(4) int *’ but argument is 
of type ‘int32_t *’
make: *** [libavcodec/dss_sp.o] Error 1
CC  libavcodec/eatgv.o
libavcodec/eatgv.c: In function ‘tgv_decode_inter’:
libavcodec/eatgv.c:226:61: error: expected identifier or ‘(’ before ‘=’ token
libavcodec/eatgv.c:230:17: error: expected expression before ‘__attribute__’
libavcodec/eatgv.c:231:49: error: expected expression before ‘__attribute__’
libavcodec/eatgv.c:232:49: error: expected expression before ‘__attribute__’
libavcodec/eatgv.c:243:30: error: expected expression before ‘__attribute__’
make: *** [libavcodec/eatgv.o] Error 1
CC  libavcodec/g723_1.o
libavcodec/g723_1.c: In function ‘scale_vector’:
libavcodec/g723_1.c:249:1: error: parameter name omitted
libavcodec/g723_1.c:255:57: error: expected expression before ‘=’ token
libavcodec/g723_1.c:255:57: warning: type defaults to ‘int’ in type name 
[enabled by default]
libavcodec/g723_1.c:255:57: error: variable length array is used [-Werror=vla]
libavcodec/g723_1.c:261:18: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c: In function ‘gen_dirac_train’:
libavcodec/g723_1.c:445:47: error: expected identifier or ‘(’ before ‘[’ token
libavcodec/g723_1.c:448:12: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c:448:12: error: too few arguments to function ‘memcpy’
libavcodec/g723_1.c:451:27: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c: In function ‘gen_fcb_excitation’:
libavcodec/g723_1.c:464:1: error: parameter name omitted
libavcodec/g723_1.c:469:12: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c:469:12: error: too few arguments to function ‘memset’
libavcodec/g723_1.c:484:51: error: expected identifier or ‘(’ before ‘[’ token
libavcodec/g723_1.c:487:51: error: expected identifier or ‘(’ before ‘[’ token
libavcodec/g723_1.c:494:29: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c:494:29: error: too few arguments to function 
‘gen_dirac_train’
libavcodec/g723_1.c:443:13: note: declared here
libavcodec/g723_1.c:504:47: error: expected identifier or ‘(’ before ‘[’ token
libavcodec/g723_1.c:504:13: warning: ISO C90 forbids mixed declarations and 
code [-Wdeclaration-after-statement]
libavcodec/g723_1.c:516:17: error: expected expression before ‘__attribute__’
libavcodec/g723_1.c:500:21: warning: variable ‘beta’ set but not used 
[-Wunused-but-set-variable]

Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Reimar Döffinger
On Sun, Mar 08, 2015 at 08:44:50PM +0100, Michael Niedermayer wrote:
 On Sun, Mar 08, 2015 at 07:43:29PM +0100, Reimar Döffinger wrote:
  On 08.03.2015, at 19:34, Michael Niedermayer michae...@gmx.at wrote:
   On Sun, Mar 08, 2015 at 05:16:43PM +0100, Reimar Döffinger wrote:
   Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
   in my tests on a G4 7450.
   
   Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
   
   breaks build:
   CC  libavcodec/aliaspixdec.o
   libavcodec/aliaspixdec.c: In function ‘decode_frame’:
   libavcodec/aliaspixdec.c:35:75: error: expected identifier or ‘(’ before 
   ‘unsigned’
  
  What compiler/os/... is this? I only tried on Linux, not OSX for example. 
  Though maybe I just messed up the merge, sorry my PPC machine doesn't have 
  email.
 
 gcc 4.6 (Debian 4.6.3-14)
 
 the problem is the pixel identifer, renaming it make it build the
 affected file

Hm, I don't have that issue with 4.9.
I guess something's broken with the altivec header?
Looking at the 4.9 version a #undef pixel right after
the altivec.h include might fix it?
Assuming we don't actually use it anywhere as an altivec
keyword.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] pthread: Fix ff_thread_get_formatissues when called outside frame decode.

2015-03-08 Thread Rainer Hochecker
Reimar Döffinger Reimar.Doeffinger at gmx.de writes:

I tried this patch with Kodi but did not get very far.

int ff_thread_can_start_frame(AVCodecContext *avctx)
{
PerThreadContext *p = avctx-internal-thread_ctx;
if (avctx-active_thread_typeFF_THREAD_FRAME)
return 0;
av_assert0(!p-main_thread);

It hit this assert and call stack showed avformat_find_stream_info

How can I help progressing this. I want to run hevc frame threaded but
without thread_safe_callback because of DXVA.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 05:16:43PM +0100, Reimar Döffinger wrote:
 Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
 in my tests on a G4 7450.
 
 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de

breaks build:
CC  libavcodec/aliaspixdec.o
libavcodec/aliaspixdec.c: In function ‘decode_frame’:
libavcodec/aliaspixdec.c:35:75: error: expected identifier or ‘(’ before 
‘unsigned’
libavcodec/aliaspixdec.c:98:62: error: expected identifier or ‘(’ before ‘=’ 
token
libavcodec/aliaspixdec.c:100:99: error: expected expression before ‘;’ token
libavcodec/aliaspixdec.c:100:178: error: expected expression before ‘’ token
libavcodec/aliaspixdec.c:100:260: error: expected expression before ‘’ token
libavcodec/aliaspixdec.c:104:62: error: expected identifier or ‘(’ before ‘=’ 
token
libavcodec/aliaspixdec.c:106:30: error: expected expression before 
‘__attribute__’

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] pthread: Fix ff_thread_get_formatissues when called outside frame decode.

2015-03-08 Thread Reimar Döffinger
On 08.03.2015, at 19:15, Rainer Hochecker fernetme...@online.de wrote:
 Reimar Döffinger Reimar.Doeffinger at gmx.de writes:
 
 I tried this patch with Kodi but did not get very far.
 
 int ff_thread_can_start_frame(AVCodecContext *avctx)
 {
PerThreadContext *p = avctx-internal-thread_ctx;
if (avctx-active_thread_typeFF_THREAD_FRAME)
return 0;
av_assert0(!p-main_thread);
 
 It hit this assert and call stack showed avformat_find_stream_info

This was the buggy first version, please see patch from march 2nd.
I have another fix locally that also fixes potential hangs with corrupted 
streams in addition, but the newer version should work.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/wmalossless: use av_clip_intp2

2015-03-08 Thread Michael Niedermayer
On Sat, Mar 07, 2015 at 11:44:10PM +0800, zhaoxiu.zeng wrote:
 From 47c997fa0623ab94a7a93b2d2e4cc4fa64c85d5f Mon Sep 17 00:00:00 2001
 From: Zeng Zhaoxiu zhaoxiu.z...@gmail.com
 Date: Sat, 7 Mar 2015 23:26:42 +0800
 Subject: [PATCH 1/1] avcodec/wmalossless: use av_clip_intp2

this breaks build on ARM

ffmpeg/libavutil/arm/intmath.h:69:5: warning: asm operand 2 probably doesn’t 
match constraints
ffmpeg/libavutil/arm/intmath.h:69:5: warning: asm operand 2 probably doesn’t 
match constraints
ffmpeg/libavutil/arm/intmath.h:69:5: error: impossible constraint in ‘asm’
ffmpeg/libavutil/arm/intmath.h:69:5: error: impossible constraint in ‘asm’

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] GSoC Introduction

2015-03-08 Thread Stephan Holljes
Hi,

my name is Stephan Holljes, my IRC nick is klaxa.
I want to work on implementing servers for network protocols within the
GSoC project.

I've been using ffmpeg for many years already and I always wanted to
contribute in a way other than providing end-user support, but I never
really found the right way to approach this. I hope GSoC will provide a
nice framework for that.

I like coding in C and I like coding network related software. I hope I
still do after the summer!

Regards,
Stephan Holljes
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 07:43:29PM +0100, Reimar Döffinger wrote:
 On 08.03.2015, at 19:34, Michael Niedermayer michae...@gmx.at wrote:
  On Sun, Mar 08, 2015 at 05:16:43PM +0100, Reimar Döffinger wrote:
  Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
  in my tests on a G4 7450.
  
  Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
  
  breaks build:
  CC  libavcodec/aliaspixdec.o
  libavcodec/aliaspixdec.c: In function ‘decode_frame’:
  libavcodec/aliaspixdec.c:35:75: error: expected identifier or ‘(’ before 
  ‘unsigned’
 
 What compiler/os/... is this? I only tried on Linux, not OSX for example. 
 Though maybe I just messed up the merge, sorry my PPC machine doesn't have 
 email.

gcc 4.6 (Debian 4.6.3-14)

the problem is the pixel identifer, renaming it make it build the
affected file

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add test for vp90-2-trac4359.webm

2015-03-08 Thread James Almer
On 07/03/15 6:34 AM, Michael Niedermayer wrote:
 On Sat, Mar 07, 2015 at 02:24:24AM -0300, James Almer wrote:
 Regression test for the bug from trac ticket #4359 fixed in commit efff3854

 Signed-off-by: James Almer jamr...@gmail.com
 ---
 
 The file was uploaded to the ftp (Incoming folder). It should of course be 
 placed in the vp9-test-vectors folder.
 
 uploaded, feel free to push in 24h

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] doc: avoid the incorrect phrase 'allow to'

2015-03-08 Thread Michael Niedermayer
On Sat, Mar 07, 2015 at 07:39:24PM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 I missed some occurrences of 'allow to' in my previous patch.
 
 Best regards,
 Andreas

  faq.texi  |2 +-
  ffserver.texi |2 +-
  filters.texi  |2 +-
  formats.texi  |4 ++--
  indevs.texi   |2 +-
  utils.texi|4 ++--
  6 files changed, 8 insertions(+), 8 deletions(-)
 7b3475dd99c18cf429be9ebcf06bf796f8cd4111  
 0001-doc-avoid-the-incorrect-phrase-allow-to.patch
 From f3c94a70bfe9264e25575999a3cb134f029bea2d Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sat, 7 Mar 2015 19:36:07 +0100
 Subject: [PATCH] doc: avoid the incorrect phrase 'allow to'

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Reimar Döffinger
On 08.03.2015, at 19:34, Michael Niedermayer michae...@gmx.at wrote:
 On Sun, Mar 08, 2015 at 05:16:43PM +0100, Reimar Döffinger wrote:
 Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
 in my tests on a G4 7450.
 
 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
 
 breaks build:
 CC  libavcodec/aliaspixdec.o
 libavcodec/aliaspixdec.c: In function ‘decode_frame’:
 libavcodec/aliaspixdec.c:35:75: error: expected identifier or ‘(’ before 
 ‘unsigned’

What compiler/os/... is this? I only tried on Linux, not OSX for example. 
Though maybe I just messed up the merge, sorry my PPC machine doesn't have 
email.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Paul B Mahol
On 3/8/15, Nicolas George geo...@nsup.org wrote:
 L'octidi 18 ventose, an CCXXIII, Paul B Mahol a ecrit :
 Yes, it gives me floating exception. Looks like uninit() is called
 unconditionally.

 Of course uninit() is called unconditionally. But it should not crash, and
 I
 re-checked here and it does not crash indeed.

 This change seems very wrong to me, you have the very same divide-by-zero
 in
 the per-channel case, just above your test, there is no reason for one to
 crash and not the other.

You mean for case when there are channels present but without any
samples? For example nb_channels = 2 and nb_samples = 0?

 Regards,

 --
   Nicolas George

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


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Paul B Mahol a écrit :
 Well, nb_channels is for certain 0 here.

Well, I am not here and I would like to see, because I am responsible for
the code path that leads there.

So please give enough information to reproduce the bug. You already stated
it was with clang, please give at least the exact command line you used and
if necessary the input sample.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Martin Vignali a écrit :
 +if (!nb_samples || !s-nb_channels)

Half your test is completely useless, as s-nb_channels can not be zero.

Did you manage tu reproduce the issue it is supposed to fix?

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Paul B Mahol a écrit :
 Yes, it gives me floating exception. Looks like uninit() is called
 unconditionally.

Of course uninit() is called unconditionally. But it should not crash, and I
re-checked here and it does not crash indeed.

This change seems very wrong to me, you have the very same divide-by-zero in
the per-channel case, just above your test, there is no reason for one to
crash and not the other.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Paul B Mahol
On 3/8/15, Nicolas George geo...@nsup.org wrote:
 L'octidi 18 ventose, an CCXXIII, Paul B Mahol a ecrit :
 You mean for case when there are channels present but without any
 samples? For example nb_channels = 2 and nb_samples = 0?

 Yes. Are you suggesting that when you reproduce the crash, it happens with
 nb_channels == 0? If so, I would very much like to see that, because it
 should not be possible at all.

With nb_channels = 0 and nb_samples = 0 and compiled with clang i get
floating exception.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Paul B Mahol a écrit :
 With nb_channels = 0 and nb_samples = 0 and compiled with clang i get
 floating exception.

nb_channels is not possible. If you reach it, please investigate, or at
least give some details to allow people to investigate.

Hiding bugs is never a good idea.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/srtenc: avoid segmentation fault when transcoding from SSA to SRT

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Gilles Chanteperdrix a écrit :
 If I read ffmpeg current documentation here:
 
 http://www.ffmpeg.org/doxygen/2.5/group__lavc__core.html#ga828218dcb8874ab2c5af8d486c365421
 
 It seems that when a subtitle rect type is SUBTITLE_ASS (which is
 the case in the code which my patch modified), there is no guarantee
 that the text field contains something.

You read the documentation correctly, but the text field you are testing
does not belong to AVSubtitleRect but to ASSDialog. And you can see that a
few lines above, the code checks that the subtitles are actually
SUBTITLE_ASS.

 Is not there some way in the ssa format to declare some graphic
 elements which are not text?

Theoretically yes, but the ASS demuxer just ignores them.

 In my modest experience, bugs do not just disappear if you do not
 fix them.

In my modest experience, it can happen when the code that contains them is
reworked in depth, or when it was a consequence of another bug that was
fixed. This code has been reworked in depth.

 Maybe it is not a perfect patch, but if subtitles can contain
 graphic elements mixed with text, it seems better to translate the
 text only when the target codec only supports text, than to fail
 with a segmentation fault.

I do not deny that. But until proven otherwise, there is no segmentation
fault, the code as is works very well.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Martin Vignali
In attach a sample file

I use this line to create the crash :
ffmpag -i path_to_file_in_attach -filter astats -f null -

2015-03-08 11:05 GMT+01:00 Nicolas George geo...@nsup.org:

 L'octidi 18 ventôse, an CCXXIII, Paul B Mahol a écrit :
  Well, nb_channels is for certain 0 here.

 Well, I am not here and I would like to see, because I am responsible for
 the code path that leads there.

 So please give enough information to reproduce the bug. You already stated
 it was with clang, please give at least the exact command line you used and
 if necessary the input sample.

 Regards,

 --
   Nicolas George

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




movSsSon.mov
Description: QuickTime movie
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Paul B Mahol
On 3/8/15, Martin Vignali martin.vign...@gmail.com wrote:
 In attach a sample file

 I use this line to create the crash :
 ffmpag -i path_to_file_in_attach -filter astats -f null -

I used this same command and sample provided by Martin.


 2015-03-08 11:05 GMT+01:00 Nicolas George geo...@nsup.org:

 L'octidi 18 ventose, an CCXXIII, Paul B Mahol a ecrit :
  Well, nb_channels is for certain 0 here.

 Well, I am not here and I would like to see, because I am responsible
 for
 the code path that leads there.

 So please give enough information to reproduce the bug. You already
 stated
 it was with clang, please give at least the exact command line you used
 and
 if necessary the input sample.

 Regards,

 --
   Nicolas George

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



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


Re: [FFmpeg-devel] Patch proposal : Fix crash with astats filter when no audio input

2015-03-08 Thread Paul B Mahol
On 3/7/15, Martin Vignali martin.vign...@gmail.com wrote:
 Hello,

 Exemple to create the crash :
 ffmpeg -i fileWithoutSound -filter astats -f null -

 A patch in attach avoid the crash by avoiding Zero division in print_stats.

 I test the patch on several files, and the crash doesn't appear anymore.

 Best regards

 Martin


Different patch applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Paul B Mahol
On 3/8/15, Nicolas George geo...@nsup.org wrote:
 L'octidi 18 ventose, an CCXXIII, Martin Vignali a ecrit :
 +if (!nb_samples || !s-nb_channels)

 Half your test is completely useless, as s-nb_channels can not be zero.

 Did you manage tu reproduce the issue it is supposed to fix?

Yes, it gives me floating exception. Looks like uninit() is called
unconditionally.

 Regards,

 --
   Nicolas George

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


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Paul B Mahol a écrit :
 You mean for case when there are channels present but without any
 samples? For example nb_channels = 2 and nb_samples = 0?

Yes. Are you suggesting that when you reproduce the crash, it happens with
nb_channels == 0? If so, I would very much like to see that, because it
should not be possible at all.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/srtenc: avoid segmentation fault when transcoding from SSA to SRT

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Clement Boesch a écrit :
 Try adding tags with no text maybe. You may also try ASS drawing mode, but
 FFmpeg probably doesn't do cray stuff about it.

I tried various combinations, including empty styles, drawing mode, Picture,
Comment, empty lines, missing comma, nothing produces a crash.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avfilter/af_astats: Avoid Zero division in print part.

2015-03-08 Thread Paul B Mahol
On 3/8/15, Nicolas George geo...@nsup.org wrote:
 L'octidi 18 ventose, an CCXXIII, Paul B Mahol a ecrit :
 With nb_channels = 0 and nb_samples = 0 and compiled with clang i get
 floating exception.

 nb_channels is not possible. If you reach it, please investigate, or at
 least give some details to allow people to investigate.

Well, nb_channels is for certain 0 here.

 Hiding bugs is never a good idea.

 Regards,

 --
   Nicolas George

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


Re: [FFmpeg-devel] Patch proposal : Fix crash with astats filter when no audio input

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Martin Vignali a écrit :
 In attach a sample file, who make a crash. (on mac os x with latest git
 version, and on windows with older version).
 
 i just make the test now, and s-nb_channels can be 0. (this is the case
 with the file in attach).

Ok, got it.

The problem happens when the filter is inited but something fails during
configuration. For example when using it with a video stream.

In that case, I believe Paul's fix is wrong, because no attempt at printing
stats should be done at all in that case. s-channels can indeed serve to
test if the configuration succeeded, but it must happen earlier, probably
something like that:

if (s-nb_channels)
print_stats(ctx);

Furthermore, the global stats should be printed for an empty stream,
otherwise it will break scripts.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 5/8] ffmdec: break infinite resync loop

2015-03-08 Thread Andreas Cadhalpun

Hi,

some broken files can lead to an endless resync loop, which is avoided 
by attached patch.


Best regards,
Andreas
From 5682a0cafbaf9339352f3147ef7c494dea47 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:29:42 +0100
Subject: [PATCH 5/8] ffmdec: break infinite resync loop

If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 35e4c03..9cbd20c 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -82,6 +82,7 @@ static int ffm_read_data(AVFormatContext *s,
 FFMContext *ffm = s-priv_data;
 AVIOContext *pb = s-pb;
 int len, fill_size, size1, frame_offset, id;
+int64_t last_pos = -1;
 
 size1 = size;
 while (size  0) {
@@ -101,9 +102,16 @@ static int ffm_read_data(AVFormatContext *s,
 avio_seek(pb, tell, SEEK_SET);
 }
 id = avio_rb16(pb); /* PACKET_ID */
-if (id != PACKET_ID)
+if (id != PACKET_ID) {
 if (ffm_resync(s, id)  0)
 return -1;
+if (avio_tell(pb) == last_pos) {
+av_log(s, AV_LOG_ERROR,
+   breaking resync loop at pos %PRIx64\n, last_pos);
+return AVERROR_INVALIDDATA;
+}
+last_pos = avio_tell(pb);
+}
 fill_size = avio_rb16(pb);
 ffm-dts = avio_rb64(pb);
 frame_offset = avio_rb16(pb);
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 4/8] ffmdec: don't set extradata_size without allocating extradata

2015-03-08 Thread Andreas Cadhalpun

Hi,

attached patch fixes crashes with ffm files containing an extradata_size 
setting, but without extradata.


Such files are created by the ffm muxer, e.g. with for the asv1 codec.

Best regards,
Andreas
From b3da247975db1bc0dd86805f2830aa0b718fd355 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:24:40 +0100
Subject: [PATCH 4/8] ffmdec: don't set extradata_size without allocating
 extradata

When extradata_size is not 0, but extradata is NULL, code trying to use
extradata crashes.

If there is any extradata, extradata_size is set in ff_get_extradata.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 2459691..35e4c03 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -260,7 +260,7 @@ static int ffm2_read_header(AVFormatContext *s)
 AVStream *st;
 AVIOContext *pb = s-pb;
 AVCodecContext *codec = NULL;
-int ret;
+int ret, old_extradata_size;
 int f_main = 0, f_cprv = -1, f_stvi = -1, f_stau = -1;
 AVCodec *enc;
 char *buffer;
@@ -411,6 +411,7 @@ static int ffm2_read_header(AVFormatContext *s)
 ret = AVERROR(EINVAL);
 goto fail;
 }
+old_extradata_size = codec-extradata_size;
 buffer = av_malloc(size);
 if (!buffer) {
 ret = AVERROR(ENOMEM);
@@ -418,6 +419,11 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 avio_get_str(pb, INT_MAX, buffer, size);
 av_set_options_string(codec, buffer, =, ,);
+if (codec-extradata_size != old_extradata_size) {
+av_log(s, AV_LOG_WARNING, ignoring extradata_size=%d in S2VI chunk\n,
+   codec-extradata_size);
+codec-extradata_size = old_extradata_size;
+}
 if ((ret = ffm_append_recommended_configuration(st, buffer))  0)
 goto fail;
 break;
@@ -426,6 +432,7 @@ static int ffm2_read_header(AVFormatContext *s)
 ret = AVERROR(EINVAL);
 goto fail;
 }
+old_extradata_size = codec-extradata_size;
 buffer = av_malloc(size);
 if (!buffer) {
 ret = AVERROR(ENOMEM);
@@ -433,6 +440,11 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 avio_get_str(pb, INT_MAX, buffer, size);
 av_set_options_string(codec, buffer, =, ,);
+if (codec-extradata_size != old_extradata_size) {
+av_log(s, AV_LOG_WARNING, ignoring extradata_size=%d in S2AU chunk\n,
+   codec-extradata_size);
+codec-extradata_size = old_extradata_size;
+}
 ffm_append_recommended_configuration(st, buffer);
 break;
 }
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH 5/8] ffmdec: break infinite resync loop

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:04:13AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 some broken files can lead to an endless resync loop, which is
 avoided by attached patch.
 
 Best regards,
 Andreas

  ffmdec.c |   10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)
 048852d2d9b0c25157015a4befd76323fc4b2cc6  
 0005-ffmdec-break-infinite-resync-loop.patch
 From 5682a0cafbaf9339352f3147ef7c494dea47 Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sun, 8 Mar 2015 23:29:42 +0100
 Subject: [PATCH 5/8] ffmdec: break infinite resync loop
 
 If resyncing leads to the same position as previously, it will again
 lead to a resync attempt, resulting in an infinite loop.

iam not sure this is sufficient and loops over more than 1 resync
point arent possible
maybe its better to never allow resync to start before
or at the previous resync point

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 6/8] ffmdec: fix infinite loop at EOF

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:04:37AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 if ffm files are shorter than expected, these loops never finish.
 Attached patch fixes that.
 
 Best regards,
 Andreas

  ffmdec.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 15281e8220cd5aef8606a499bb51569cbc6dfe49  
 0006-ffmdec-fix-infinite-loop-at-EOF.patch
 From 697ac779497e26e27e6337205e37a371020add1e Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sun, 8 Mar 2015 23:31:48 +0100
 Subject: [PATCH 6/8] ffmdec: fix infinite loop at EOF
 
 If EOF is reached, while skipping bytes, avio_tell(pb) won't change
 anymore, resulting in an infinite loop.

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/options_table: remove extradata_size from the AVOptions table

2015-03-08 Thread Michael Niedermayer
allowing access to the size but not the extradata itself is not useful
and could lead to potential problems if writing happens through this field

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavcodec/options_table.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 442b212..a906864 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -103,7 +103,6 @@ static const AVOption avcodec_options[] = {
 {hex, hex motion estimation, 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, 
INT_MIN, INT_MAX, V|E, me_method },
 {umh, umh motion estimation, 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, 
INT_MIN, INT_MAX, V|E, me_method },
 {iter, iter motion estimation, 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, 
INT_MIN, INT_MAX, V|E, me_method },
-{extradata_size, NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = 
DEFAULT }, INT_MIN, INT_MAX},
 {time_base, NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 
INT_MIN, INT_MAX},
 {g, set the group of picture (GOP) size, OFFSET(gop_size), 
AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 {ar, set audio sampling rate (in Hz), OFFSET(sample_rate), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH 4/8] ffmdec: don't set extradata_size without allocating extradata

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:03:54AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 attached patch fixes crashes with ffm files containing an
 extradata_size setting, but without extradata.
 
 Such files are created by the ffm muxer, e.g. with for the asv1 codec.
 
 Best regards,
 Andreas

  ffmdec.c |   14 +-
  1 file changed, 13 insertions(+), 1 deletion(-)
 beff822dbd6683a15edfc42702af8955475b0172  
 0004-ffmdec-don-t-set-extradata_size-without-allocating-e.patch
 From b3da247975db1bc0dd86805f2830aa0b718fd355 Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sun, 8 Mar 2015 23:24:40 +0100
 Subject: [PATCH 4/8] ffmdec: don't set extradata_size without allocating
  extradata
 
 When extradata_size is not 0, but extradata is NULL, code trying to use
 extradata crashes.
 
 If there is any extradata, extradata_size is set in ff_get_extradata.

ive posted a patch that removes the extradata_size field from the
AVOption table, i think thats better if it works

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/http: support auto reconnect

2015-03-08 Thread Zhang Rui
 +{ reconnect, auto reconnect after disconnect before EOF, 
 OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },

 The default of this setting is probably worth a discussion.

The default value is not my concern,
So I make the default behavior remain unchanged.
May I have your suggestion?

 +read_ret = http_buf_read(h, buf, size);
 +if (s-reconnect  s-filesize  0  s-off  s-filesize  read_ret 
  0) {

 Maybe it should check is_streamed (seekability) too?

I'll fix it.

 +av_log(h, AV_LOG_WARNING, Will reconnect at %PRId64.\n, s-off);
 +seek_ret = http_seek_internal(h, s-off, SEEK_SET, 1);
 +if (seek_ret != s-off) {
 +av_log(h, AV_LOG_WARNING, Failed to reconnect at 
 %PRId64.\n, s-off);
 +return read_ret;

 Not sure if it should return read_ret or seek_ret...

read() returns the bytes received, while seek() returns the offset it seeked to,
which could be different from the request offset. (at least, no
document guarantee)
And I doubt if seek() could returns AVERROR_EOF.

Whatever, it is read() which causes http_read() failure, but not seek().

 In generals looks sane to me.

Thanks for your review.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 8/8] ffmdec: don't seek back at EOF

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:05:31AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 I'm not sure what the purpose of this avio_seek was, but it can
 result in an endless loop. Maybe it always does.

ffm files can be written to and read at the same time, they can act
as ring buffers so that data is written till the end and then
continues at the begin
i suspect this patch breaks that

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 7/8] ffmdec: don't return AVERROR(EAGAIN) from ffm_is_avail_data

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:05:01AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 if AVERROR(EAGAIN) is returned from ffm_is_avail_data it always
 causes an infinite EAGAIN loop.

it should only loop until more data is written into the ffm file
(this of course is not guranteed to ever happen)

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/8] ffmdec: make sure the time base is valid

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:03:33AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 attached patch fixes assertions in av_rescale_rnd.
 
 Best regards,
 Andreas

  ffmdec.c |   11 +++
  1 file changed, 11 insertions(+)
 26bb6e42cc4cb5afc9ac83c27152edece8d62943  
 0003-ffmdec-make-sure-the-time-base-is-valid.patch
 From 8f647fe16693509056483c4d1bc4a57895e9de10 Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sun, 8 Mar 2015 23:12:59 +0100
 Subject: [PATCH 3/8] ffmdec: make sure the time base is valid
 
 A negative time base can trigger assertions.
 
 Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 ---
  libavformat/ffmdec.c | 11 +++
  1 file changed, 11 insertions(+)
 
 diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
 index af37e74..2459691 100644
 --- a/libavformat/ffmdec.c
 +++ b/libavformat/ffmdec.c
 @@ -331,6 +331,12 @@ static int ffm2_read_header(AVFormatContext *s)
  }
  codec-time_base.num = avio_rb32(pb);
  codec-time_base.den = avio_rb32(pb);
 +if (codec-time_base.num  0 || codec-time_base.den = 0) {
 +av_log(s, AV_LOG_ERROR, Invalid time base %d/%d\n,
 +   codec-time_base.num, codec-time_base.den);
 +ret = AVERROR_INVALIDDATA;
 +goto fail;
 +}
  codec-width = avio_rb16(pb);
  codec-height = avio_rb16(pb);
  codec-gop_size = avio_rb16(pb);
 @@ -503,6 +509,11 @@ static int ffm_read_header(AVFormatContext *s)
  case AVMEDIA_TYPE_VIDEO:
  codec-time_base.num = avio_rb32(pb);
  codec-time_base.den = avio_rb32(pb);
 +if (codec-time_base.num  0 || codec-time_base.den = 0) {
 +av_log(s, AV_LOG_ERROR, Invalid time base %d/%d\n,
 +   codec-time_base.num, codec-time_base.den);
 +goto fail;
 +}

is anything using a 0/n timebase ?
if not i would extend this to also disallow 0/n

[..]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] GSoC '15 Introduction

2015-03-08 Thread compn
On Sat, 7 Mar 2015 20:24:16 +0200
Ilinca Andrei andrei.ilinc...@gmail.com wrote:

Hello!

welcome!

 
*Why directshow digital video capture ?*
 
Simply because It sounds really interesting and entertaining.
 I have some experience using Matlab and Simulink for converting from
 time-domain to frequency-domain and back, Bode  Nyquist Diagrams and
 I have basic knowledge about how filters work and how they can be
 used and implemented. I've done some research about video capturing
 in DirectShow , mainly on this link

 https://msdn.microsoft.com/en-us/library/windows/desktop/dd373406%28v=vs.85%29.aspx,
and I believe this project suits me the best.

dont forget you can check other open source projects
(videolan, virtualdub etc) and maybe copy how they do dshow video
capture.

 
I got the git code base cloned and started reading and
 documenting about it.

great! being able to find docs, play in git and do it all by yourself is
a very useful skill to have.

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


Re: [FFmpeg-devel] GSoC Introduction

2015-03-08 Thread compn
On Sun, 8 Mar 2015 20:34:52 +0100
Stephan Holljes klaxa1...@googlemail.com wrote:

 Hi,
 

welcome!

 my name is Stephan Holljes, my IRC nick is klaxa.
 I want to work on implementing servers for network protocols within
 the GSoC project.
 
 I've been using ffmpeg for many years already and I always wanted to
 contribute in a way other than providing end-user support, but I never
 really found the right way to approach this. I hope GSoC will provide
 a nice framework for that.

having experience with ffmpeg makes things a bit easier! :)

 I like coding in C and I like coding network related software. I hope
 I still do after the summer!

dont know til ya try it, hope you have fun with the code.

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


Re: [FFmpeg-devel] [PATCH] Port FFT domain filter.

2015-03-08 Thread arwa arif
I have attached the patch, changing the configuration file.
From 82e64037476a6e7dd914fb9bb6faefcf4de2de8d Mon Sep 17 00:00:00 2001
From: Arwa Arif arwaarif1...@gmail.com
Date: Mon, 9 Mar 2015 09:05:35 +0530
Subject: [PATCH] Add dependencies to configure file for vf_fftfilt

---
 configure |3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure b/configure
index 1ea2032..8e832c2 100755
--- a/configure
+++ b/configure
@@ -2595,6 +2595,8 @@ deshake_filter_select=pixelutils
 drawtext_filter_deps=libfreetype
 ebur128_filter_deps=gpl
 eq_filter_deps=gpl
+fftfilt_filter_deps=avcodec
+fftfilt_filter_select=rdft
 flite_filter_deps=libflite
 frei0r_filter_deps=frei0r dlopen
 frei0r_src_filter_deps=frei0r dlopen
@@ -5455,6 +5457,7 @@ enabled asyncts_filter   prepend avfilter_deps avresample
 enabled atempo_filterprepend avfilter_deps avcodec
 enabled ebur128_filter  enabled swresample  prepend avfilter_deps swresample
 enabled elbg_filter  prepend avfilter_deps avcodec
+enabled fftfilt_filter   prepend avfilter_deps avcodec
 enabled mcdeint_filter   prepend avfilter_deps avcodec
 enabled movie_filter prepend avfilter_deps avformat avcodec
 enabled pan_filter   prepend avfilter_deps swresample
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-08 Thread Claudio Freire
On Sun, Mar 8, 2015 at 8:23 AM, Michael Niedermayer michae...@gmx.at wrote:
 i think its better to leave fuzz at a small value otherwise we
 would forget to update the target when it improves and then
 subsequent worsenings could be missed

An updated version with that fixed.

It's a bit tricky to squash commits with git format-patch, so if
there's an issue with the patch just apply it with patch -p1, works
that way (tried)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-08 Thread Claudio Freire
On Sun, Mar 8, 2015 at 11:06 PM, Claudio Freire klaussfre...@gmail.com wrote:
 On Sun, Mar 8, 2015 at 8:23 AM, Michael Niedermayer michae...@gmx.at wrote:
 i think its better to leave fuzz at a small value otherwise we
 would forget to update the target when it improves and then
 subsequent worsenings could be missed

 An updated version with that fixed.

 It's a bit tricky to squash commits with git format-patch, so if
 there's an issue with the patch just apply it with patch -p1, works
 that way (tried)


Dang, forgot to attach the patch.

Now truly attached.
From 9ebb5b6d0085a547938afb32c7d203686f7fcf11 Mon Sep 17 00:00:00 2001
From: Claudio Freire klaussfre...@gmail.com
Date: Sun, 8 Mar 2015 03:53:22 -0300
Subject: [PATCH] Add AAC tests for 7350hz sampling rates and M/S

Also tweak fuzz factor to not error out on too little distortion (ie: codec improvement)
---
 tests/fate-run.sh  |  6 ++
 tests/fate/aac.mak | 33 +++--
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 824d5f4..feac731 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -50,6 +50,12 @@ do_tiny_psnr(){
 size_cmp=$(compare $size1 $size2 $size_tolerance)
 if [ $val_cmp != 0 ] || [ $size_cmp != 0 ]; then
 echo $psnr
+if [ $val_cmp != 0 ]; then
+echo $3: |$val - $cmp_target| = $fuzz
+fi
+if [ $size_cmp != 0 ]; then
+echo size: |$size1 - $size2| = $size_tolerance
+fi
 return 1
 fi
 }
diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
index 34823be..bab1e5f 100644
--- a/tests/fate/aac.mak
+++ b/tests/fate/aac.mak
@@ -95,6 +95,26 @@ fate-aac-aref-encode: CMP_TARGET = 434
 fate-aac-aref-encode: SIZE_TOLERANCE = 2464
 fate-aac-aref-encode: FUZZ = 5
 
+FATE_AAC_ENCODE += fate-aac-s7350-encode
+fate-aac-s7350-encode: ./tests/data/asynth-7350-2.wav
+fate-aac-s7350-encode: CMD = enc_dec_pcm adts wav s16le $(REF) -strict -2 -c:a aac -b:a 256k
+fate-aac-s7350-encode: CMP = stddev
+fate-aac-s7350-encode: REF = ./tests/data/asynth-7350-2.wav
+fate-aac-s7350-encode: CMP_SHIFT = -4096
+fate-aac-s7350-encode: CMP_TARGET = 414
+fate-aac-s7350-encode: SIZE_TOLERANCE = 4096
+fate-aac-s7350-encode: FUZZ = 5
+
+FATE_AAC_ENCODE += fate-aac-arefms-encode
+fate-aac-arefms-encode: ./tests/data/asynth-44100-2.wav
+fate-aac-arefms-encode: CMD = enc_dec_pcm adts wav s16le $(REF) -strict -2 -c:a aac -stereo_mode auto -b:a 512k
+fate-aac-arefms-encode: CMP = stddev
+fate-aac-arefms-encode: REF = ./tests/data/asynth-44100-2.wav
+fate-aac-arefms-encode: CMP_SHIFT = -4096
+fate-aac-arefms-encode: CMP_TARGET = 451
+fate-aac-arefms-encode: SIZE_TOLERANCE = 2464
+fate-aac-arefms-encode: FUZZ = 5
+
 FATE_AAC_ENCODE += fate-aac-ln-encode
 fate-aac-ln-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -b:a 512k
 fate-aac-ln-encode: CMP = stddev
@@ -103,6 +123,15 @@ fate-aac-ln-encode: CMP_SHIFT = -4096
 fate-aac-ln-encode: CMP_TARGET = 65
 fate-aac-ln-encode: SIZE_TOLERANCE = 3560
 
+FATE_AAC_ENCODE += fate-aac-lnms-encode
+fate-aac-lnms-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -stereo_mode auto -c:a aac -b:a 512k
+fate-aac-lnms-encode: CMP = stddev
+fate-aac-lnms-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
+fate-aac-lnms-encode: CMP_SHIFT = -4096
+fate-aac-lnms-encode: CMP_TARGET = 65
+fate-aac-lnms-encode: SIZE_TOLERANCE = 3560
+fate-aac-lnms-encode: FUZZ = 5
+
 FATE_AAC_LATM += fate-aac-latm_1180bc60
 fate-aac-latm_1180bc60: CMD = pcm -i $(TARGET_SAMPLES)/aac/latm_1180bc60.mpg
 fate-aac-latm_1180bc60: REF = $(SAMPLES)/aac/latm_1180bc60.s16
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/8] ffmdec: initialize f_cprv, f_stvi and f_stau

2015-03-08 Thread Michael Niedermayer
On Mon, Mar 09, 2015 at 12:02:55AM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 attached patch fixes 'Conditional jump or move depends on
 uninitialized variables' valgrind warnings.
 
 Best regards,
 Andreas

  ffmdec.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 4a297cdd7cdb822a449cd846139a86ae284893aa  
 0001-ffmdec-initialize-f_cprv-f_stvi-and-f_stau.patch
 From 8b1088fa1509b1613d095fbe1c11eec6d251c95c Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Sun, 8 Mar 2015 22:52:47 +0100
 Subject: [PATCH 1/8] ffmdec: initialize f_cprv, f_stvi and f_stau
 
 They are used in a switch statement, but it is not guaranteed that the
 COMM case (where they are set to 0) is reached before the other cases.

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] pthread: Fix ff_thread_get_formatissues when called outside frame decode.

2015-03-08 Thread Rainer Hochecker
Reimar Döffinger Reimar.Doeffinger at gmx.de writes:


I have tested this with Kodi. Works with sw decoding. With DXVA it crashes,
looks like heap corruption or the like.
setting thread_safe_callbacks = 1 cures the issue but I get some green
frames at start of playback. 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/8] ffmdec: make sure the time base is valid

2015-03-08 Thread Andreas Cadhalpun

Hi,

attached patch fixes assertions in av_rescale_rnd.

Best regards,
Andreas
From 8f647fe16693509056483c4d1bc4a57895e9de10 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:12:59 +0100
Subject: [PATCH 3/8] ffmdec: make sure the time base is valid

A negative time base can trigger assertions.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index af37e74..2459691 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -331,6 +331,12 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 codec-time_base.num = avio_rb32(pb);
 codec-time_base.den = avio_rb32(pb);
+if (codec-time_base.num  0 || codec-time_base.den = 0) {
+av_log(s, AV_LOG_ERROR, Invalid time base %d/%d\n,
+   codec-time_base.num, codec-time_base.den);
+ret = AVERROR_INVALIDDATA;
+goto fail;
+}
 codec-width = avio_rb16(pb);
 codec-height = avio_rb16(pb);
 codec-gop_size = avio_rb16(pb);
@@ -503,6 +509,11 @@ static int ffm_read_header(AVFormatContext *s)
 case AVMEDIA_TYPE_VIDEO:
 codec-time_base.num = avio_rb32(pb);
 codec-time_base.den = avio_rb32(pb);
+if (codec-time_base.num  0 || codec-time_base.den = 0) {
+av_log(s, AV_LOG_ERROR, Invalid time base %d/%d\n,
+   codec-time_base.num, codec-time_base.den);
+goto fail;
+}
 codec-width = avio_rb16(pb);
 codec-height = avio_rb16(pb);
 codec-gop_size = avio_rb16(pb);
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 1/8] ffmdec: initialize f_cprv, f_stvi and f_stau

2015-03-08 Thread Andreas Cadhalpun

Hi,

attached patch fixes 'Conditional jump or move depends on uninitialized 
variables' valgrind warnings.


Best regards,
Andreas
From 8b1088fa1509b1613d095fbe1c11eec6d251c95c Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 22:52:47 +0100
Subject: [PATCH 1/8] ffmdec: initialize f_cprv, f_stvi and f_stau

They are used in a switch statement, but it is not guaranteed that the
COMM case (where they are set to 0) is reached before the other cases.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 987f419..280a24c 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -261,7 +261,7 @@ static int ffm2_read_header(AVFormatContext *s)
 AVIOContext *pb = s-pb;
 AVCodecContext *codec;
 int ret;
-int f_main = 0, f_cprv, f_stvi, f_stau;
+int f_main = 0, f_cprv = -1, f_stvi = -1, f_stau = -1;
 AVCodec *enc;
 char *buffer;
 
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] pthread: Fix ff_thread_get_formatissues when called outside frame decode.

2015-03-08 Thread Reimar Döffinger
On 08.03.2015, at 22:56, Rainer Hochecker fernetme...@online.de wrote:
 Reimar Döffinger Reimar.Doeffinger at gmx.de writes:
 
 
 I have tested this with Kodi. Works with sw decoding. With DXVA it crashes,
 looks like heap corruption or the like.
 setting thread_safe_callbacks = 1 cures the issue but I get some green
 frames at start of playback. 

Any reason to believe this patch causes it?
Because I can't see how it would.
Maybe it's just a bug with DXVA and multithreading in the HEVC code?
Can you provide some more information like a stacktrace, possibly using a tool 
like DrMemory?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dump: show audio service type

2015-03-08 Thread Clément Bœsch
On Sun, Mar 08, 2015 at 11:56:34AM +0100, Thomas Volkert wrote:
 ---
  libavformat/dump.c | 29 +
  1 file changed, 29 insertions(+)
 
 diff --git a/libavformat/dump.c b/libavformat/dump.c
 index 56b37ff..9801042 100644
 --- a/libavformat/dump.c
 +++ b/libavformat/dump.c
 @@ -291,6 +291,31 @@ static void dump_stereo3d(void *ctx, AVPacketSideData 
 *sd)
  av_log(ctx, AV_LOG_INFO,  (inverted));
  }
  
 +static void dump_audio_service_type(void *ctx, AVPacketSideData *sd)
 +{
 +enum AVAudioServiceType *ast;
 +
 +if (sd-size  sizeof(*ast)) {
 +av_log(ctx, AV_LOG_INFO, invalid data);
 +return;
 +}
 +
 +ast = (enum AVAudioServiceType *)sd-data;
 +
 +switch (*ast) {
 +case AV_AUDIO_SERVICE_TYPE_MAIN:  av_log(ctx, AV_LOG_INFO, 
 Main Audio Service); break;
 +case AV_AUDIO_SERVICE_TYPE_EFFECTS:   av_log(ctx, AV_LOG_INFO, 
 Effects);break;
 +case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: av_log(ctx, AV_LOG_INFO, 
 Visually Impaired);  break;
 +case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:  av_log(ctx, AV_LOG_INFO, 
 Hearing Impaired);   break;
 +case AV_AUDIO_SERVICE_TYPE_DIALOGUE:  av_log(ctx, AV_LOG_INFO, 
 Dialogue);   break;
 +case AV_AUDIO_SERVICE_TYPE_COMMENTARY:av_log(ctx, AV_LOG_INFO, 
 Commentary); break;
 +case AV_AUDIO_SERVICE_TYPE_EMERGENCY: av_log(ctx, AV_LOG_INFO, 
 Emergency);  break;
 +case AV_AUDIO_SERVICE_TYPE_VOICE_OVER:av_log(ctx, AV_LOG_INFO, 
 Voice Over); break;
 +case AV_AUDIO_SERVICE_TYPE_KARAOKE:   av_log(ctx, AV_LOG_INFO, 
 Karaoke);break;
 +default:  av_log(ctx, AV_LOG_INFO, 
 unknown);break;
 +}
 +}
 +
  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
  {
  int i;
 @@ -328,6 +353,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
 char *indent)
  av_log(ctx, AV_LOG_INFO, stereo3d: );
  dump_stereo3d(ctx, sd);
  break;
 +case AV_PKT_DATA_AUDIO_SERVICE_TYPE:
 +av_log(ctx, AV_LOG_INFO, audio svc type  : );
 +dump_audio_service_type(ctx, sd);
 +break;
  default:
  av_log(ctx, AV_LOG_WARNING,
 unknown side data type %d (%d bytes), sd.type, sd.size);

Factorize it with ashowinfo instead of copying the code.

You can add a public helper returning the string.

-- 
Clément B.


pgp1f_FpsdxVd.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/hevc_parser: use avpriv_find_start_code in hevc_split()

2015-03-08 Thread Michael Niedermayer
On Sat, Mar 07, 2015 at 11:47:08PM +0800, zhaoxiu.zeng wrote:
 From ab12e3081ba987c2e05d819be97cde96952f1c2a Mon Sep 17 00:00:00 2001
 From: Zeng Zhaoxiu zhaoxiu.z...@gmail.com
 Date: Sat, 7 Mar 2015 23:29:46 +0800
 Subject: [PATCH 1/1] avcodec/hevc_parser: use avpriv_find_start_code in
  hevc_split()
 
 Signed-off-by: Zeng Zhaoxiu zhaoxiu.z...@gmail.com
 ---
  libavcodec/hevc_parser.c | 26 +-
  1 file changed, 13 insertions(+), 13 deletions(-)
 
 diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
 index a6fdbb7..91fc0d4 100644
 --- a/libavcodec/hevc_parser.c
 +++ b/libavcodec/hevc_parser.c
 @@ -286,21 +286,21 @@ static int hevc_parse(AVCodecParserContext *s,
  // Split after the parameter sets at the beginning of the stream if they 
 exist.
  static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int 
 buf_size)
  {
 -int i;
 +const uint8_t *ptr = buf, end = buf + buf_size;

end is a uint8_t, that will not work
also please make sure to test the code you change

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: included uses_2pass member in vp9_ref_frame().

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 09:21:42AM -0400, Ronald S. Bultje wrote:
 ---
  libavcodec/vp9.c | 1 +
  1 file changed, 1 insertion(+)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] dump: show audio service type

2015-03-08 Thread Thomas Volkert
---
 libavformat/dump.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56b37ff..9801042 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -291,6 +291,31 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
 av_log(ctx, AV_LOG_INFO,  (inverted));
 }
 
+static void dump_audio_service_type(void *ctx, AVPacketSideData *sd)
+{
+enum AVAudioServiceType *ast;
+
+if (sd-size  sizeof(*ast)) {
+av_log(ctx, AV_LOG_INFO, invalid data);
+return;
+}
+
+ast = (enum AVAudioServiceType *)sd-data;
+
+switch (*ast) {
+case AV_AUDIO_SERVICE_TYPE_MAIN:  av_log(ctx, AV_LOG_INFO, 
Main Audio Service); break;
+case AV_AUDIO_SERVICE_TYPE_EFFECTS:   av_log(ctx, AV_LOG_INFO, 
Effects);break;
+case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: av_log(ctx, AV_LOG_INFO, 
Visually Impaired);  break;
+case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:  av_log(ctx, AV_LOG_INFO, 
Hearing Impaired);   break;
+case AV_AUDIO_SERVICE_TYPE_DIALOGUE:  av_log(ctx, AV_LOG_INFO, 
Dialogue);   break;
+case AV_AUDIO_SERVICE_TYPE_COMMENTARY:av_log(ctx, AV_LOG_INFO, 
Commentary); break;
+case AV_AUDIO_SERVICE_TYPE_EMERGENCY: av_log(ctx, AV_LOG_INFO, 
Emergency);  break;
+case AV_AUDIO_SERVICE_TYPE_VOICE_OVER:av_log(ctx, AV_LOG_INFO, 
Voice Over); break;
+case AV_AUDIO_SERVICE_TYPE_KARAOKE:   av_log(ctx, AV_LOG_INFO, 
Karaoke);break;
+default:  av_log(ctx, AV_LOG_INFO, 
unknown);break;
+}
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
 int i;
@@ -328,6 +353,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
char *indent)
 av_log(ctx, AV_LOG_INFO, stereo3d: );
 dump_stereo3d(ctx, sd);
 break;
+case AV_PKT_DATA_AUDIO_SERVICE_TYPE:
+av_log(ctx, AV_LOG_INFO, audio svc type  : );
+dump_audio_service_type(ctx, sd);
+break;
 default:
 av_log(ctx, AV_LOG_WARNING,
unknown side data type %d (%d bytes), sd.type, sd.size);
-- 
2.1.0

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


Re: [FFmpeg-devel] Windows deprecated stdin reading method

2015-03-08 Thread Peter
alright, that table didn't work out, just imagine this:

.\test.exe a.txt input ignored
type a.txt | .\test.exe   works
.\test.exe a.txt input ignored
cat a.txt | .\test.exeworks
Get-Content input-file.txt | .\test.exe   works
.\test.exe a.txt input ignored
cat a.txt | .\test.exeworks

across both approaches

2015-03-08 12:07 GMT+01:00 Peter dravo...@googlemail.com:
 So testing on Windows 8.1 the results seem identical

 ||shell||command
 ||stdin-_cnt  0||WaitForSingleObject||
 ||=||=||===||===||
 ||cmd.exe  || .\test.exe a.txt   || input
 ignored || input ignored ||
 ||cmd.exe  || type a.txt | .\test.exe || works
 || works ||
 ||msys/cmd.exe || .\test.exe a.txt   || input
 ignored || input ignored ||
 ||msys/cmd.exe || cat a.txt | .\test.exe  || works
 || works ||
 ||powershell   || Get-Content input-file.txt | .\test.exe || works
 || works ||
 ||cygwin/mintty.exe|| .\test.exe a.txt   || input
 ignored || input ignored ||
 ||cygwin/mintty.exe|| cat a.txt | .\test.exe  || works
 || works ||

 I'm not sure I'm doing the redirection right. If there's something
 else that I need to test
 I would appreciate some input (no clue what can reasonably passed as
 stdin to CreateProcess
 or whether testing that is necessary)

 Also, very crucially, I just checked if any of these methods actually
 triggered either condition
 and none of the things I tried actually entered  the body of the if-check.

 Is there anything that would normally trigger the stdin-_cnt  0 in
 that location ?

 2015-03-08 2:25 GMT+01:00 Peter dravo...@googlemail.com:
 Sadly it seems WaitForSingleObject behavior with FILE handles is
 not well defined behavior either, I think I've read the words strongly
 discouraged

 I'm probably still gonna do some more tests to see if it actually breaks
 under some circumstances. But this is not the golden ticket solution
 either it seems.

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


Re: [FFmpeg-devel] [PATCH] dump: show audio service type

2015-03-08 Thread Thomas Volkert

On 03/08/2015 12:03 PM, Nicolas George wrote:

L'octidi 18 ventôse, an CCXXIII, Clement Boesch a écrit :

Factorize it with ashowinfo instead of copying the code.

You can add a public helper returning the string.

I strongly support the second option. All enums like that should have a
corresponding string - enum utility.

Actually, we may want to make this kind of string - enum mapping more
standard, so they can be used in options parsing, but that is more work, so
not necessary immediately.




We could add const char *av_get_audio_service_name(enum 
AVAudioServiceType type) to avutil.h and use this function both in 
avformat and avfilter.


Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 03:55:09AM -0300, Claudio Freire wrote:
 On Fri, Mar 6, 2015 at 2:19 PM, Michael Niedermayer michae...@gmx.at wrote:
  So it seems the test doesn't set up the LD_LIBRARY_PATH correctly.
  That's fixable, I'll see about getting a patch for that when I
  understand the makefile layout.
 
  In the meantime, I'm *guessing* a test would look like the patch
  attached, but I still cannot run it. It says it won't, because:
  warning: only a subset of the fate tests will be run because SAMPLES
  is not specified
 
  Any idea where to get the samples? It's not just any samples, it wants
  a specific set of samples.
 
  configure with --samples= to point to some directory and run
  make fate-rsync
  (this will need about 900mb space)
 
 
 Yeah, that works.
 
 Attached another patch that adds the tests. Goes on top of the initial
 patch (with the fixes themselves)

  fate-run.sh  |6 ++
  fate/aac.mak |   33 +++--
  2 files changed, 37 insertions(+), 2 deletions(-)
 7ee0079156ce01622cf6f4658db9d8e452513aee  s7350test.patch
 From 9ebb5b6d0085a547938afb32c7d203686f7fcf11 Mon Sep 17 00:00:00 2001
 From: Claudio Freire klaussfre...@gmail.com
 Date: Sun, 8 Mar 2015 03:53:22 -0300
 Subject: [PATCH] Add AAC tests for 7350hz sampling rates and M/S
 
 Also tweak fuzz factor to not error out on too little distortion (ie: codec 
 improvement)
 ---
  tests/fate-run.sh  |  6 ++
  tests/fate/aac.mak | 33 +++--
  2 files changed, 37 insertions(+), 2 deletions(-)
 
 diff --git a/tests/fate-run.sh b/tests/fate-run.sh
 index 824d5f4..feac731 100755
 --- a/tests/fate-run.sh
 +++ b/tests/fate-run.sh
 @@ -50,6 +50,12 @@ do_tiny_psnr(){
  size_cmp=$(compare $size1 $size2 $size_tolerance)
  if [ $val_cmp != 0 ] || [ $size_cmp != 0 ]; then
  echo $psnr
 +if [ $val_cmp != 0 ]; then
 +echo $3: |$val - $cmp_target| = $fuzz
 +fi
 +if [ $size_cmp != 0 ]; then
 +echo size: |$size1 - $size2| = $size_tolerance
 +fi
  return 1
  fi
  }
 diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
 index 34823be..cda80a4 100644
 --- a/tests/fate/aac.mak
 +++ b/tests/fate/aac.mak
 @@ -91,9 +91,29 @@ fate-aac-aref-encode: CMD = enc_dec_pcm adts wav s16le 
 $(REF) -strict -2 -c:a aa
  fate-aac-aref-encode: CMP = stddev
  fate-aac-aref-encode: REF = ./tests/data/asynth-44100-2.wav
  fate-aac-aref-encode: CMP_SHIFT = -4096
 -fate-aac-aref-encode: CMP_TARGET = 434
 +fate-aac-aref-encode: CMP_TARGET = 225
  fate-aac-aref-encode: SIZE_TOLERANCE = 2464
 -fate-aac-aref-encode: FUZZ = 5
 +fate-aac-aref-encode: FUZZ = 225

i think its better to leave fuzz at a small value otherwise we
would forget to update the target when it improves and then
subsequent worsenings could be missed

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vp9: split segmentation map / mvpair references.

2015-03-08 Thread Ronald S. Bultje
This prevents a memcpy if segmentation.update_map == false.
---
 libavcodec/vp9.c | 72 ++--
 1 file changed, 34 insertions(+), 38 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index aff86d0..6f129f0 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -74,6 +74,7 @@ typedef struct VP9Frame {
 AVBufferRef *extradata;
 uint8_t *segmentation_map;
 struct VP9mvrefPair *mv;
+int uses_2pass;
 } VP9Frame;
 
 struct VP9Filter {
@@ -100,7 +101,7 @@ typedef struct VP9Context {
 VP56RangeCoder *c_b;
 unsigned c_b_size;
 VP9Block *b_base, *b;
-int pass, uses_2pass, last_uses_2pass;
+int pass;
 int row, row7, col, col7;
 uint8_t *dst[3];
 ptrdiff_t y_stride, uv_stride;
@@ -128,8 +129,9 @@ typedef struct VP9Context {
 uint8_t varcompref[2];
 ThreadFrame refs[8], next_refs[8];
 #define CUR_FRAME 0
-#define LAST_FRAME 1
-VP9Frame frames[2];
+#define REF_FRAME_MVPAIR 1
+#define REF_FRAME_SEGMAP 2
+VP9Frame frames[3];
 
 struct {
 uint8_t level;
@@ -277,13 +279,6 @@ static int vp9_alloc_frame(AVCodecContext *ctx, VP9Frame 
*f)
 f-segmentation_map = f-extradata-data;
 f-mv = (struct VP9mvrefPair *) (f-extradata-data + sz);
 
-// retain segmentation map if it doesn't update
-if (s-segmentation.enabled  !s-segmentation.update_map 
-!s-intraonly  !s-keyframe  !s-errorres 
-ctx-active_thread_type != FF_THREAD_FRAME) {
-memcpy(f-segmentation_map, s-frames[LAST_FRAME].segmentation_map, 
sz);
-}
-
 return 0;
 }
 
@@ -362,12 +357,12 @@ static int update_block_buffers(AVCodecContext *ctx)
 {
 VP9Context *s = ctx-priv_data;
 
-if (s-b_base  s-block_base  s-block_alloc_using_2pass == 
s-uses_2pass)
+if (s-b_base  s-block_base  s-block_alloc_using_2pass == 
s-frames[CUR_FRAME].uses_2pass)
 return 0;
 
 av_free(s-b_base);
 av_free(s-block_base);
-if (s-uses_2pass) {
+if (s-frames[CUR_FRAME].uses_2pass) {
 int sbs = s-sb_cols * s-sb_rows;
 
 s-b_base = av_malloc_array(s-cols * s-rows, sizeof(VP9Block));
@@ -390,7 +385,7 @@ static int update_block_buffers(AVCodecContext *ctx)
 s-uveob_base[0] = s-eob_base + 256;
 s-uveob_base[1] = s-uveob_base[0] + 64;
 }
-s-block_alloc_using_2pass = s-uses_2pass;
+s-block_alloc_using_2pass = s-frames[CUR_FRAME].uses_2pass;
 
 return 0;
 }
@@ -491,7 +486,6 @@ static int decode_frame_header(AVCodecContext *ctx,
 *ref = get_bits(s-gb, 3);
 return 0;
 }
-s-last_uses_2pass = s-uses_2pass;
 s-last_keyframe  = s-keyframe;
 s-keyframe   = !get_bits1(s-gb);
 last_invisible= s-invisible;
@@ -1082,10 +1076,10 @@ static void find_ref_mvs(VP9Context *s,
 
 // MV at this position in previous frame, using same reference frame
 if (s-use_last_frame_mvs) {
-struct VP9mvrefPair *mv = s-frames[LAST_FRAME].mv[row * s-sb_cols * 
8 + col];
+struct VP9mvrefPair *mv = s-frames[REF_FRAME_MVPAIR].mv[row * 
s-sb_cols * 8 + col];
 
-if (!s-last_uses_2pass)
-ff_thread_await_progress(s-frames[LAST_FRAME].tf, row  3, 0);
+if (!s-frames[REF_FRAME_MVPAIR].uses_2pass)
+ff_thread_await_progress(s-frames[REF_FRAME_MVPAIR].tf, row  
3, 0);
 if (mv-ref[0] == ref) {
 RETURN_MV(mv-mv[0]);
 } else if (mv-ref[1] == ref) {
@@ -1124,7 +1118,7 @@ static void find_ref_mvs(VP9Context *s,
 
 // MV at this position in previous frame, using different reference frame
 if (s-use_last_frame_mvs) {
-struct VP9mvrefPair *mv = s-frames[LAST_FRAME].mv[row * s-sb_cols * 
8 + col];
+struct VP9mvrefPair *mv = s-frames[REF_FRAME_MVPAIR].mv[row * 
s-sb_cols * 8 + col];
 
 // no need to await_progress, because we already did that above
 if (mv-ref[0] != ref  mv-ref[0] = 0) {
@@ -1348,21 +1342,14 @@ static void decode_mode(AVCodecContext *ctx)
 s-left_segpred_ctx[row7]]))) {
 if (!s-errorres) {
 int pred = 8, x;
-uint8_t *refsegmap = s-frames[LAST_FRAME].segmentation_map;
+uint8_t *refsegmap = s-frames[REF_FRAME_SEGMAP].segmentation_map;
 
-if (!s-last_uses_2pass)
-ff_thread_await_progress(s-frames[LAST_FRAME].tf, row  3, 
0);
+if (!s-frames[REF_FRAME_SEGMAP].uses_2pass)
+ff_thread_await_progress(s-frames[REF_FRAME_SEGMAP].tf, row 
 3, 0);
 for (y = 0; y  h4; y++) {
 int idx_base = (y + row) * 8 * s-sb_cols + col;
 for (x = 0; x  w4; x++)
 pred = FFMIN(pred, refsegmap[idx_base + x]);
-if (!s-segmentation.update_map  ctx-active_thread_type == 
FF_THREAD_FRAME) {
-// FIXME maybe retain reference to previous frame as
-// segmap reference instead of copying the whole map
- 

Re: [FFmpeg-devel] [PATCH] doc/filters: Add some random examples for fftfilt

2015-03-08 Thread Michael Niedermayer
On Sun, Mar 08, 2015 at 12:57:03AM +, Timothy Gu wrote:
 On Sat, Mar 7, 2015 at 2:29 PM Michael Niedermayer michae...@gmx.at wrote:
 
  Signed-off-by: Michael Niedermayer michae...@gmx.at
  ---
   doc/filters.texi |   23 +++
   1 file changed, 23 insertions(+)
 
  diff --git a/doc/filters.texi b/doc/filters.texi
  index b15087c..9149ae5 100644
  --- a/doc/filters.texi
  +++ b/doc/filters.texi
  @@ -4629,6 +4629,29 @@ The coordinates of the current sample.
   The width and height of the image.
   @end table
 
  +@subsection Examples
  +
  +@itemize
  +@item
 
 
 
  +Highpass:
 
 
 High-pass:
 
 
  +@example
  +fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  +
  +@end example
  +
 
 
 
  +Lowpass
 
 
 add @item and ':'
 also Low-pass

fixed
applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dump: show audio service type

2015-03-08 Thread Nicolas George
L'octidi 18 ventôse, an CCXXIII, Clement Boesch a écrit :
 Factorize it with ashowinfo instead of copying the code.
 
 You can add a public helper returning the string.

I strongly support the second option. All enums like that should have a
corresponding string - enum utility.

Actually, we may want to make this kind of string - enum mapping more
standard, so they can be used in options parsing, but that is more work, so
not necessary immediately.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Windows deprecated stdin reading method

2015-03-08 Thread Peter
So testing on Windows 8.1 the results seem identical

||shell||command
||stdin-_cnt  0||WaitForSingleObject||
||=||=||===||===||
||cmd.exe  || .\test.exe a.txt   || input
ignored || input ignored ||
||cmd.exe  || type a.txt | .\test.exe || works
|| works ||
||msys/cmd.exe || .\test.exe a.txt   || input
ignored || input ignored ||
||msys/cmd.exe || cat a.txt | .\test.exe  || works
|| works ||
||powershell   || Get-Content input-file.txt | .\test.exe || works
|| works ||
||cygwin/mintty.exe|| .\test.exe a.txt   || input
ignored || input ignored ||
||cygwin/mintty.exe|| cat a.txt | .\test.exe  || works
|| works ||

I'm not sure I'm doing the redirection right. If there's something
else that I need to test
I would appreciate some input (no clue what can reasonably passed as
stdin to CreateProcess
or whether testing that is necessary)

Also, very crucially, I just checked if any of these methods actually
triggered either condition
and none of the things I tried actually entered  the body of the if-check.

Is there anything that would normally trigger the stdin-_cnt  0 in
that location ?

2015-03-08 2:25 GMT+01:00 Peter dravo...@googlemail.com:
 Sadly it seems WaitForSingleObject behavior with FILE handles is
 not well defined behavior either, I think I've read the words strongly
 discouraged

 I'm probably still gonna do some more tests to see if it actually breaks
 under some circumstances. But this is not the golden ticket solution
 either it seems.

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


[FFmpeg-devel] [PATCH] vp9: included uses_2pass member in vp9_ref_frame().

2015-03-08 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 6f129f0..77e98f5 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -301,6 +301,7 @@ static int vp9_ref_frame(AVCodecContext *ctx, VP9Frame 
*dst, VP9Frame *src)
 
 dst-segmentation_map = src-segmentation_map;
 dst-mv = src-mv;
+dst-uses_2pass = src-uses_2pass;
 
 return 0;
 }
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 7/8] ffmdec: don't return AVERROR(EAGAIN) from ffm_is_avail_data

2015-03-08 Thread Andreas Cadhalpun

Hi,

if AVERROR(EAGAIN) is returned from ffm_is_avail_data it always causes 
an infinite EAGAIN loop.


Best regards,
Andreas
From 115425287fe1f898baa79705f05d495c061e310a Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:34:29 +0100
Subject: [PATCH 7/8] ffmdec: don't return AVERROR(EAGAIN) from
 ffm_is_avail_data

If AVERROR(EAGAIN) is returned, ffm_read_packet is called again
immediately, which calls ffm_is_avail_data before changing the ffm
context, so that this will return AVERROR(EAGAIN) again, leading
to an infinite loop (again).

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 60df51d..9f00fc4 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -46,10 +46,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
 return AVERROR_EOF;
 avail_size = ffm-file_size - pos;
 } else {
-if (pos == ffm-write_index) {
-/* exactly at the end of stream */
-return AVERROR(EAGAIN);
-} else if (pos  ffm-write_index) {
+if (pos  ffm-write_index) {
 avail_size = ffm-write_index - pos;
 } else {
 avail_size = (ffm-file_size - pos) + (ffm-write_index - FFM_PACKET_SIZE);
@@ -59,7 +56,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
 if (size = avail_size)
 return 1;
 else
-return AVERROR(EAGAIN);
+return AVERROR_INVALIDDATA;
 }
 
 static int ffm_resync(AVFormatContext *s, int state)
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 8/8] ffmdec: don't seek back at EOF

2015-03-08 Thread Andreas Cadhalpun

Hi,

I'm not sure what the purpose of this avio_seek was, but it can result 
in an endless loop. Maybe it always does.


Best regards,
Andreas
From e69589b1435b4d3e7a0a4de6158149f11a99a681 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:39:23 +0100
Subject: [PATCH 8/8] ffmdec: don't seek back at EOF

Doing so can cause the ffm demuxer to return the same packets endlessly.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9f00fc4..97849f8 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -91,7 +91,7 @@ static int ffm_read_data(AVFormatContext *s,
 len = size;
 if (len == 0) {
 if (avio_tell(pb) == ffm-file_size)
-avio_seek(pb, ffm-packet_size, SEEK_SET);
+return AVERROR_EOF;
 retry_read:
 if (pb-buffer_size != ffm-packet_size) {
 int64_t tell = avio_tell(pb);
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 6/8] ffmdec: fix infinite loop at EOF

2015-03-08 Thread Andreas Cadhalpun

Hi,

if ffm files are shorter than expected, these loops never finish. 
Attached patch fixes that.


Best regards,
Andreas
From 697ac779497e26e27e6337205e37a371020add1e Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Sun, 8 Mar 2015 23:31:48 +0100
Subject: [PATCH 6/8] ffmdec: fix infinite loop at EOF

If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavformat/ffmdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9cbd20c..60df51d 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -460,7 +460,7 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 
 /* get until end of block reached */
-while ((avio_tell(pb) % ffm-packet_size) != 0)
+while ((avio_tell(pb) % ffm-packet_size) != 0  !pb-eof_reached)
 avio_r8(pb);
 
 /* init packet demux */
@@ -592,7 +592,7 @@ static int ffm_read_header(AVFormatContext *s)
 }
 
 /* get until end of block reached */
-while ((avio_tell(pb) % ffm-packet_size) != 0)
+while ((avio_tell(pb) % ffm-packet_size) != 0  !pb-eof_reached)
 avio_r8(pb);
 
 /* init packet demux */
-- 
2.1.4

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


[FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
---
 libavcodec/hevc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index fdbaa28..7c7f920 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -307,7 +307,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
 *fmt++ = sps-pix_fmt;
 *fmt = AV_PIX_FMT_NONE;
 
-ret = ff_thread_get_format(s-avctx, pix_fmts);
+ret = ff_get_format(s-avctx, pix_fmts);
 if (ret  0)
 goto fail;
 s-avctx-pix_fmt = ret;
-- 
2.1.0

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


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread James Almer
On 08/03/15 1:16 PM, Reimar Döffinger wrote:
 Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
 in my tests on a G4 7450.
 
 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
 ---
  libavutil/ppc/intreadwrite.h | 10 ++
  1 file changed, 10 insertions(+)
 
 diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h
 index 7671676..65b346e 100644
 --- a/libavutil/ppc/intreadwrite.h
 +++ b/libavutil/ppc/intreadwrite.h
 @@ -24,6 +24,16 @@
  #include stdint.h
  #include config.h
  
 +#if HAVE_ALTIVEC
 +#include util_altivec.h
 +#if HAVE_BIGENDIAN
 +#define AV_COPY128(d, s) vec_st(vec_ld(0, (const unsigned char *)(s)), 0, 
 (unsigned char *)(d))
 +#else
 +#define AV_COPY128(d, s) vec_vsx_st(vec_vsx_ld(0, (const unsigned char 
 *)(s)), 0, (unsigned char *)(d))
 +#endif
 +#define AV_ZERO128(d) VEC_ST(vec_splat_u8(0), 0, (unsigned char *)(d))
 +#endif

Why not use static av_always_inline functions, like it's done on other arches 
(and 
also for other defines in ppc)?

 +
  #if HAVE_XFORM_ASM
  
  #if HAVE_BIGENDIAN
 

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


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Reimar Döffinger
On Sun, Mar 08, 2015 at 05:12:50PM +0100, Rainer Hochecker wrote:
 ---
  libavcodec/hevc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
 index fdbaa28..7c7f920 100644
 --- a/libavcodec/hevc.c
 +++ b/libavcodec/hevc.c
 @@ -307,7 +307,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
  *fmt++ = sps-pix_fmt;
  *fmt = AV_PIX_FMT_NONE;
  
 -ret = ff_thread_get_format(s-avctx, pix_fmts);
 +ret = ff_get_format(s-avctx, pix_fmts);

I don't think this is correct, this code can be called from both
frame threads and from the main thread, so none of these variants
is correct.
I sent an alternative patch pthread: Fix ff_thread_get_format issues
when called outside frame decode.
However there are additional bugs like update_context calling this and thus
a single SPS change with n threads resulting in n get_format callbacks,
all except the first completely pointless (and potentially causing
issues with implementations that don't ensure that multiple get_format
are side-effect free).
As a result I am somewhat hesitant about my patch that would end up
hiding all these issues.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Reimar Döffinger
On Sun, Mar 08, 2015 at 01:21:20PM -0300, James Almer wrote:
 On 08/03/15 1:16 PM, Reimar Döffinger wrote:
  Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
  in my tests on a G4 7450.
  
  Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
  ---
   libavutil/ppc/intreadwrite.h | 10 ++
   1 file changed, 10 insertions(+)
  
  diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h
  index 7671676..65b346e 100644
  --- a/libavutil/ppc/intreadwrite.h
  +++ b/libavutil/ppc/intreadwrite.h
  @@ -24,6 +24,16 @@
   #include stdint.h
   #include config.h
   
  +#if HAVE_ALTIVEC
  +#include util_altivec.h
  +#if HAVE_BIGENDIAN
  +#define AV_COPY128(d, s) vec_st(vec_ld(0, (const unsigned char *)(s)), 0, 
  (unsigned char *)(d))
  +#else
  +#define AV_COPY128(d, s) vec_vsx_st(vec_vsx_ld(0, (const unsigned char 
  *)(s)), 0, (unsigned char *)(d))
  +#endif
  +#define AV_ZERO128(d) VEC_ST(vec_splat_u8(0), 0, (unsigned char *)(d))
  +#endif
 
 Why not use static av_always_inline functions, like it's done on other arches 
 (and 
 also for other defines in ppc)?

Well, it would mean a define and the function itself for overall around 4
lines of code what like this is a single line.
I don't have much of an opinion, I did that at first, but it just seemed
fairly bloated for what it does.
Also, not using a function is consistent with what the implementations
in the non-arch-specific intreadwrite.h do.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
Rainer Hochecker fernetmenta at online.de writes:

 
 ---
  libavcodec/hevc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
 index fdbaa28..7c7f920 100644
 --- a/libavcodec/hevc.c
 +++ b/libavcodec/hevc.c
  at  at  -307,7 +307,7  at  at  static int set_sps(HEVCContext *s,
const HEVCSPS *sps)
  *fmt++ = sps-pix_fmt;
  *fmt = AV_PIX_FMT_NONE;
 
 -ret = ff_thread_get_format(s-avctx, pix_fmts);
 +ret = ff_get_format(s-avctx, pix_fmts);
  if (ret  0)
  goto fail;
  s-avctx-pix_fmt = ret;


this is called from the main thread, hence a requesting the main thread do
the call to get_format results in a hang waiting for the state to be changed
to STATE_SETTING_UP

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


[FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread Reimar Döffinger
Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
in my tests on a G4 7450.

Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
---
 libavutil/ppc/intreadwrite.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h
index 7671676..65b346e 100644
--- a/libavutil/ppc/intreadwrite.h
+++ b/libavutil/ppc/intreadwrite.h
@@ -24,6 +24,16 @@
 #include stdint.h
 #include config.h
 
+#if HAVE_ALTIVEC
+#include util_altivec.h
+#if HAVE_BIGENDIAN
+#define AV_COPY128(d, s) vec_st(vec_ld(0, (const unsigned char *)(s)), 0, 
(unsigned char *)(d))
+#else
+#define AV_COPY128(d, s) vec_vsx_st(vec_vsx_ld(0, (const unsigned char *)(s)), 
0, (unsigned char *)(d))
+#endif
+#define AV_ZERO128(d) VEC_ST(vec_splat_u8(0), 0, (unsigned char *)(d))
+#endif
+
 #if HAVE_XFORM_ASM
 
 #if HAVE_BIGENDIAN
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

2015-03-08 Thread James Almer
On 08/03/15 1:25 PM, Reimar Döffinger wrote:
 On Sun, Mar 08, 2015 at 01:21:20PM -0300, James Almer wrote:
 On 08/03/15 1:16 PM, Reimar Döffinger wrote:
 Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
 in my tests on a G4 7450.

 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
 ---
  libavutil/ppc/intreadwrite.h | 10 ++
  1 file changed, 10 insertions(+)

 diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h
 index 7671676..65b346e 100644
 --- a/libavutil/ppc/intreadwrite.h
 +++ b/libavutil/ppc/intreadwrite.h
 @@ -24,6 +24,16 @@
  #include stdint.h
  #include config.h
  
 +#if HAVE_ALTIVEC
 +#include util_altivec.h
 +#if HAVE_BIGENDIAN
 +#define AV_COPY128(d, s) vec_st(vec_ld(0, (const unsigned char *)(s)), 0, 
 (unsigned char *)(d))
 +#else
 +#define AV_COPY128(d, s) vec_vsx_st(vec_vsx_ld(0, (const unsigned char 
 *)(s)), 0, (unsigned char *)(d))
 +#endif
 +#define AV_ZERO128(d) VEC_ST(vec_splat_u8(0), 0, (unsigned char *)(d))
 +#endif

 Why not use static av_always_inline functions, like it's done on other 
 arches (and 
 also for other defines in ppc)?
 
 Well, it would mean a define and the function itself for overall around 4
 lines of code what like this is a single line.
 I don't have much of an opinion, I did that at first, but it just seemed
 fairly bloated for what it does.
 Also, not using a function is consistent with what the implementations
 in the non-arch-specific intreadwrite.h do.

Ah, for some reason i thought i saw a semicolon in one of the defines, meaning 
more 
than one line.
Fair enough then.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
Reimar Döffinger Reimar.Doeffinger at gmx.de writes:


 
 I sent an alternative patch pthread: Fix ff_thread_get_format issues
 when called outside frame decode.

right, I didn't see you patch not the other code path.

 However there are additional bugs like update_context calling this and thus
 a single SPS change with n threads resulting in n get_format callbacks,
 all except the first completely pointless (and potentially causing
 issues with implementations that don't ensure that multiple get_format
 are side-effect free).
 As a result I am somewhat hesitant about my patch that would end up
 hiding all these issues.
 

the issue with multiple get_format calls is already present for other codecs.
 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Reimar Döffinger
On 08.03.2015, at 18:08, Rainer Hochecker fernetme...@online.de wrote:
 Reimar Döffinger Reimar.Doeffinger at gmx.de writes:
 I sent an alternative patch pthread: Fix ff_thread_get_format issues
 when called outside frame decode.
 
 right, I didn't see you patch not the other code path.
 
 However there are additional bugs like update_context calling this and thus
 a single SPS change with n threads resulting in n get_format callbacks,
 all except the first completely pointless (and potentially causing
 issues with implementations that don't ensure that multiple get_format
 are side-effect free).
 As a result I am somewhat hesitant about my patch that would end up
 hiding all these issues.
 
 
 the issue with multiple get_format calls is already present for other codecs.

I don't think so, if they did multithreading should show the same issues with 
them.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel