int64_t cur_timestamp;
AVIOInterruptCB *interrupt_callback;
AVDictionary *avio_opts;
- int strict_std_compliance;
char *allowed_extensions;
int max_reload;
int http_persistent;
}
/*
- * Used to reset a statically allocated AVPacket to a clean slate,
+ * Used to reset a statically allocated AVPacket to a clean state,
* containing no data.
*/
static void reset_packet(AVPacket *pkt)
* AVC SEI RBSP anyway */
return NULL;
- if (type == AVMEDIA_TYPE_UNKNOWN)
+ if (type == AVMEDIA_TYPE_UNKNOWN) {
+ av_log(c, AV_LOG_WARNING, "Can't support the type: %s\n", info->type);
return NULL;
+ }
/* URI is mandatory for subtitles as per spec */
- if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0])
+ if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0]) {
+ av_log(c, AV_LOG_ERROR, "The URI tag is REQUIRED for subtitle.\n");
return NULL;
+ }
/* TODO: handle subtitles (each segment has to parsed separately) */
- if (c->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
- if (type == AVMEDIA_TYPE_SUBTITLE)
+ if (c->ctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
+ if (type == AVMEDIA_TYPE_SUBTITLE) {
+ av_log(c, AV_LOG_WARNING, "Can't support the subtitle(uri: %s)\n", info->uri);
return NULL;
+ }
rend = av_mallocz(sizeof(struct rendition));
if (!rend)
} else if (ret < 0) {
if (ret != AVERROR_EOF)
av_log(s, AV_LOG_WARNING,
- "keepalive request failed for '%s', retrying with new connection: %s\n",
+ "keepalive request failed for '%s' when opening url, retrying with new connection: %s\n",
url, av_err2str(ret));
ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
}
} else if (ret < 0) {
if (ret != AVERROR_EOF)
av_log(c->ctx, AV_LOG_WARNING,
- "keepalive request failed for '%s', retrying with new connection: %s\n",
+ "keepalive request failed for '%s' when parsing playlist, retrying with new connection: %s\n",
url, av_err2str(ret));
in = NULL;
}
if (open_url(pls->parent, &pb, seg->key, c->avio_opts, opts, NULL) == 0) {
ret = avio_read(pb, pls->key, sizeof(pls->key));
if (ret != sizeof(pls->key)) {
- av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
+ av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s\n",
seg->key);
}
ff_format_io_close(pls->parent, &pb);
} else {
- av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
+ av_log(pls->parent, AV_LOG_ERROR, "Unable to open key file %s\n",
seg->key);
}
av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url));
reload_interval = v->target_duration / 2;
}
if (v->cur_seq_no < v->start_seq_no) {
- av_log(NULL, AV_LOG_WARNING,
+ av_log(v->parent, AV_LOG_WARNING,
"skipping %d segments ahead, expired from playlists\n",
v->start_seq_no - v->cur_seq_no);
v->cur_seq_no = v->start_seq_no;
c->ctx = s;
c->interrupt_callback = &s->interrupt_callback;
- c->strict_std_compliance = s->strict_std_compliance;
c->first_packet = 1;
c->first_timestamp = AV_NOPTS_VALUE;
goto fail;
if (c->n_variants == 0) {
- av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+ av_log(s, AV_LOG_WARNING, "Empty playlist\n");
ret = AVERROR_EOF;
goto fail;
}
}
if (c->variants[0]->playlists[0]->n_segments == 0) {
- av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+ av_log(s, AV_LOG_WARNING, "Empty segment\n");
ret = AVERROR_EOF;
goto fail;
}
/* Open the demuxer for each playlist */
for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i];
- AVInputFormat *in_fmt = NULL;
+ ff_const59 AVInputFormat *in_fmt = NULL;
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
* but for other streams we can rely on our user calling avformat_find_stream_info()
* on us if they want to.
*/
- if (pls->is_id3_timestamped) {
+ if (pls->is_id3_timestamped || (pls->n_renditions > 0 && pls->renditions[0]->type == AVMEDIA_TYPE_AUDIO)) {
ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;
return 0;
}
-static int hls_probe(AVProbeData *p)
+static int hls_probe(const AVProbeData *p)
{
/* Require #EXTM3U at the start, and either one of the ones below
* somewhere for a proper match. */
};
static const AVClass hls_class = {
- .class_name = "hls,applehttp",
+ .class_name = "hls demuxer",
.item_name = av_default_item_name,
.option = hls_options,
.version = LIBAVUTIL_VERSION_INT,
};
AVInputFormat ff_hls_demuxer = {
- .name = "hls,applehttp",
+ .name = "hls",
.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
.priv_class = &hls_class,
.priv_data_size = sizeof(HLSContext),