Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg.git.patch3
1 --- a/libavformat/avformat.h
2 +++ b/libavformat/avformat.h
3 @@ -499,6 +499,9 @@
4                                          The user or muxer can override this through
5                                          AVFormatContext.avoid_negative_ts
6                                          */
7 +#define AVFMT_SEEK_NOSTREAMS  0x80000 /**< Stream index ignored by seek,
8 +                                           or some streams fail to seek
9 +                                           */
10  
11  #define AVFMT_SEEK_TO_PTS   0x4000000 /**< Seeking is based on PTS */
12  
13 @@ -562,7 +565,8 @@
14      /**
15       * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
16       * AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
17 -     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS.
18 +     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS,
19 +     * AVFMT_SEEK_NOSTREAMS
20       */
21      int flags;
22  
23 --- a/libavformat/dv.c
24 +++ b/libavformat/dv.c
25 @@ -713,6 +713,7 @@
26  const FFInputFormat ff_dv_demuxer = {
27      .p.name         = "dv",
28      .p.long_name    = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
29 +    .p.flags        = AVFMT_SEEK_NOSTREAMS,
30      .p.extensions   = "dv,dif",
31      .priv_data_size = sizeof(RawDVContext),
32      .read_probe     = dv_probe,
33
34 --- a/libavformat/matroskadec.c
35 +++ b/libavformat/matroskadec.c
36 @@ -4794,6 +4794,7 @@
37  const FFInputFormat ff_webm_dash_manifest_demuxer = {
38      .p.name         = "webm_dash_manifest",
39      .p.long_name    = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
40 +    .p.flags        = AVFMT_SEEK_NOSTREAMS,
41      .p.priv_class   = &webm_dash_class,
42      .priv_data_size = sizeof(MatroskaDemuxContext),
43      .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
44 @@ -4806,6 +4807,7 @@
45  const FFInputFormat ff_matroska_demuxer = {
46      .p.name         = "matroska,webm",
47      .p.long_name    = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
48 +    .p.flags        = AVFMT_SEEK_NOSTREAMS,
49      .p.extensions   = "mkv,mk3d,mka,mks,webm",
50      .p.mime_type    = "audio/webm,audio/x-matroska,video/webm,video/x-matroska",
51      .priv_data_size = sizeof(MatroskaDemuxContext),
52
53 --- a/libavformat/seek.c
54 +++ b/libavformat/seek.c
55 @@ -605,6 +605,13 @@
56          return seek_frame_byte(s, stream_index, timestamp, flags);
57      }
58  
59 +    if (stream_index != -1 && (s->iformat->flags & AVFMT_SEEK_NOSTREAMS)) {
60 +            timestamp = av_rescale_q(timestamp,
61 +                    s->streams[stream_index]->time_base,
62 +                    AV_TIME_BASE_Q);
63 +            stream_index = -1;
64 +    }
65 +
66      if (stream_index < 0) {
67          stream_index = av_find_default_stream_index(s);
68          if (stream_index < 0)