Merge commit 'a16431034d9bd44182bf844d6bbde2c98bc4e6b5'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 19:14:56 +0000 (21:14 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 19:14:56 +0000 (21:14 +0200)
* commit 'a16431034d9bd44182bf844d6bbde2c98bc4e6b5':
  hls: Factor the sequence computation

Conflicts:
libavformat/hlsenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/hlsenc.c

@@@ -133,6 -132,7 +133,7 @@@ static int hls_window(AVFormatContext *
      ListEntry *en;
      int target_duration = 0;
      int ret = 0;
 -    int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->size);
++    int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries);
  
      if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
                            &s->interrupt_callback, NULL)) < 0)
      avio_printf(hls->pb, "#EXTM3U\n");
      avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
      avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
-     avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
-                 FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries));
+     avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
  
      av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
-            FFMAX(hls->start_sequence, hls->sequence - hls->size));
+            sequence);
  
      for (en = hls->list; en; en = en->next) {
 -        avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration);
 +        avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration);
          if (hls->baseurl)
              avio_printf(hls->pb, "%s", hls->baseurl);
          avio_printf(hls->pb, "%s\n", en->name);