alternative shortcuts; cd cinelerra-5.1; patch -p1 -i alt_shortcuts.patch
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-5.1.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 @@ -670,7 +673,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 @@ -640,6 +640,7 @@
26  const AVInputFormat ff_dv_demuxer = {
27      .name           = "dv",
28      .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
29 +    .flags          = AVFMT_SEEK_NOSTREAMS,
30      .priv_data_size = sizeof(RawDVContext),
31      .read_probe     = dv_probe,
32      .read_header    = dv_read_header,
33 --- a/libavformat/matroskadec.c
34 +++ b/libavformat/matroskadec.c
35 @@ -4427,6 +4427,7 @@
36  const AVInputFormat ff_webm_dash_manifest_demuxer = {
37      .name           = "webm_dash_manifest",
38      .long_name      = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
39 +    .flags          = AVFMT_SEEK_NOSTREAMS,
40      .priv_class     = &webm_dash_class,
41      .priv_data_size = sizeof(MatroskaDemuxContext),
42      .flags_internal = FF_FMT_INIT_CLEANUP,
43 @@ -4439,6 +4440,7 @@
44  const AVInputFormat ff_matroska_demuxer = {
45      .name           = "matroska,webm",
46      .long_name      = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
47 +    .flags          = AVFMT_SEEK_NOSTREAMS,
48      .extensions     = "mkv,mk3d,mka,mks,webm",
49      .priv_data_size = sizeof(MatroskaDemuxContext),
50      .flags_internal = FF_FMT_INIT_CLEANUP,
51 --- a/libavformat/seek.c
52 +++ b/libavformat/seek.c
53 @@ -600,6 +600,13 @@
54          return seek_frame_byte(s, stream_index, timestamp, flags);
55      }
56  
57 +    if (stream_index != -1 && (s->iformat->flags & AVFMT_SEEK_NOSTREAMS)) {
58 +            timestamp = av_rescale_q(timestamp,
59 +                    s->streams[stream_index]->time_base,
60 +                    AV_TIME_BASE_Q);
61 +            stream_index = -1;
62 +    }
63 +
64      if (stream_index < 0) {
65          stream_index = av_find_default_stream_index(s);
66          if (stream_index < 0)