James Almer
313a6c65b7
oggdec: validate VP8 keyframes
...
Fixes seeking with broken files
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ben Boeckel
7eb84f2c3b
ogg: allow streams to update metadata
...
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
5e0c7eab2a
avformat/oggdec: dont read timestamps from EOS pages of ogm videos
...
Some muxers store invalid timestamps there, which breaks seeking
Fixes Ticket2739
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
James Almer
d890db5f53
oggdec: add support for VP8 demuxing
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
551a679795
avformat/oggdec: reset end_trimming when it has been used, so it cannot be used twice by mistake
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Dale Curtis
9c0dd7b462
avformat/oggdec: reset end_trimming in ogg_reset()
...
Fixes the output when seeking back to the start
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6838e1f547
avformat/oggdec: favor av_freep() over av_free()
...
Found-by: Reimar Döffinger
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Nicolas George
ecab1c7741
oggdec: add support for Opus in Ogg demuxing
11 years ago
Vignesh Venkatasubramanian
23637f98f4
lavf/ogg: Support for end trimming Opus
...
Adding support for end trimming Opus embedded in Ogg container.
Signed-Off By: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Alexandra Khirnova
f369b9356c
avformat: Use av_reallocp_array() where suitable
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Reimar Döffinger
9a27acae9e
ogg: Fix potential infinite discard loop
...
Seeking in certain broken files would cause ogg_read_timestamp
to fail because ogg_packet would go into a state where all packets
of stream 1 would be discarded until the end of the stream.
Bug-Id: 553
CC: libav-stable@libav.org
Signed-off-by: Jan Gerber <j@v2v.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
13 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>
13 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>
13 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