1 diff -ur a/libavformat/avformat.h b/libavformat/avformat.h
2 --- a/libavformat/avformat.h 2017-10-13 16:31:25.000000000 -0600
3 +++ b/libavformat/avformat.h 2017-10-13 20:07:24.178440418 -0600
5 The user or muxer can override this through
6 AVFormatContext.avoid_negative_ts
8 +#define AVFMT_SEEK_NOSTREAMS 0x80000 /**< Stream index ignored by seek,
9 + or some streams fail to seek
12 #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */
16 * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
17 * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
18 - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS.
19 + * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS,
20 + * AVFMT_SEEK_NOSTREAMS
24 diff -ur a/libavformat/dv.c b/libavformat/dv.c
25 --- a/libavformat/dv.c 2017-10-13 16:31:25.000000000 -0600
26 +++ b/libavformat/dv.c 2017-10-13 20:07:24.178440418 -0600
28 AVInputFormat ff_dv_demuxer = {
30 .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
31 + .flags = AVFMT_SEEK_NOSTREAMS,
32 .priv_data_size = sizeof(RawDVContext),
33 .read_probe = dv_probe,
34 .read_header = dv_read_header,
35 diff -ur a/libavformat/matroskadec.c b/libavformat/matroskadec.c
36 --- a/libavformat/matroskadec.c 2017-10-13 16:31:25.000000000 -0600
37 +++ b/libavformat/matroskadec.c 2017-10-13 20:07:24.180440304 -0600
39 AVInputFormat ff_matroska_demuxer = {
40 .name = "matroska,webm",
41 .long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
42 + .flags = AVFMT_SEEK_NOSTREAMS,
43 .extensions = "mkv,mk3d,mka,mks",
44 .priv_data_size = sizeof(MatroskaDemuxContext),
45 .read_probe = matroska_probe,
47 AVInputFormat ff_webm_dash_manifest_demuxer = {
48 .name = "webm_dash_manifest",
49 .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
50 + .flags = AVFMT_SEEK_NOSTREAMS,
51 .priv_data_size = sizeof(MatroskaDemuxContext),
52 .read_header = webm_dash_manifest_read_header,
53 .read_packet = webm_dash_manifest_read_packet,
54 Only in b/libavformat: matroskadec.c.orig
55 diff -ur a/libavformat/utils.c b/libavformat/utils.c
56 --- a/libavformat/utils.c 2017-10-13 16:31:25.000000000 -0600
57 +++ b/libavformat/utils.c 2017-10-13 20:07:24.182440190 -0600
58 @@ -2415,6 +2415,13 @@
59 return seek_frame_byte(s, stream_index, timestamp, flags);
62 + if (stream_index != -1 && (s->iformat->flags & AVFMT_SEEK_NOSTREAMS)) {
63 + timestamp = av_rescale_q(timestamp,
64 + s->streams[stream_index]->time_base,
69 if (stream_index < 0) {
70 stream_index = av_find_default_stream_index(s);
72 Only in b/libavformat: utils.c.orig