Commit ae1de742 authored by aurel's avatar aurel

matroskadec: ensure that overlapping subtitle are not added to the index


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15283 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a485a72b
...@@ -139,6 +139,7 @@ typedef struct { ...@@ -139,6 +139,7 @@ typedef struct {
EbmlList encodings; EbmlList encodings;
AVStream *stream; AVStream *stream;
int64_t end_timecode;
} MatroskaTrack; } MatroskaTrack;
typedef struct { typedef struct {
...@@ -1462,8 +1463,12 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, ...@@ -1462,8 +1463,12 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
if (cluster_time != (uint64_t)-1 if (cluster_time != (uint64_t)-1
&& (block_time >= 0 || cluster_time >= -block_time)) { && (block_time >= 0 || cluster_time >= -block_time)) {
timecode = cluster_time + block_time; timecode = cluster_time + block_time;
if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE
&& timecode < track->end_timecode)
is_keyframe = 0; /* overlapping subtitles are not key frame */
if (is_keyframe) if (is_keyframe)
av_add_index_entry(st, cluster_pos, timecode, 0,0,AVINDEX_KEYFRAME); av_add_index_entry(st, cluster_pos, timecode, 0,0,AVINDEX_KEYFRAME);
track->end_timecode = FFMAX(track->end_timecode, timecode+duration);
} }
if (matroska->skip_to_keyframe) { if (matroska->skip_to_keyframe) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment