mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
try to fix versio check for ffmpeg
This commit is contained in:
@@ -223,7 +223,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state,
|
|||||||
Status=DATA_ERR;
|
Status=DATA_ERR;
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext *c = avc->streams[best_stream]->codec;
|
AVCodecContext *c = avc->streams[best_stream]->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecContext *c = avcodec_alloc_context3(codec);
|
AVCodecContext *c = avcodec_alloc_context3(codec);
|
||||||
@@ -460,7 +460,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover)
|
|||||||
if (!is_stream) {
|
if (!is_stream) {
|
||||||
GetMeta(avc->metadata);
|
GetMeta(avc->metadata);
|
||||||
for(unsigned int i = 0; i < avc->nb_streams; i++) {
|
for(unsigned int i = 0; i < avc->nb_streams; i++) {
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||||
#else
|
#else
|
||||||
if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
|
if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||||
@@ -481,7 +481,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover)
|
|||||||
DeInit();
|
DeInit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
if (!codec)
|
if (!codec)
|
||||||
codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id);
|
codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id);
|
||||||
samplerate = avc->streams[best_stream]->codec->sample_rate;
|
samplerate = avc->streams[best_stream]->codec->sample_rate;
|
||||||
@@ -511,7 +511,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover)
|
|||||||
printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time);
|
printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time);
|
||||||
|
|
||||||
for(unsigned int i = 0; i < avc->nb_streams; i++) {
|
for(unsigned int i = 0; i < avc->nb_streams; i++) {
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
if (avc->streams[i]->codec->bit_rate > 0)
|
if (avc->streams[i]->codec->bit_rate > 0)
|
||||||
bitrate += avc->streams[i]->codec->bit_rate;
|
bitrate += avc->streams[i]->codec->bit_rate;
|
||||||
#else
|
#else
|
||||||
|
@@ -1943,7 +1943,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li
|
|||||||
|
|
||||||
for (unsigned i = 0; i < ofcx->nb_streams; i++) {
|
for (unsigned i = 0; i < ofcx->nb_streams; i++) {
|
||||||
AVStream *st = ofcx->streams[i];
|
AVStream *st = ofcx->streams[i];
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext * codec = st->codec;
|
AVCodecContext * codec = st->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecParameters * codec = st->codecpar;
|
AVCodecParameters * codec = st->codecpar;
|
||||||
@@ -2176,7 +2176,7 @@ bool CStreamRec::Open(CZapitChannel * channel)
|
|||||||
stream_index = -1;
|
stream_index = -1;
|
||||||
int stid = 0x200;
|
int stid = 0x200;
|
||||||
for (unsigned i = 0; i < ifcx->nb_streams; i++) {
|
for (unsigned i = 0; i < ifcx->nb_streams; i++) {
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext * iccx = ifcx->streams[i]->codec;
|
AVCodecContext * iccx = ifcx->streams[i]->codec;
|
||||||
AVStream *ost = avformat_new_stream(ofcx, iccx->codec);
|
AVStream *ost = avformat_new_stream(ofcx, iccx->codec);
|
||||||
avcodec_copy_context(ost->codec, iccx);
|
avcodec_copy_context(ost->codec, iccx);
|
||||||
@@ -2232,7 +2232,7 @@ void CStreamRec::run()
|
|||||||
break;
|
break;
|
||||||
if (pkt.stream_index < 0)
|
if (pkt.stream_index < 0)
|
||||||
continue;
|
continue;
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec;
|
AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar;
|
AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar;
|
||||||
|
@@ -850,7 +850,7 @@ bool CStreamStream::Open()
|
|||||||
av_dict_copy(&ofcx->metadata, ifcx->metadata, 0);
|
av_dict_copy(&ofcx->metadata, ifcx->metadata, 0);
|
||||||
int stid = 0x200;
|
int stid = 0x200;
|
||||||
for (unsigned i = 0; i < ifcx->nb_streams; i++) {
|
for (unsigned i = 0; i < ifcx->nb_streams; i++) {
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext * iccx = ifcx->streams[i]->codec;
|
AVCodecContext * iccx = ifcx->streams[i]->codec;
|
||||||
AVStream *ost = avformat_new_stream(ofcx, iccx->codec);
|
AVStream *ost = avformat_new_stream(ofcx, iccx->codec);
|
||||||
avcodec_copy_context(ost->codec, iccx);
|
avcodec_copy_context(ost->codec, iccx);
|
||||||
@@ -923,7 +923,7 @@ void CStreamStream::run()
|
|||||||
if (pkt.stream_index < 0)
|
if (pkt.stream_index < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 ))
|
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 ))
|
||||||
AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec;
|
AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar;
|
AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar;
|
||||||
|
Reference in New Issue
Block a user