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
12 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.
13 years ago
Mans Rullgard
ea98507db0
flacdec: simplify loop in decode_residuals()
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Michael Niedermayer
4d38b838f0
flacdec: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 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
Justin Ruggles
0eea212943
Add avcodec_decode_audio4().
...
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
13 years ago
Justin Ruggles
5bd0343bee
flacdec: use av_get_bytes_per_sample() to get sample size
13 years ago
Anton Khirnov
d9cca9fc6a
lavc: use avpriv_ prefix for some flac symbols used in lavf.
...
Specifically, ff_flac_parse_streaminfo, ff_flac_is_extradata_valid and
ff_flac_parse_block_header
13 years ago
Justin Ruggles
4c5e7b27d5
flacdec: fix buffer size checking in get_metadata_size()
...
Adds an additional check before reading the next block header and avoids a
potential integer overflow when checking the metadata size against the
remaining buffer size.
13 years ago
Anton Khirnov
ec6402b7c5
lavc: use designated initialisers for all codecs.
...
It's more readable and less prone to breakage.
14 years ago