add lv2 plugin interface
[goodguy/history.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-4.0.patch3
1 diff -urN a/libavformat/avformat.h b/libavformat/avformat.h
2 --- a/libavformat/avformat.h    2018-04-20 04:02:57.000000000 -0600
3 +++ b/libavformat/avformat.h    2018-04-24 11:02:20.777232001 -0600
4 @@ -487,6 +487,9 @@
5                                          The user or muxer can override this through
6                                          AVFormatContext.avoid_negative_ts
7                                          */
8 +#define AVFMT_SEEK_NOSTREAMS  0x80000 /**< Stream index ignored by seek,
9 +                                           or some streams fail to seek
10 +                                           */
11  
12  #define AVFMT_SEEK_TO_PTS   0x4000000 /**< Seeking is based on PTS */
13  
14 @@ -647,7 +650,8 @@
15      /**
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
21       */
22      int flags;
23  
24 diff -urN a/libavformat/dv.c b/libavformat/dv.c
25 --- a/libavformat/dv.c  2018-04-13 17:34:28.000000000 -0600
26 +++ b/libavformat/dv.c  2018-04-24 11:02:20.778232001 -0600
27 @@ -632,6 +632,7 @@
28  AVInputFormat ff_dv_demuxer = {
29      .name           = "dv",
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 -urN a/libavformat/matroskadec.c b/libavformat/matroskadec.c
36 --- a/libavformat/matroskadec.c 2018-04-20 04:02:57.000000000 -0600
37 +++ b/libavformat/matroskadec.c 2018-04-24 11:02:20.779232001 -0600
38 @@ -4026,6 +4026,7 @@
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,
46 @@ -4039,6 +4040,7 @@
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 diff -urN a/libavformat/utils.c b/libavformat/utils.c
55 --- a/libavformat/utils.c       2018-04-20 04:02:58.000000000 -0600
56 +++ b/libavformat/utils.c       2018-04-24 11:02:20.780232001 -0600
57 @@ -2471,6 +2471,13 @@
58          return seek_frame_byte(s, stream_index, timestamp, flags);
59      }
60  
61 +    if (stream_index != -1 && (s->iformat->flags & AVFMT_SEEK_NOSTREAMS)) {
62 +            timestamp = av_rescale_q(timestamp,
63 +                    s->streams[stream_index]->time_base,
64 +                    AV_TIME_BASE_Q);
65 +            stream_index = -1;
66 +    }
67 +
68      if (stream_index < 0) {
69          stream_index = av_find_default_stream_index(s);
70          if (stream_index < 0)