0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

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:
jp9000 2016-04-08 23:33:02 -07:00
parent ad31acca5d
commit 2fd30407e6
5 changed files with 36 additions and 0 deletions

View File

@ -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
View 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

View File

@ -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

View File

@ -15,6 +15,7 @@
*/
#include "ff-packet-queue.h"
#include "ff-compat.h"
bool packet_queue_init(struct ff_packet_queue *q)
{

View File

@ -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)
{