mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-01 20:42:19 +00:00
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>
This commit is contained in:
parent
863f4c3c71
commit
5e0c7eab2a
@ -808,6 +808,11 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
|
|||||||
&& !ogg_packet(s, &i, &pstart, &psize, pos_arg)) {
|
&& !ogg_packet(s, &i, &pstart, &psize, pos_arg)) {
|
||||||
if (i == stream_index) {
|
if (i == stream_index) {
|
||||||
struct ogg_stream *os = ogg->streams + stream_index;
|
struct ogg_stream *os = ogg->streams + stream_index;
|
||||||
|
// Dont trust the last timestamps of a ogm video
|
||||||
|
if ( (os->flags & OGG_FLAG_EOS)
|
||||||
|
&& !(os->flags & OGG_FLAG_BOS)
|
||||||
|
&& os->codec == &ff_ogm_video_codec)
|
||||||
|
continue;
|
||||||
pts = ogg_calc_pts(s, i, NULL);
|
pts = ogg_calc_pts(s, i, NULL);
|
||||||
ogg_validate_keyframe(s, i, pstart, psize);
|
ogg_validate_keyframe(s, i, pstart, psize);
|
||||||
if (os->pflags & AV_PKT_FLAG_KEY) {
|
if (os->pflags & AV_PKT_FLAG_KEY) {
|
||||||
|
Loading…
Reference in New Issue
Block a user