Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-04-14 02:17:30 +0400
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-04-17 00:13:11 +0400
commit4a95876f4df29f69dca45da4013b276cb2dd4cc6 (patch)
tree378a690ccdba3bc8c6ec03c16e44aeeff09bc032 /libavformat/utils.c
parent4fa706a4a64f9e06b08c1a42a62893ff2f7de82f (diff)
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>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3c3ced75a0..0636742b4e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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)