deps/libff: Fix warnings with FFmpeg 3.0.0+
Fixes warnings with deprecated packet functions (av_free_packet and av_dup packet, which were replaced by av_packet_unref and av_packet_ref respectively)
This commit is contained in:
parent
ad31acca5d
commit
2fd30407e6
2
deps/libff/libff/ff-audio-decoder.c
vendored
2
deps/libff/libff/ff-audio-decoder.c
vendored
@ -28,6 +28,8 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "ff-compat.h"
|
||||
|
||||
static inline void shrink_packet(struct ff_packet *packet, int packet_length)
|
||||
{
|
||||
if (packet_length <= packet->base.size) {
|
||||
|
29
deps/libff/libff/ff-compat.h
vendored
Normal file
29
deps/libff/libff/ff-compat.h
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Hugh Bailey <obs.jim@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR >= 57
|
||||
#define av_free_packet av_packet_unref
|
||||
static inline int av_dup_packet_2(AVPacket *pkt)
|
||||
{
|
||||
AVPacket tmp = *pkt;
|
||||
int ret = av_packet_ref(pkt, &tmp);
|
||||
av_packet_unref(&tmp);
|
||||
return ret;
|
||||
}
|
||||
#define av_dup_packet av_dup_packet_2
|
||||
#endif
|
2
deps/libff/libff/ff-demuxer.c
vendored
2
deps/libff/libff/ff-demuxer.c
vendored
@ -23,6 +23,8 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "ff-compat.h"
|
||||
|
||||
#define DEFAULT_AV_SYNC_TYPE AV_SYNC_VIDEO_MASTER
|
||||
|
||||
#define AUDIO_FRAME_QUEUE_SIZE 1
|
||||
|
1
deps/libff/libff/ff-packet-queue.c
vendored
1
deps/libff/libff/ff-packet-queue.c
vendored
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "ff-packet-queue.h"
|
||||
#include "ff-compat.h"
|
||||
|
||||
bool packet_queue_init(struct ff_packet_queue *q)
|
||||
{
|
||||
|
2
deps/libff/libff/ff-video-decoder.c
vendored
2
deps/libff/libff/ff-video-decoder.c
vendored
@ -27,6 +27,8 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "ff-compat.h"
|
||||
|
||||
static bool queue_frame(struct ff_decoder *decoder, AVFrame *frame,
|
||||
double best_effort_pts)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user