diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-14 22:59:57 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-18 07:03:00 +0200 |
commit | 97d802914994b29eba97dc49e35e8ed60b5b8ae3 (patch) | |
tree | 7f00ce15af3d3163d2078ce0c51f2cc0a4ed94a0 /libavformat/hls.c | |
parent | 8c91b5c48a6bf22359d7565f94a12adae24e4719 (diff) |
avformat/hls: Use av_init_pkt() directly
and remove reset_packet(). The packet's data pointer is already zeroed,
so the only thing that reset_packet() does that av_init_pkt() doesn't is
redundant.
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r-- | libavformat/hls.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 8217c5ede4..3ab07f1b3f 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -293,28 +293,18 @@ static void free_rendition_list(HLSContext *c) c->n_renditions = 0; } -/* - * Used to reset a statically allocated AVPacket to a clean state, - * containing no data. - */ -static void reset_packet(AVPacket *pkt) -{ - av_init_packet(pkt); - pkt->data = NULL; -} - static struct playlist *new_playlist(HLSContext *c, const char *url, const char *base) { struct playlist *pls = av_mallocz(sizeof(struct playlist)); if (!pls) return NULL; - reset_packet(&pls->pkt); ff_make_absolute_url(pls->url, sizeof(pls->url), base, url); if (!pls->url[0]) { av_free(pls); return NULL; } + av_init_packet(&pls->pkt); pls->seek_timestamp = AV_NOPTS_VALUE; pls->is_id3_timestamped = -1; |