Add skip_to_keyframe stream variable.

This replaces the matroskadec one with the same name.
The advantage is not only easier reuse in other demuxers
but also that we can make the decisions after the parser.
This fixes seeking in files that mark the keyframes incorrectly,
for example the file in track ticket #1003.
The matroska variable is still kept to be able to complain
about such broken files.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
Reimar Döffinger 2012-04-14 00:17:30 +02:00
parent 4fa706a4a6
commit 4a95876f4d
3 changed files with 20 additions and 2 deletions

View file

@ -1315,6 +1315,12 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
/* free packet */
av_free_packet(&cur_pkt);
}
if (pkt->flags & AV_PKT_FLAG_KEY)
st->skip_to_keyframe = 0;
if (st->skip_to_keyframe) {
av_free_packet(&cur_pkt);
got_packet = 0;
}
}
if (!got_packet && s->parse_queue)