fix ffmpeg compiler warnings, thx DboxOldie

This commit is contained in:
Frankenstone
2019-02-27 14:14:19 +01:00
committed by Thilo Graf
parent ef4bb7cff3
commit 4d52588842
5 changed files with 19 additions and 4 deletions

View File

@@ -171,7 +171,9 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void)
avctx = NULL;
avcodec = NULL;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
avcodec_register_all();
#endif
avcodec = avcodec_find_decoder(CODEC_DVB_SUB);//CODEC_ID_DVB_SUBTITLE or AV_CODEC_ID_DVB_SUBTITLE from 57.1.100
if (!avcodec) {
dbgconverter("cDvbSubtitleConverter: unable to get dvb subtitle codec!\n");

View File

@@ -52,7 +52,9 @@ extern "C" {
#define av_frame_free avcodec_free_frame
#endif
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 ))
#if (LIBAVCODEC_VERSION_MAJOR > 55)
#define av_free_packet av_packet_unref
#else
#define av_packet_unref av_free_packet
#endif
@@ -85,8 +87,10 @@ CFfmpegDec::CFfmpegDec(void)
buffer_size = 0x1000;
buffer = NULL;
avc = NULL;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
avcodec_register_all();
av_register_all();
#endif
}
CFfmpegDec::~CFfmpegDec(void)

View File

@@ -67,7 +67,9 @@ extern "C" {
#include <libavformat/avformat.h>
}
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 ))
#if (LIBAVCODEC_VERSION_MAJOR > 55)
#define av_free_packet av_packet_unref
#else
#define av_packet_unref av_free_packet
#endif
@@ -2152,8 +2154,10 @@ bool CStreamRec::Open(CZapitChannel * channel)
}
//av_log_set_level(AV_LOG_VERBOSE);
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all();
avcodec_register_all();
#endif
avformat_network_init();
printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str());

View File

@@ -60,7 +60,9 @@
#include <gui/movieplayer.h>
#include <cs_api.h>
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57, 8, 0 ))
#if (LIBAVCODEC_VERSION_MAJOR > 55)
#define av_free_packet av_packet_unref
#else
#define av_packet_unref av_free_packet
#endif
@@ -795,8 +797,10 @@ bool CStreamStream::Open()
}
//av_log_set_level(AV_LOG_VERBOSE);
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all();
avcodec_register_all();
#endif
avformat_network_init();
printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str());

View File

@@ -307,9 +307,10 @@ void CStreamInfo2::probeStreams()
#ifdef ENABLE_FFMPEG_LOGGING
av_log_set_callback(log_callback);
#endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
avcodec_register_all();
av_register_all();
#endif
AVIOContext *avioc = NULL;
int buffer_size = 188 * 128;
unsigned char *buffer = (unsigned char *) av_malloc(buffer_size);