[FFmpeg-devel] [PATCH] matroskadec: partly revert "demux relevant subtitle packets after a seek" c16582579b1c6f66a86615c5808cd5b2bf17be73
wm4
nfxjfg at googlemail.com
Wed Nov 30 11:34:54 EET 2016
On Sat, 26 Nov 2016 08:27:44 +0100
Rainer Hochecker <fernetmenta at kodi.tv> wrote:
> From: Rainer Hochecker <fernetmenta at online.de>
>
>
> Alternative patch. Revert the original code because it does more harm than any good.
>
>
> Signed-off-by: Rainer Hochecker <fernetmenta at online.de>
> ---
> libavformat/matroskadec.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index f79511e..cf3de96 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -3398,18 +3398,6 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
> tracks[i].audio.sub_packet_cnt = 0;
> tracks[i].audio.buf_timecode = AV_NOPTS_VALUE;
> tracks[i].end_timecode = 0;
> - if (tracks[i].type == MATROSKA_TRACK_TYPE_SUBTITLE &&
> - tracks[i].stream &&
> - tracks[i].stream->discard != AVDISCARD_ALL) {
> - index_sub = av_index_search_timestamp(
> - tracks[i].stream, st->index_entries[index].timestamp,
> - AVSEEK_FLAG_BACKWARD);
> - while (index_sub >= 0 &&
> - index_min > 0 &&
> - tracks[i].stream->index_entries[index_sub].pos < st->index_entries[index_min].pos &&
> - st->index_entries[index].timestamp - tracks[i].stream->index_entries[index_sub].timestamp < 30000000000 / matroska->time_scale)
> - index_min--;
> - }
> }
>
> avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
I can push this if you're ok with it.
I think "someone" should add support for fetching overlapping subtitles
via cue indexes too. (Although it looks like AVIndexEntry makes this
annoying, so it won't be me.)
More information about the ffmpeg-devel
mailing list