updated ffmpeg to 3.3, 11 3rd party libs, svg tmpl file
[goodguy/history.git] / cinelerra-5.1 / thirdparty / src / ffmpeg.patch4
index 0793e47afda329dd9f8c124e0555e6dd22498724..66edd3db49ffd6a5972e0987c966539ff2cac499 100644 (file)
@@ -1,6 +1,7 @@
---- a/libavformat/mpegtsenc.c  2017-02-02 10:53:52.235702393 -0700
-+++ b/libavformat/mpegtsenc.c  2017-02-02 11:53:38.863560974 -0700
-@@ -55,9 +55,8 @@
+diff -urN a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
+--- a/libavformat/mpegtsenc.c  2017-04-12 19:55:55.000000000 -0600
++++ b/libavformat/mpegtsenc.c  2017-04-16 16:40:18.488361991 -0600
+@@ -56,9 +56,8 @@
      int sid;           /* service ID */
      char *name;
      char *provider_name;
@@ -12,7 +13,7 @@
      AVProgram *program;
  } MpegTSService;
  
-@@ -77,14 +76,12 @@
+@@ -78,14 +77,12 @@
      MpegTSSection pat; /* MPEG-2 PAT table */
      MpegTSSection sdt; /* MPEG-2 SDT table context */
      MpegTSService **services;
@@ -30,7 +31,7 @@
      int mux_rate; ///< set to 1 when VBR
      int pes_payload_size;
  
-@@ -94,12 +91,14 @@
+@@ -95,12 +92,14 @@
      int service_type;
  
      int pmt_start_pid;
@@ -46,7 +47,7 @@
  #define MPEGTS_FLAG_REEMIT_PAT_PMT  0x01
  #define MPEGTS_FLAG_AAC_LATM        0x02
  #define MPEGTS_FLAG_PAT_PMT_AT_FRAMES           0x04
-@@ -109,8 +108,6 @@
+@@ -111,8 +110,6 @@
      int tables_version;
      double pat_period;
      double sdt_period;
@@ -55,7 +56,7 @@
  
      int omit_video_pes_length;
  } MpegTSWrite;
-@@ -214,10 +211,10 @@
+@@ -222,10 +219,10 @@
  #define DEFAULT_PROVIDER_NAME   "FFmpeg"
  #define DEFAULT_SERVICE_NAME    "Service01"
  
@@ -68,7 +69,7 @@
  
  typedef struct MpegTSWriteStream {
      struct MpegTSService *service;
-@@ -704,6 +701,7 @@
+@@ -717,6 +714,7 @@
      service->pmt.pid       = ts->pmt_start_pid + ts->nb_services;
      service->sid           = sid;
      service->pcr_pid       = 0x1fff;
@@ -76,7 +77,7 @@
      service->provider_name = av_strdup(provider_name);
      service->name          = av_strdup(name);
      if (!service->provider_name || !service->name)
-@@ -719,18 +717,11 @@
+@@ -732,18 +730,11 @@
      return NULL;
  }
  
@@ -96,7 +97,7 @@
          tp_extra_header = AV_RB32(&tp_extra_header);
          avio_write(s->pb, (unsigned char *) &tp_extra_header,
                     sizeof(tp_extra_header));
-@@ -751,6 +742,7 @@
+@@ -764,6 +755,7 @@
      MpegTSService *service;
      AVStream *st, *pcr_st = NULL;
      AVDictionaryEntry *title, *provider;
      int i, j;
      const char *service_name;
      const char *provider_name;
-@@ -759,6 +751,15 @@
+@@ -772,6 +764,15 @@
  
      if (s->max_delay < 0) /* Not set by the caller */
          s->max_delay = 0;
  
      // round up to a whole number of TS packets
      ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14;
