diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 13:54:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 13:54:50 +0100 |
commit | 2ce43b37fc46e3744d9d5e1baa1280c48ef7b1bf (patch) | |
tree | 24ca5287a90069a324ee49ad251f0d9a69ca0aea /libavformat/hlsenc.c | |
parent | 613001d75fee9dfef14fb000cac8c67ac6381e97 (diff) | |
parent | 6dd93ee6f1b050ad7c4b247899e83efa293ee405 (diff) | |
download | ffmpeg-2ce43b37fc46e3744d9d5e1baa1280c48ef7b1bf.tar.gz |
Merge commit '6dd93ee6f1b050ad7c4b247899e83efa293ee405'
* commit '6dd93ee6f1b050ad7c4b247899e83efa293ee405':
hlsenc: check append_entry return value
hlsenc: use the basename to generate the list entries
avstring: add av_basename and av_dirname
Conflicts:
Changelog
doc/APIchanges
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r-- | libavformat/hlsenc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e85c8b0b53..75ae134649 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -85,7 +85,8 @@ static int append_entry(HLSContext *hls, uint64_t duration) if (!en) return AVERROR(ENOMEM); - av_get_frame_filename(en->name, sizeof(en->name), hls->basename, + av_get_frame_filename(en->name, sizeof(en->name), + av_basename(hls->basename), hls->number -1); en->duration = duration; @@ -260,9 +261,12 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) av_compare_ts(pkt->pts, st->time_base, end_pts, AV_TIME_BASE_Q) >= 0 && pkt->flags & AV_PKT_FLAG_KEY) { - append_entry(hls, av_rescale(pkt->pts - hls->end_pts, - st->time_base.num, - st->time_base.den)); + ret = append_entry(hls, av_rescale(pkt->pts - hls->end_pts, + st->time_base.num, + st->time_base.den)); + if (ret) + return ret; + hls->end_pts = pkt->pts; av_write_frame(oc, NULL); /* Flush any buffered data */ |