You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -293,28 +293,18 @@ static void free_rendition_list(HLSContext *c)
|
|||||||
c->n_renditions = 0;
|
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,
|
static struct playlist *new_playlist(HLSContext *c, const char *url,
|
||||||
const char *base)
|
const char *base)
|
||||||
{
|
{
|
||||||
struct playlist *pls = av_mallocz(sizeof(struct playlist));
|
struct playlist *pls = av_mallocz(sizeof(struct playlist));
|
||||||
if (!pls)
|
if (!pls)
|
||||||
return NULL;
|
return NULL;
|
||||||
reset_packet(&pls->pkt);
|
|
||||||
ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
|
ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
|
||||||
if (!pls->url[0]) {
|
if (!pls->url[0]) {
|
||||||
av_free(pls);
|
av_free(pls);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
av_init_packet(&pls->pkt);
|
||||||
pls->seek_timestamp = AV_NOPTS_VALUE;
|
pls->seek_timestamp = AV_NOPTS_VALUE;
|
||||||
|
|
||||||
pls->is_id3_timestamped = -1;
|
pls->is_id3_timestamped = -1;
|
||||||
|
Reference in New Issue
Block a user