Anton Khirnov
8ad3267ce3
oggdec: do not fall back on binary search in the generic code.
...
Binary search is already attempted in the format-specific seek function,
so the fallback is only reached if binary search failed already.
12 years ago
Luca Barbato
f963f701d9
ogg: relax demuxer conformance checks
...
Some samples in the wild are missing headers that are expected by the
specification but in practice do not affect decoding.
12 years ago
Michael Niedermayer
e278500181
oggdec: Support byte based seeking
...
Fixed Ticket2317
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
a9b424879f
lavc & lavf: replace deprecated av_log* functions
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
5d2f2c7643
oggdec: chained oggs have timestamp discontinuities
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ed37a566c9
oggdec: remove unused variables
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c74d4658dc
oggdec: #if 0 disabled code
...
Fixes CID968589
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
7cb27d216d
oggdec: Support chained streams, support replacing streams in multistream files.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Conflicts:
Changelog
12 years ago
Michael Niedermayer
c994bb2fb7
oggdec: Leave treatment of serial changes to the decoder.
...
Attempting to re-parse the headers at demuxer level is a
pandora box the way its done currently.
This allows full reconfiguration of vorbis streams
Fixes Ticket2117
Fixes Ticket2121
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c5cf58d4b9
oggdec: resync from the last page.
...
Previously we re synced from where we where which cam lead
to loosing pages.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
d894f74762
oggdec: make sure the private parse data is cleaned up
12 years ago
Luca Barbato
89b51b570d
oggdec: free the ogg streams on read_header failure
...
Plug an annoying memory leak on broken files.
12 years ago
Michael Niedermayer
ec40d15d82
oggdec: fix warning: assignment discards qualifiers from pointer target type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
ba064ebe48
oggdec: check memory allocation
12 years ago
Luca Barbato
f5f1cf5224
oggdec: K&R cosmetic formatting
12 years ago
Michael Niedermayer
9db3fb6ed8
oggdec: prevent codec from changing through ogg_replace_stream()
...
This prevents inconsistencies leading to out of array accesses.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
07a866282f
oggdec: fix memleak on header parsing failure
...
Fixes Ticket1931
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
248b1ff26b
Fix various uses of av_log_missing_feature()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
4c273eb64c
oggdec: print a warning if the number of headers mismatch expectations.
...
This is based on:
commit 7751e4693d
Author: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
cc4deafed1
oggdec: print error when headers couldnt be parses successfully
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
d1f05dd183
ogg: calculate the start position once all the headers are parsed
...
The fisbone packets can be muxed in any order as long the last one
comes before the first data packet.
12 years ago
Luca Barbato
7751e4693d
ogg: check that the expected number of headers had been parsed
...
Not having the header for a codec is a tell-tale of a broken file.
12 years ago
Clément Bœsch
ea5bd7ea6f
lavf/oggdec: check for begin-of-stream flag in case of chained streams.
...
Fix Ticket #1617 , revealing a regression I introduced in 8f3eebd
.
We need to make sure no stream is added in between Ogg context save and
restore operations (because it would likely lead to a mismatch between
ogg->nstreams and AVFormatContext->nb_streams after the restore op).
This is the reason the ogg->state check is added in ogg_new_stream().
Before this patch, checking for ogg->headers was preventing this:
ogg->headers is always set before any ogg save/restore (though, it was
also preventing from creating the stream when necessary).
12 years ago
Clément Bœsch
094991eb69
lavf/oggdec: reword stream creation error message.
12 years ago
Clément Bœsch
23f6420026
lavf/oggdec: reindent and comment blocks.
12 years ago
Clément Bœsch
a218c5ebd2
lavf/oggdec: make stream replacement less convoluted.
...
Also re-use the allocated buffer instead of re-allocating a new one.
12 years ago
Clément Bœsch
e18ea76523
lavf/oggdec: more explicit zeroing of the new ogg stream.
12 years ago
Clément Bœsch
3a89553347
lavf/oggdec: rework allocations in ogg_new_streams().
12 years ago
Clément Bœsch
edca80387c
lavf/oggdec: simplify destroying streams with chained audio streams.
...
nstreams is assumed to be 1 at that point, so the loop is pointless.
12 years ago
Clément Bœsch
277ddf127d
lavf/oggdec: rename str to sid.
...
"str" is misleading here (it's often used for string). "sid" makes more
sense to identify a stream id.
12 years ago
Clément Bœsch
e1ca1dd71b
lavf/oggdec: remove a comment not matching anything.
12 years ago
Clément Bœsch
bf8bfc6a11
lavf/oggdec: inline ogg_get_headers().
...
There is no point in a distant definition of a small function like this
used only once.
Additional spacing to distinguish better the block.
12 years ago
Reimar Döffinger
69aeba1396
oggdec: Initialize stream index to -1 in ogg_packet.
...
The previous method of having to initialize it outside lead
to incorrect code: even if it was initialized, it usually was
only initialized once, thus a packet that could not be matched
to any stream would just be processed with the return values
from the previous call.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Reimar Döffinger
a4163b2d65
oggdec: simplify start time calculation code.
...
Also slightly more correct behaviour in case streams_left for
some reason is 0 from the start.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Michael Niedermayer
9e1c55cfde
oggdec: check stream index before using it in ogg_get_length()
...
Fixes crash based on a uninitialized array index read.
If the read does not crash then out of array writes based
on the same index might have been triggered afterwards.
Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
e62fd6619f
oggdec: add support for Opus codec.
...
This patch also introduces CODEC_ID_OPUS.
13 years ago
Michael Niedermayer
e0eaf10049
oggdec: fix regression that caused reading the whole file during open
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
8443082db6
ogg: rewrite first timestamp reading code.
...
this is simpler and closer to how timestamps are found for seeking.
Fixes Ticket1186
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
5931c754b8
ogg: in ogg_get_length() start from data_offset not 0.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
ef32fbafcd
oggdec: fix off by one error on pos_limit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
a6bb09fc1a
oggdec: print error on failure to create streams
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
251ce23165
oggdec: print error on changing streams when its unsupported.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6fd478062c
oggdec: print error on unsupported versions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
96fb233e64
oggdec: reset lastpts so that justins vorbis duration correction is not skiped
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
5f9f78dc9b
oggdec: pass avformat context to ogg_reset()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c7c976c6d7
oggdec: Safety check against stream counts being inconsistent in seek()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9bb3b7d028
oggdec: Recreate streams only in the 1 stream case.
...
Other cases are not supported and lead to inconsistencies which
can lead to out of array writes.
Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Dale Curtis
ef0d779706
Fix uninitialized reads on malformed ogg files.
...
The ogg decoder wasn't padding the input buffer with the appropriate
FF_INPUT_BUFFER_PADDING_SIZE bytes. Which led to uninitialized reads in
various pieces of parsing code when they thought they had more data than
they actually did.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
13 years ago
Reimar Döffinger
030e96fe55
oggdec: improve warning message.
...
Print whether it was a keyframe or a non-keyframe that
was incorrectly marked as the other.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Reimar Döffinger
787528b4a6
Detect theora keyframes by content in Ogg demuxer.
...
A lot of files do not mark keyframes correctly via
granule, so detect keyframe or not based on data
and complain if it mismatches.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago