pkt->buf = avbuf;
pkt->flags |= AV_PKT_FLAG_KEY;
if (size < 0)
- av_free_packet(pkt);
+ av_packet_unref(pkt);
} else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE &&
!st->codec->codec_tag && read_gab2_sub(st, pkt)) {
ast->frame_offset++;
{
AVIStream *ast2 = st2->priv_data;
int64_t ts2 = av_rescale_q(timestamp, st->time_base, st2->time_base);
- av_free_packet(&ast2->sub_pkt);
+ av_packet_unref(&ast2->sub_pkt);
if (avformat_seek_file(ast2->sub_ctx, 0, INT64_MIN, ts2, ts2, 0) >= 0 ||
avformat_seek_file(ast2->sub_ctx, 0, ts2, ts2, INT64_MAX, 0) >= 0)
ff_read_packet(ast2->sub_ctx, &ast2->sub_pkt);
avformat_close_input(&ast->sub_ctx);
}
av_free(ast->sub_buffer);
- av_free_packet(&ast->sub_pkt);
+ av_packet_unref(&ast->sub_pkt);
}
}