1 /*
2 * Apple HTTP Live Streaming demuxer
3 * Copyright (c) 2010 Martin Storsjo
4 * Copyright (c) 2013 Anssi Hannula
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * Apple HTTP Live Streaming demuxer
26 * http://tools.ietf.org/html/draft-pantos-http-live-streaming
27 */
28
41
42 #define INITIAL_BUFFER_SIZE 32768
43
44 #define MAX_FIELD_LEN 64
45 #define MAX_CHARACTERISTICS_LEN 512
46
47 #define MPEG_TIME_BASE 90000
48 #define MPEG_TIME_BASE_Q (AVRational){1, MPEG_TIME_BASE}
49
50 /*
51 * An apple http stream consists of a playlist with media segment files,
52 * played sequentially. There may be several playlists with the same
53 * video content, in different bandwidth variants, that are played in
54 * parallel (preferably only one bandwidth variant at a time). In this case,
55 * the user supplied the url to a main playlist that only lists the variant
56 * playlists.
57 *
58 * If the main playlist doesn't point at any variants, we still create
59 * one anonymous toplevel variant for this, to maintain the structure.
60 */
61
65 };
66
75 };
76
78
83 };
84
85 /*
86 * Each playlist has its own demuxer. If it currently is active,
87 * it has an open AVIOContext too, and potentially an AVPacket
88 * containing the next packet from this stream.
89 */
100
111
114
115 /* ID3 timestamp handling (elementary audio streams have ID3 timestamps
116 * (and possibly other ID3 tags) in the beginning of each segment) */
126
130
131 /* Renditions associated with this playlist, if any.
132 * Alternative rendition playlists have a single rendition associated
133 * with them, and variant main Media Playlists may have
134 * multiple (playlist-less) renditions associated with them. */
137 };
138
139 /*
140 * Renditions are e.g. alternative subtitle or audio streams.
141 * The rendition may either be an external playlist or it may be
142 * contained in the main Media Playlist of the variant (in which case
143 * playlist is NULL).
144 */
152 };
153
156
157 /* every variant contains at least the main Media Playlist in index 0 */
160
164 };
165
173
179 char *
user_agent;
///< holds HTTP user agent set as an AVOption to the HTTP protocol context
180 char *
cookies;
///< holds HTTP cookie values set in either the initial response or as an AVOption to the HTTP protocol context
181 char *
headers;
///< holds HTTP headers set as an AVOption to the HTTP protocol context
183
185 {
190 }
191
193 {
194 int i;
199 }
202 }
203
205 {
206 int i;
221 }
223 }
228 }
229
231 {
232 int i;
237 }
240 }
241
243 {
244 int i;
249 }
250
251 /*
252 * Used to reset a statically allocated AVPacket to a clean slate,
253 * containing no data.
254 */
256 {
259 }
260
262 const char *base)
263 {
265 if (!pls)
266 return NULL;
270
273
275 return pls;
276 }
277
280 /* variant group ids: */
284 };
285
287 const char *
url,
const char *base)
288 {
291
293 if (!pls)
294 return NULL;
295
297 if (!var)
298 return NULL;
299
300 if (info) {
305 }
306
309 return var;
310 }
311
313 int key_len, char **dest, int *dest_len)
314 {
315 if (!strncmp(key, "BANDWIDTH=", key_len)) {
318 } else if (!strncmp(key, "AUDIO=", key_len)) {
320 *dest_len =
sizeof(info->
audio);
321 } else if (!strncmp(key, "VIDEO=", key_len)) {
323 *dest_len =
sizeof(info->
video);
324 } else if (!strncmp(key, "SUBTITLES=", key_len)) {
327 }
328 }
329
334 };
335
337 int key_len, char **dest, int *dest_len)
338 {
339 if (!strncmp(key, "METHOD=", key_len)) {
341 *dest_len =
sizeof(info->
method);
342 } else if (!strncmp(key, "URI=", key_len)) {
344 *dest_len =
sizeof(info->
uri);
345 } else if (!strncmp(key, "IV=", key_len)) {
347 *dest_len =
sizeof(info->
iv);
348 }
349 }
350
361 };
362
364 const char *url_base)
365 {
368 char *characteristic;
369 char *chr_ptr;
370 char *saveptr;
371
372 if (!strcmp(info->
type,
"AUDIO"))
374 else if (!strcmp(info->
type,
"VIDEO"))
376 else if (!strcmp(info->
type,
"SUBTITLES"))
378 else if (!strcmp(info->
type,
"CLOSED-CAPTIONS"))
379 /* CLOSED-CAPTIONS is ignored since we do not support CEA-608 CC in
380 * AVC SEI RBSP anyway */
381 return NULL;
382
384 return NULL;
385
386 /* URI is mandatory for subtitles as per spec */
388 return NULL;
389
390 /* TODO: handle subtitles (each segment has to parsed separately) */
392 return NULL;
393
395 if (!rend)
396 return NULL;
397
399
404
405 /* add the playlist if this is an external rendition */
411 }
412
414 int langlen = strlen(rend->
language);
415 if (langlen <
sizeof(rend->
language) - 3) {
418 sizeof(rend->
language) - langlen - 2);
419 }
420 }
421
424 if (!strcmp(info->
forced,
"YES"))
426
428 while ((characteristic =
av_strtok(chr_ptr,
",", &saveptr))) {
429 if (!strcmp(characteristic, "public.accessibility.describes-music-and-sound"))
431 else if (!strcmp(characteristic, "public.accessibility.describes-video"))
433
434 chr_ptr = NULL;
435 }
436
437 return rend;
438 }
439
441 int key_len, char **dest, int *dest_len)
442 {
443 if (!strncmp(key, "TYPE=", key_len)) {
445 *dest_len =
sizeof(info->
type);
446 } else if (!strncmp(key, "URI=", key_len)) {
448 *dest_len =
sizeof(info->
uri);
449 } else if (!strncmp(key, "GROUP-ID=", key_len)) {
452 } else if (!strncmp(key, "LANGUAGE=", key_len)) {
455 } else if (!strncmp(key, "ASSOC-LANGUAGE=", key_len)) {
458 } else if (!strncmp(key, "NAME=", key_len)) {
460 *dest_len =
sizeof(info->
name);
461 } else if (!strncmp(key, "DEFAULT=", key_len)) {
464 } else if (!strncmp(key, "FORCED=", key_len)) {
466 *dest_len =
sizeof(info->
forced);
467 } else if (!strncmp(key, "CHARACTERISTICS=", key_len)) {
470 }
471 /*
472 * ignored:
473 * - AUTOSELECT: client may autoselect based on e.g. system language
474 * - INSTREAM-ID: EIA-608 closed caption number ("CC1".."CC4")
475 */
476 }
477
478 /* used by parse_playlist to allocate a new variant+playlist when the
479 * playlist is detected to be a Media Playlist (not Master Playlist)
480 * and we have no parent Master Playlist (parsing of which would have
481 * allocated the variant and playlist already) */
483 {
484 if (*pls)
485 return 0;
489 return 0;
490 }
491
492 /* pls = NULL => Master Playlist or parentless Media Playlist
493 * pls = !NULL => parented Media Playlist, playlist+variant allocated */
496 {
497 int ret = 0, is_segment = 0, is_variant = 0;
501 int has_iv = 0;
504 const char *ptr;
505 int close_in = 0;
506 int64_t seg_offset = 0;
507 int64_t seg_size = -1;
511
512 if (!in) {
514 close_in = 1;
515 /* Some HLS servers don't like being sent the range header */
517
518 // broker prior HTTP options that should be consistent across requests
522
526 if (ret < 0)
528 }
529
531 url = new_url;
532
534 if (strcmp(line, "#EXTM3U")) {
536 goto fail;
537 }
538
539 if (pls) {
543 }
546 if (
av_strstart(line,
"#EXT-X-STREAM-INF:", &ptr)) {
547 is_variant = 1;
548 memset(&variant_info, 0, sizeof(variant_info));
550 &variant_info);
551 }
else if (
av_strstart(line,
"#EXT-X-KEY:", &ptr)) {
554 &info);
556 has_iv = 0;
557 if (!strcmp(info.
method,
"AES-128"))
559 if (!strncmp(info.
iv,
"0x", 2) || !strncmp(info.
iv,
"0X", 2)) {
561 has_iv = 1;
562 }
564 }
else if (
av_strstart(line,
"#EXT-X-MEDIA:", &ptr)) {
567 &info);
569 }
else if (
av_strstart(line,
"#EXT-X-TARGETDURATION:", &ptr)) {
571 if (ret < 0)
572 goto fail;
574 }
else if (
av_strstart(line,
"#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
576 if (ret < 0)
577 goto fail;
579 }
else if (
av_strstart(line,
"#EXT-X-PLAYLIST-TYPE:", &ptr)) {
581 if (ret < 0)
582 goto fail;
583 if (!strcmp(ptr, "EVENT"))
585 else if (!strcmp(ptr, "VOD"))
587 }
else if (
av_strstart(line,
"#EXT-X-ENDLIST", &ptr)) {
588 if (pls)
591 is_segment = 1;
593 }
else if (
av_strstart(line,
"#EXT-X-BYTERANGE:", &ptr)) {
594 seg_size = atoi(ptr);
595 ptr = strchr(ptr, '@');
596 if (ptr)
597 seg_offset = atoi(ptr+1);
599 continue;
600 } else if (line[0]) {
601 if (is_variant) {
604 goto fail;
605 }
606 is_variant = 0;
607 }
608 if (is_segment) {
610 if (!pls) {
613 goto fail;
614 }
616 }
618 if (!seg) {
620 goto fail;
621 }
624 if (has_iv) {
625 memcpy(seg->
iv, iv,
sizeof(iv));
626 } else {
628 memset(seg->
iv, 0,
sizeof(seg->
iv));
630 }
631
638 goto fail;
639 }
640 } else {
642 }
643
650 goto fail;
651 }
652
654 is_segment = 0;
655
656 seg->
size = seg_size;
657 if (seg_size >= 0) {
659 seg_offset += seg_size;
660 seg_size = -1;
661 } else {
663 seg_offset = 0;
664 }
665 }
666 }
667 }
668 if (pls)
670
671 fail:
673 if (close_in)
676 }
677
681 };
682
683 /* read from URLContext, limiting read to current segment */
686 {
689
690 /* limit read if the segment was only a part of a file */
693
696 else
698
699 if (ret > 0)
701
703 }
704
705 /* Parse the raw ID3 data and pass contents to caller */
709 {
710 static const char id3_priv_owner_ts[] = "com.apple.streaming.transportStreamTimestamp";
712
714 for (meta = *extra_meta; meta; meta = meta->
next) {
715 if (!strcmp(meta->
tag,
"PRIV")) {
717 if (priv->
datasize == 8 && !strcmp(priv->
owner, id3_priv_owner_ts)) {
718 /* 33-bit MPEG timestamp */
721 if ((ts & ~((1ULL << 33) - 1)) == 0)
722 *dts = ts;
723 else
725 }
726 }
else if (!strcmp(meta->
tag,
"APIC") && apic)
728 }
729 }
730
731 /* Check if the ID3 metadata contents have changed */
734 {
737 /* check that no keys have changed values */
740 if (!oldentry || strcmp(oldentry->
value, entry->
value) != 0)
741 return 1;
742 }
743
744 /* check if apic appeared */
746 return 1;
747
748 if (apic) {
751 return 1;
752
754 return 1;
755 }
756
757 return 0;
758 }
759
760 /* Parse ID3 data and handle the found data */
762 {
767
768 parse_id3(pls->
ctx, pb, &metadata, ×tamp, &apic, &extra_meta);
769
773 }
774
776 /* initial ID3 tags */
779
780 /* get picture attachment and set text metadata */
783 else
784 /* demuxer not yet opened, defer picture attachment */
786
789
790 } else {
794 }
796 }
797
800 }
801
802 /* Intercept and handle ID3 tags between URLContext and AVIOContext */
804 int buf_size,
int *
len)
805 {
806 /* intercept id3 tags, we do not want to pass them to the raw
807 * demuxer on all segment switches */
808 int bytes;
809 int id3_buf_pos = 0;
811
812 /* gather all the id3 tags */
813 while (1) {
814 /* see if we can retrieve enough data for ID3 header */
817 if (bytes > 0) {
818
820 /* no EOF yet, so fill the caller buffer again after
821 * we have stripped the ID3 tags */
822 fill_buf = 1;
823
824 *len += bytes;
825
826 } else if (*len <= 0) {
827 /* error/EOF */
828 *len = bytes;
829 fill_buf = 0;
830 }
831 }
832
834 break;
835
838 int64_t maxsize = seg->
size >= 0 ? seg->
size : 1024*1024;
840 int tag_got_bytes =
FFMIN(taglen, *len);
841 int remaining = taglen - tag_got_bytes;
842
843 if (taglen > maxsize) {
845 taglen, maxsize);
846 break;
847 }
848
849 /*
850 * Copy the id3 tag to our temporary id3 buffer.
851 * We could read a small id3 tag directly without memcpy, but
852 * we would still need to copy the large tags, and handling
853 * both of those cases together with the possibility for multiple
854 * tags would make the handling a bit complex.
855 */
858 break;
859 memcpy(pls->
id3_buf + id3_buf_pos, buf, tag_got_bytes);
860 id3_buf_pos += tag_got_bytes;
861
862 /* strip the intercepted bytes */
863 *len -= tag_got_bytes;
864 memmove(buf, buf + tag_got_bytes, *len);
866
867 if (remaining > 0) {
868 /* read the rest of the tag in */
870 break;
871 id3_buf_pos += remaining;
873 }
874
875 } else {
876 /* no more ID3 tags */
877 break;
878 }
879 }
880
881 /* re-fill buffer for the caller unless EOF */
882 if (*len >= 0 && (fill_buf || *len == 0)) {
884
885 /* ignore error if we already had some data */
886 if (bytes >= 0)
887 *len += bytes;
888 else if (*len == 0)
889 *len = bytes;
890 }
891
893 /* Now parse all the ID3 tags */
897 }
898
901 }
902
904 {
909
910 // broker prior HTTP options that should be consistent across requests
915
916 // Same opts for key request (ffurl_open mutilates the opts so it cannot be used twice)
918
919 if (seg->
size >= 0) {
920 /* try to restrict the HTTP request to the part we want
921 * (if this is in fact a HTTP request) */
923 char end_offset[24] = { 0 };
924 snprintf(offset,
sizeof(offset) - 1,
"%"PRId64,
926 snprintf(end_offset,
sizeof(end_offset) - 1,
"%"PRId64,
930 }
931
934
938
946 !=
sizeof(pls->
key)) {
949 }
951 } else {
954 }
956 }
959 iv[32] = key[32] = '0円';
960 if (strstr(seg->
url,
"://"))
962 else
969
974 }
975 ret = 0;
976 }
977 else
979
980 /* Seek to the requested position. If this was a HTTP request, the offset
981 * should already be where want it to, but this allows e.g. local testing
982 * without a HTTP server. */
985 if (seekret < 0) {
987 ret = seekret;
990 }
991 }
992
998 }
999
1001 {
1005 }
1006
1008 {
1012 int just_opened = 0;
1013
1014 restart:
1017
1019 int64_t reload_interval;
1020
1021 /* Check that the playlist is still needed before opening a new
1022 * segment. */
1027 i++) {
1030 }
1031 }
1036 }
1037
1038 /* If this is a live stream and the reload interval has elapsed since
1039 * the last playlist reload, reload the playlists now. */
1041
1042 reload:
1049 }
1050 /* If we need to reload the playlist again below (if
1051 * there's still no more segments), switch to a reload
1052 * interval of half the target duration. */
1054 }
1057 "skipping %d segments ahead, expired from playlists\n",
1060 }
1068 }
1069 /* Enough time has elapsed since the last reload */
1070 goto reload;
1071 }
1072
1074 if (ret < 0) {
1078 }
1079 just_opened = 1;
1080 }
1081
1083 if (ret > 0) {
1085 /* Intercept ID3 tags here, elementary audio streams are required
1086 * to convey timestamps using them in the beginning of each segment. */
1088 }
1089
1091 }
1095
1097
1098 goto restart;
1099 }
1100
1102 {
1103 int variant_count = 0;
1104 int i, j;
1105
1106 for (i = 0; i < c->
n_variants && variant_count < 2; i++) {
1108
1111 variant_count++;
1112 break;
1113 }
1114 }
1115 }
1116
1117 return variant_count >= 2;
1118 }
1119
1122 {
1123 int i;
1124
1127
1128 if (rend->
type == type && !strcmp(rend->
group_id, group_id)) {
1129
1131 /* rendition is an external playlist
1132 * => add the playlist to the variant */
1134 else
1135 /* rendition is part of the variant main Media Playlist
1136 * => add the rendition to the main Media Playlist */
1139 rend);
1140 }
1141 }
1142 }
1143
1146 {
1147 int rend_idx = 0;
1148 int i;
1149
1152
1154 continue;
1155
1158
1159 if (rend->
type != type)
1160 continue;
1161
1166
1168 }
1170 break;
1171 }
1172 }
1173
1174 /* if timestamp was in valid range: returns 1 and sets seq_no
1175 * if not: returns 0 and sets seq_no to closest segment */
1177 int64_t timestamp, int *seq_no)
1178 {
1179 int i;
1182
1183 if (timestamp < pos) {
1185 return 0;
1186 }
1187
1190 if (diff > 0) {
1192 return 1;
1193 }
1195 }
1196
1198
1199 return 0;
1200 }
1201
1203 {
1204 int seq_no;
1205
1208 /* reload the playlist since it was suspended */
1210
1211 /* If playback is already in progress (we are just selecting a new
1212 * playlist) and this is a complete file, find the matching segment
1213 * by counting durations. */
1216 return seq_no;
1217 }
1218
1220 if (!c->
first_packet &&
/* we are doing a segment selection during playback */
1223 /* While spec 3.4.3 says that we cannot assume anything about the
1224 * content at the same sequence number on different playlists,
1225 * in practice this seems to work and doing it otherwise would
1226 * require us to download a segment to inspect its timestamps. */
1228
1229 /* If this is a live stream with more than 3 segments, start at the
1230 * third last segment. */
1233 }
1234
1235 /* Otherwise just start on the first segment. */
1237 }
1238
1240 {
1243 int ret = 0, i, j, stream_offset = 0;
1244
1246
1247 c->first_packet = 1;
1250
1251 // if the URL context is good, read important options we must broker later
1253 // get the previous user agent & set back to null if string size is zero
1256 if (
c->user_agent && !strlen(
c->user_agent))
1258
1259 // get the previous cookies & set back to null if string size is zero
1262 if (
c->cookies && !strlen(
c->cookies))
1264
1265 // get the previous headers & set back to null if string size is zero
1268 if (
c->headers && !strlen(
c->headers))
1270 }
1271
1273 goto fail;
1274
1275 if (
c->n_variants == 0) {
1278 goto fail;
1279 }
1280 /* If the playlist only contained playlists (Master Playlist),
1281 * parse each individual playlist. */
1282 if (
c->n_playlists > 1 ||
c->playlists[0]->n_segments == 0) {
1283 for (i = 0; i <
c->n_playlists; i++) {
1286 goto fail;
1287 }
1288 }
1289
1290 if (
c->variants[0]->playlists[0]->n_segments == 0) {
1293 goto fail;
1294 }
1295
1296 /* If this isn't a live stream, calculate the total duration of the
1297 * stream. */
1298 if (
c->variants[0]->playlists[0]->finished) {
1300 for (i = 0; i <
c->variants[0]->playlists[0]->n_segments; i++)
1301 duration +=
c->variants[0]->playlists[0]->segments[i]->duration;
1303 }
1304
1305 /* Associate renditions with variants */
1306 for (i = 0; i <
c->n_variants; i++) {
1307 struct variant *var =
c->variants[i];
1308
1315 }
1316
1317 /* Open the demuxer for each playlist */
1318 for (i = 0; i <
c->n_playlists; i++) {
1321
1323 continue;
1324
1327 goto fail;
1328 }
1329
1334
1340 NULL, 0, 0);
1342 /* Free the ctx - it isn't initialized properly at this point,
1343 * so avformat_close_input shouldn't be called. If
1344 * avformat_open_input fails below, it frees and zeros the
1345 * context, so it doesn't need any special treatment like this. */
1349 goto fail;
1350 }
1355 goto fail;
1356
1362 }
1363
1367 goto fail;
1368
1371
1372 /* Create new AVStreams for each stream in this playlist */
1376 if (!st) {
1378 goto fail;
1379 }
1381
1383
1386 else
1388 }
1389
1393
1395 }
1396
1397 /* Create a program for each variant */
1398 for (i = 0; i <
c->n_variants; i++) {
1400 char bitrate_str[20];
1402
1404
1406 if (!program)
1407 goto fail;
1409
1413 int k;
1414
1417
1419
1420 /* Set variant_bitrate for streams unique to this variant */
1423 }
1424 }
1425 }
1426
1427 return 0;
1428 fail:
1433 }
1434
1436 {
1438 int i, changed = 0;
1439
1440 /* Check if any new streams are needed */
1443
1449 }
1454 changed = 1;
1458 /* catch up */
1462 }
1469 changed = 1;
1471 }
1472 }
1473 return changed;
1474 }
1475
1477 {
1485 else
1487 } else {
1488 /* there have been packets with unknown duration
1489 * since the last id3 tag, should not normally happen */
1491 }
1492
1497
1499 }
1500
1502 {
1505
1507 }
1508
1510 int64_t ts_b,
struct playlist *pls_b)
1511 {
1514
1516 }
1517
1519 {
1521 int ret, i, minplaylist = -1;
1522
1524
1527 /* Make sure we've got one buffered packet from each open playlist
1528 * stream */
1530 while (1) {
1531 int64_t ts_diff;
1534 if (ret < 0) {
1538 break;
1539 } else {
1540 /* stream_index check prevents matching picture attachments etc. */
1542 /* audio elementary streams are id3 timestamped */
1544 }
1545
1550 }
1551
1553 break;
1554
1557
1560 break;
1561 }
1562
1570 break;
1571 }
1572 }
1575 }
1576 }
1577 /* Check if this stream has the packet with the lowest dts */
1579 struct playlist *minpls = minplaylist < 0 ?
1581 if (minplaylist < 0) {
1582 minplaylist = i;
1583 } else {
1584 int64_t dts = pls->
pkt.
dts;
1585 int64_t mindts = minpls->
pkt.
dts;
1586
1589 minplaylist = i;
1590 }
1591 }
1592 }
1593
1594 /* If we got a packet, return it */
1595 if (minplaylist >= 0) {
1600
1605
1606 return 0;
1607 }
1609 }
1610
1612 {
1614
1618 return 0;
1619 }
1620
1622 int64_t timestamp,
int flags)
1623 {
1626 int i, seq_no;
1628
1632
1635
1640
1643
1644 if (0 < duration && duration < seek_timestamp - first_timestamp)
1646
1647 /* find the playlist with the specified stream */
1652 seek_pls = pls;
1653 break;
1654 }
1655 }
1656 /* check if the timestamp is valid for the playlist with the
1657 * specified stream index */
1660
1661 /* set segment now so we do not need to search again below */
1664
1666 /* Reset reading */
1671 }
1675 /* Clear any buffered data */
1677 /* Reset the pos, to let the mpegts demuxer know we've seeked. */
1679 /* Flush the packet queue of the subdemuxer. */
1681
1684
1685 if (pls != seek_pls) {
1686 /* set closest segment seq_no for playlists not handled above */
1688 /* seek the playlist to the given position without taking
1689 * keyframes into account since this playlist does not have the
1690 * specified stream where we should look for the keyframes */
1693 }
1694 }
1695
1697
1698 return 0;
1699 }
1700
1702 {
1703 /* Require #EXTM3U at the start, and either one of the ones below
1704 * somewhere for a proper match. */
1705 if (strncmp(p->
buf,
"#EXTM3U", 7))
1706 return 0;
1707 if (strstr(p->
buf,
"#EXT-X-STREAM-INF:") ||
1708 strstr(p->
buf,
"#EXT-X-TARGETDURATION:") ||
1709 strstr(p->
buf,
"#EXT-X-MEDIA-SEQUENCE:"))
1711 return 0;
1712 }
1713
1715 .
name =
"hls,applehttp",
1723 };