73 while (len > 0 && isspace(buf[len - 1]))
101 int key_len,
char **dest,
int *dest_len)
103 if (!strncmp(key,
"BANDWIDTH=", key_len)) {
113 int ret = 0,
duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
122 if (strcmp(line,
"#EXTM3U"))
129 if (
av_strstart(line,
"#EXT-X-STREAM-INF:", &ptr)) {
135 }
else if (
av_strstart(line,
"#EXT-X-TARGETDURATION:", &ptr)) {
137 }
else if (
av_strstart(line,
"#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
139 }
else if (
av_strstart(line,
"#EXT-X-ENDLIST", &ptr)) {
146 }
else if (line[0]) {
157 }
else if (is_variant) {
191 const char *nested_url;
200 }
else if (
av_strstart(uri,
"applehttp://", &nested_url)) {
247 int64_t reload_interval;
263 reload_interval *= 1000000;
278 "skipping %d segments ahead, expired from playlist\n",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int applehttp_close(URLContext *h)
int is_streamed
true if streamed (no seek possible), default = false
#define AV_LOG_WARNING
Something somehow does not look correct.
AVIOInterruptCB interrupt_callback
#define AVIO_FLAG_READ
read-only
#define AVIO_FLAG_WRITE
write-only
struct AppleHTTPContext AppleHTTPContext
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
URLProtocol ff_applehttp_protocol
static uint64_t max_bandwidth
#define AVERROR_EOF
End of file.
static int applehttp_read(URLContext *h, uint8_t *buf, int size)
static void free_variant_list(AppleHTTPContext *s)
struct variant ** variants
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
#define URL_PROTOCOL_FLAG_NESTED_SCHEME
static int applehttp_open(URLContext *h, const char *uri, int flags)
void av_log(void *avcl, int level, const char *fmt,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
static void free_segment_list(AppleHTTPContext *s)
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
static void handle_variant_args(struct variant_info *info, const char *key, int key_len, char **dest, int *dest_len)
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
int ff_check_interrupt(AVIOInterruptCB *cb)
Check if the user has requested to interrup a blocking function associated with cb.
struct segment ** segments
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
char playlisturl[MAX_URL_SIZE]
int avio_open2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
int ffurl_close(URLContext *h)
Close the resource accessed by the URLContext h, and free the memory used by it.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int ffurl_open(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create an URLContext for accessing to the resource indicated by url, and open it. ...
int eof_reached
true if eof reached
static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
unbuffered private I/O API
static int parse_playlist(URLContext *h, const char *url)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf...
int64_t av_gettime(void)
Get the current time in microseconds.