diff options
author | Marton Balint <cus@passwd.hu> | 2017-12-29 23:30:14 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2018-01-28 23:06:43 +0100 |
commit | 18ac64235939c4c5c7656546a9545f68339affbe (patch) | |
tree | 53d6aab3edafd9bd621558415b63546ca0c5674e /libavformat/hdsenc.c | |
parent | 45ec2e44be911da073b02ae3a14e3cb08ce0a1f5 (diff) | |
download | ffmpeg-18ac64235939c4c5c7656546a9545f68339affbe.tar.gz |
avformat: migrate to AVFormatContext->url
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r-- | libavformat/hdsenc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index 72829f7257..d82aee17b9 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -169,8 +169,8 @@ static int write_manifest(AVFormatContext *s, int final) if (c->nb_streams > 0) duration = c->streams[0].last_ts * av_q2d(s->streams[0]->time_base); - snprintf(filename, sizeof(filename), "%s/index.f4m", s->filename); - snprintf(temp_filename, sizeof(temp_filename), "%s/index.f4m.tmp", s->filename); + snprintf(filename, sizeof(filename), "%s/index.f4m", s->url); + snprintf(temp_filename, sizeof(temp_filename), "%s/index.f4m.tmp", s->url); ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, NULL); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); @@ -178,7 +178,7 @@ static int write_manifest(AVFormatContext *s, int final) } avio_printf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); avio_printf(out, "<manifest xmlns=\"http://ns.adobe.com/f4m/1.0\">\n"); - avio_printf(out, "\t<id>%s</id>\n", av_basename(s->filename)); + avio_printf(out, "\t<id>%s</id>\n", av_basename(s->url)); avio_printf(out, "\t<streamType>%s</streamType>\n", final ? "recorded" : "live"); avio_printf(out, "\t<deliveryType>streaming</deliveryType>\n"); @@ -236,9 +236,9 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final) cur_media_time = os->fragments[os->nb_fragments - 1]->start_time; snprintf(filename, sizeof(filename), - "%s/stream%d.abst", s->filename, index); + "%s/stream%d.abst", s->url, index); snprintf(temp_filename, sizeof(temp_filename), - "%s/stream%d.abst.tmp", s->filename, index); + "%s/stream%d.abst.tmp", s->url, index); ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, NULL); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); @@ -317,9 +317,9 @@ static int hds_write_header(AVFormatContext *s) int ret = 0, i; AVOutputFormat *oformat; - if (mkdir(s->filename, 0777) == -1 && errno != EEXIST) { + if (mkdir(s->url, 0777) == -1 && errno != EEXIST) { ret = AVERROR(errno); - av_log(s, AV_LOG_ERROR , "Failed to create directory %s\n", s->filename); + av_log(s, AV_LOG_ERROR , "Failed to create directory %s\n", s->url); goto fail; } @@ -412,7 +412,7 @@ static int hds_write_header(AVFormatContext *s) s->streams[os->first_stream + j]->time_base = os->ctx->streams[j]->time_base; snprintf(os->temp_filename, sizeof(os->temp_filename), - "%s/stream%d_temp", s->filename, i); + "%s/stream%d_temp", s->url, i); ret = init_file(s, os, 0); if (ret < 0) goto fail; @@ -476,7 +476,7 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final, close_file(s, os); snprintf(target_filename, sizeof(target_filename), - "%s/stream%dSeg1-Frag%d", s->filename, index, os->fragment_index); + "%s/stream%dSeg1-Frag%d", s->url, index, os->fragment_index); ret = ff_rename(os->temp_filename, target_filename, s); if (ret < 0) return ret; @@ -549,13 +549,13 @@ static int hds_write_trailer(AVFormatContext *s) if (c->remove_at_exit) { char filename[1024]; - snprintf(filename, sizeof(filename), "%s/index.f4m", s->filename); + snprintf(filename, sizeof(filename), "%s/index.f4m", s->url); unlink(filename); for (i = 0; i < c->nb_streams; i++) { - snprintf(filename, sizeof(filename), "%s/stream%d.abst", s->filename, i); + snprintf(filename, sizeof(filename), "%s/stream%d.abst", s->url, i); unlink(filename); } - rmdir(s->filename); + rmdir(s->url); } hds_free(s); |