-@@ -803,6 +804,8 @@
+@@ -818,6 +819,8 @@
              service->program          = program;
          }
      }
  
      ts->pat.pid          = PAT_PID;
      /* Initialize at 15 so that it wraps and is equal to 0 for the
-@@ -885,10 +888,9 @@
-         ts_st->cc              = 15;
+@@ -903,10 +906,9 @@
+         ts_st->discontinuity   = ts->flags & MPEGTS_FLAG_DISCONT;
          /* update PCR pid by using the first video stream */
          if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
 -            service->pcr_pid == 0x1fff) {
          if (st->codecpar->codec_id == AV_CODEC_ID_AAC &&
              st->codecpar->extradata_size > 0) {
              AVStream *ast;
-@@ -924,78 +926,47 @@
+@@ -942,78 +944,47 @@
      av_freep(&pids);
  
      /* if no video stream, use the first stream as PCR */
  
      return 0;
  
-@@ -1010,22 +981,12 @@
+@@ -1028,22 +999,12 @@
      MpegTSWrite *ts = s->priv_data;
      int i;
  
          mpegts_write_pat(s);
          for (i = 0; i < ts->nb_services; i++)
              mpegts_write_pmt(s, ts->services[i]);
-@@ -1067,20 +1028,21 @@
+@@ -1085,13 +1046,14 @@
  {
      MpegTSWrite *ts = s->priv_data;
      MpegTSWriteStream *ts_st = st->priv_data;
      *q++ = 0x20 | ts_st->cc;   /* Adaptation only */
      /* Continuity Count field does not increment (see 13818-1 section 2.4.3.3) */
      *q++ = TS_PACKET_SIZE - 5; /* Adaptation Field Length */
-     *q++ = 0x10;               /* Adaptation flags: PCR present */
+@@ -1102,7 +1064,7 @@
+     }
  
      /* PCR coded into 6 bytes */
 -    q += write_pcr_bits(q, get_pcr(ts, s->pb));
  
      /* stuffing bytes */
      memset(q, 0xFF, TS_PACKET_SIZE - (q - buf));
-@@ -1149,8 +1111,6 @@
+@@ -1171,8 +1133,6 @@
      uint8_t *q;
      int val, is_start, len, header_len, write_pcr, is_dvb_subtitle, is_dvb_teletext, flags;
      int afc_len, stuffing_len;
      int force_pat = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && key && !ts_st->prev_payload_key;
  
      av_assert0(ts_st->payload != buf || st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO);
-@@ -1160,28 +1120,33 @@
+@@ -1182,28 +1142,33 @@
  
      is_start = 1;
      while (payload_size > 0) {
              continue;
          }
  
-@@ -1191,13 +1156,17 @@
+@@ -1213,6 +1178,10 @@
          val  = ts_st->pid >> 8;
          if (is_start)
              val |= 0x40;
          *q++      = val;
          *q++      = ts_st->pid;
          ts_st->cc = ts_st->cc + 1 & 0xf;
-         *q++      = 0x10 | ts_st->cc; // payload indicator + CC
+@@ -1224,7 +1193,7 @@
+         }
          if (key && is_start && pts != AV_NOPTS_VALUE) {
              // set Random Access for key frames
 -            if (ts_st->pid == ts_st->service->pcr_pid)
                  write_pcr = 1;
              set_af_flag(buf, 0x40);
              q = get_ts_payload_start(buf);
-@@ -1205,14 +1174,10 @@
+@@ -1232,14 +1201,10 @@
          if (write_pcr) {
              set_af_flag(buf, 0x10);
              q = get_ts_payload_start(buf);
              q = get_ts_payload_start(buf);
          }
          if (is_start) {
-@@ -1310,11 +1275,13 @@
+@@ -1340,11 +1305,13 @@
              *q++ = flags;
              *q++ = header_len;
              if (pts != AV_NOPTS_VALUE) {
                  q += 5;
              }
              if (pes_extension && st->codecpar->codec_id == AV_CODEC_ID_DIRAC) {
-@@ -1483,7 +1450,6 @@
+@@ -1515,7 +1482,6 @@
      uint8_t *data = NULL;
      MpegTSWrite *ts = s->priv_data;
      MpegTSWriteStream *ts_st = st->priv_data;
      int64_t dts = pkt->dts, pts = pkt->pts;
      int opus_samples = 0;
      int side_data_size;
-@@ -1504,16 +1470,15 @@
+@@ -1536,16 +1502,15 @@
      }
  
      if (ts->flags & MPEGTS_FLAG_REEMIT_PAT_PMT) {
      }
  
      if (ts_st->first_pts_check && pts == AV_NOPTS_VALUE) {
-@@ -1671,7 +1636,7 @@
+@@ -1733,7 +1698,7 @@
              AVStream *st2 = s->streams[i];
              MpegTSWriteStream *ts_st2 = st2->priv_data;
              if (   ts_st2->payload_size
                  mpegts_write_pes(s, st2, ts_st2->payload, ts_st2->payload_size,
                                   ts_st2->payload_pts, ts_st2->payload_dts,
                                   ts_st2->payload_flags & AV_PKT_FLAG_KEY, stream_id);
-@@ -1838,12 +1803,18 @@
+@@ -1904,12 +1869,18 @@
      { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
        offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT,
        { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
 +      { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
      { "mpegts_start_pid", "Set the first pid.",
        offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
-       { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
+       { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
      { "mpegts_m2ts_mode", "Enable m2ts mode.",
        offsetof(MpegTSWrite, m2ts_mode), AV_OPT_TYPE_BOOL,
 -      { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM },
      { "muxrate", NULL,
        offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT,
        { .i64 = 1 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
-@@ -1878,15 +1849,15 @@
+@@ -1947,15 +1918,15 @@
      { "omit_video_pes_length", "Omit the PES packet length for video packets",
        offsetof(MpegTSWrite, omit_video_pes_length), AV_OPT_TYPE_BOOL,
        { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
--    { "pcr_period", "PCR retransmission time",
+-    { "pcr_period", "PCR retransmission time in milliseconds",
 -      offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_INT,
 -      { .i64 = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
 -    { "pat_period", "PAT/PMT retransmission time limit in seconds",