Michael Niedermayer
e9ad121ba5
Fix skiping typos
...
Found-by: Alessandro Ghedini <alessandro@ghedini.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8ca9a68f19
avcodec/flacdec: check rice_order against blocksize
...
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f6e13c220d0_8489_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4b12930f79
avcodec/flacdec: use get_unary() simplify code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9f5b75f241
avcodec/flacdec: make while get_bits loop more robust by checking bits left
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3b56f665b1
avcodec/flacdec: also do crc check when er compliant is set
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Luca Barbato
0e78ef0f94
flac: use meaningful return values
11 years ago
Paul B Mahol
ff0bdf9375
lavc: copy AVCodecContext for threads
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
c112e36d41
flacdec: Fix used AVCodecContext
...
Fixes out of array writes with multiple threads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
61d900fd0d
lavc: add ONLY_IF_THREADS_ENABLED where it is missing
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
a28f4fd1ea
flacdec: don't call allocate_buffers() in init_thread_copy() when s->max_blocksize is 0
...
This is normal, and happens when no extradata was available at decoder
initialization.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
9300de0409
flacdec: frame multi-threading support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
b4d4ef5529
flacdec: use init_get_bits8()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Luca Barbato
39cc4c61de
flacdec: drop unnecessary assert
...
The condition cannot happen anymore.
12 years ago
James Almer
45013b365e
lavc/flacdec: Propagate and return meaningful error codes
...
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
63d744e2be
av_log_missing_feature() ---> avpriv_report_missing_feature()
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
James Almer
1d5b35cc07
lavc/flacdec: Add frame CRC calculation
...
Fixes ticket #2266
Signed-off-by: James Almer <jamrial@gmail.com>
12 years ago
Justin Ruggles
b8e9c99ef1
flac: decode directly to the user-provided AVFrame
12 years ago
Tim Walker
08797c599d
flac: don't check the number of channels before setting the channel layout
...
This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels.
12 years ago
Tim Walker
41244e13d5
flac: don't check the number of channels before setting the channel layout.
...
This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Michael Niedermayer
fc0d069feb
flacdec: silence several "warning: X may be used uninitialized in this function"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0e9b9a6748
flacdec: skip in stream header packets
...
This prevents warning messages on chained oggs with some demuxers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
aef5150719
flac: only set channel layout if not previously set or on channel count change
...
Fixes Bug 402
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Justin Ruggles
a903f8f087
Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
...
Also reorder some other #include when applicable.
12 years ago
Justin Ruggles
99d8686357
flacdec: do not warn on sample rate change
12 years ago
Justin Ruggles
90fcac0e95
flacdec: allow mid-stream channel layout change
...
Although the libFLAC decoder cannot handle such a change, it is allowed by the
spec and could potentially occur with live streams.
12 years ago
Justin Ruggles
268f8ba112
flacdec: use av_samples_* functions for sample buffer allocation
...
Also, return an error on allocation failure.
12 years ago
Diego Biurrun
8f4c414df6
Improve wording and spelling of av_log_missing_feature messages.
12 years ago
Paul B Mahol
5864fe62ef
flacdec: replace -1 with AV_SAMPLE_FMT_NONE
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Diego Biurrun
717addecad
Use proper return values in case of missing features
12 years ago
Mans Rullgard
44c56a1617
flacdec: simplify sample buffer handling
...
Pass pointer to sample buffer instead of channel number to various
functions called from decode_subframe(). Also simplify a few
expressions within this function.
12 years ago
Mans Rullgard
ea98507db0
flacdec: simplify loop in decode_residuals()
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Michael Niedermayer
4d38b838f0
flacdec: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mans Rullgard
bf1cf4d5a5
flacdec: reverse lpc coeff order, simplify filter
...
Reversing the lpc coefficient order simplifies indexing in
the filter.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Diego Biurrun
8eea8fdceb
flac: Move flac functions shared between libraries to flac common code
...
This fixes a number of flac-related build dependencies.
13 years ago
Mans Rullgard
784514a4a8
flacdec: add planar output support
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Mans Rullgard
25accf93ad
flacdec: move lpc filter to flacdsp
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Mans Rullgard
4a8528349f
flacdec: split off channel decorrelation as flacdsp
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Mans Rullgard
87466f8124
flacdec: factor out code setting avctx->sample_fmt
13 years ago
Mans Rullgard
93e7ef9a24
flacdec: allocate sample buffers with av_malloc
...
The buffers are only allocated once, although it can happen from
any of a few different places, so there is no need to use realloc.
Using av_malloc() ensures they are aligned suitably for SIMD
optimisations.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Mans Rullgard
0da301e105
flacdec: remove curr_bps from FLACContext
...
This value does not need to be persistent across calls.
13 years ago
Mans Rullgard
4719ea7e1e
flacdec: remove redundant setting of avctx->sample_fmt
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Justin Ruggles
62d5f9e5ca
flacdec: set channel_layout based on channel count
...
Channel layouts are specified in the FLAC format description at
http://flac.sourceforge.net/format.html
fixes Bug 209
13 years ago
Ronald S. Bultje
52e4018be4
flac: fix infinite loops on all-zero input or end-of-stream.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Diego Biurrun
a8798c7eb9
Drop unnecessary av_uninit attributes from some variable declarations.
...
Recent versions of gcc (4.4+) no longer give false positive warnings.
13 years ago