[ffmpeg] Update most deprecated functions

This commit is contained in:
ejurgensen
2016-01-05 23:22:01 +01:00
parent 7caf8cc66a
commit 0d55e055c0
4 changed files with 35 additions and 45 deletions

View File

@@ -36,7 +36,7 @@
#ifdef HAVE_LIBAVFILTER
# include <libavfilter/avcodec.h>
#else
# include "ffmpeg-compat.c"
# include "ffmpeg-compat.h"
#endif
#include "logger.h"
@@ -285,7 +285,7 @@ static int decode_interrupt_cb(void *arg)
* packet will be updated, and packet->data is pointed to the data
* returned by av_read_frame(). The packet struct is owned by the
* caller, but *not* packet->data, so don't free the packet with
* av_free_packet()
* av_free_packet()/av_packet_unref()
* @out stream Set to the input AVStream corresponding to the packet
* @out stream_index
* Set to the input stream index corresponding to the packet
@@ -314,7 +314,7 @@ read_packet(AVPacket *packet, AVStream **stream, unsigned int *stream_index, str
{
// We are going to read a new packet from source, so now it is safe to
// discard the previous packet and reset resume_offset
av_free_packet(&ctx->packet);
av_packet_unref(&ctx->packet);
ctx->resume_offset = 0;
ctx->timestamp = av_gettime();
@@ -1441,7 +1441,7 @@ transcode_needed(const char *user_agent, const char *client_codecs, char *file_c
void
transcode_decode_cleanup(struct decode_ctx *ctx)
{
av_free_packet(&ctx->packet);
av_packet_unref(&ctx->packet);
close_input(ctx);
free(ctx);
}
@@ -1735,7 +1735,7 @@ transcode_seek(struct transcode_ctx *ctx, int ms)
in_stream->codec->skip_frame = AVDISCARD_NONREF;
while (1)
{
av_free_packet(&decode_ctx->packet);
av_packet_unref(&decode_ctx->packet);
decode_ctx->timestamp = av_gettime();