mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
Replace deprecated av_free_packet() calls
av_free_packet() got finally deprecated. Use av_packet_unref() instead, which has almost the same semantics, has existed for a while, and is available in all FFmpeg and Libav versions we support.
This commit is contained in:
@@ -183,7 +183,7 @@ static int parse_webvtt(AVPacket *in, AVPacket *pkt)
|
||||
AV_PKT_DATA_WEBVTT_IDENTIFIER,
|
||||
id_len);
|
||||
if (buf == NULL) {
|
||||
av_free_packet(pkt);
|
||||
av_packet_unref(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(buf, id, id_len);
|
||||
@@ -194,7 +194,7 @@ static int parse_webvtt(AVPacket *in, AVPacket *pkt)
|
||||
AV_PKT_DATA_WEBVTT_SETTINGS,
|
||||
settings_len);
|
||||
if (buf == NULL) {
|
||||
av_free_packet(pkt);
|
||||
av_packet_unref(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(buf, settings, settings_len);
|
||||
@@ -256,7 +256,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
|
||||
|
||||
done:
|
||||
avsubtitle_free(&sub);
|
||||
av_free_packet(&parsed_pkt);
|
||||
av_packet_unref(&parsed_pkt);
|
||||
}
|
||||
|
||||
static void reset(struct sd *sd)
|
||||
|
||||
Reference in New Issue
Block a user