Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Apr 2018 15:10:49 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r468434 - head/multimedia/qmmp/files
Message-ID:  <201804271510.w3RFAnvG052823@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Apr 27 15:10:49 2018
New Revision: 468434
URL: https://svnweb.freebsd.org/changeset/ports/468434

Log:
  multimedia/qmmp: unbreak with ffmpeg 4.0
  
  src/plugins/Input/ffmpeg/decoder_ffmpeg.h:64:43: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
      uchar m_input_buf[INPUT_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
                                            ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:37:17: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      return (int)d->input()->read((char*)buf, size);
                  ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:49:16: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
          return d->input()->size();
                 ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:54:24: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
          absolute_pos = d->input()->pos() + offset;
                         ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:57:24: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
          absolute_pos = d->input()->size() - offset;
                         ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:62:43: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      if(absolute_pos < 0 || absolute_pos > d->input()->size())
                                            ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:64:12: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      return d->input()->seek(absolute_pos);
             ^
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:131:19: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      pd.buf_size = input()->peek((char*)buf, sizeof(buf) - AVPROBE_PADDING_SIZE);
                    ^~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:153:27: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      m_stream->seekable = !input()->isSequential();
                            ^~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:166:9: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      if (input()->isSequential())
          ^~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:204:9: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
          addMetaData(metaData);
          ^~~~~~~~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:209:5: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      setReplayGainInfo(rg.replayGainInfo());
      ^~~~~~~~~~~~~~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:271:19: error: cannot initialize object parameter of type 'Decoder' with an expression of type 'DecoderFFmpeg'
      m_totalTime = input()->isSequential() ? 0 : ic->duration * 1000 / AV_TIME_BASE;
                    ^~~~~
  src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp:306:5: error: no matching member function for call to 'configure'
      configure(c->sample_rate, m_channels, format);
      ^~~~~~~~~
  src/plugins/Input/ffmpeg/../../../qmmp/decoder.h:177:10: note: candidate function not viable: no known conversion from 'DecoderFFmpeg' to 'Decoder' for object argument
      void configure(quint32 srate, int channels, Qmmp::AudioFormat f = Qmmp::PCM_S16LE);
           ^
  src/plugins/Input/ffmpeg/../../../qmmp/decoder.h:170:10: note: candidate function not viable: no known conversion from 'DecoderFFmpeg' to 'Decoder' for object argument
      void configure(quint32 srate, const ChannelMap &map, Qmmp::AudioFormat f = Qmmp::PCM_S16LE);
           ^
  src/plugins/Input/ffmpeg/../../../qmmp/decoder.h:182:10: note: candidate function not viable: requires single argument 'p', but 3 arguments were provided
      void configure(const AudioParameters &p);
           ^
  
  PR:		227726

Added:
  head/multimedia/qmmp/files/
  head/multimedia/qmmp/files/patch-ffmpeg4   (contents, props changed)

Added: head/multimedia/qmmp/files/patch-ffmpeg4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/qmmp/files/patch-ffmpeg4	Fri Apr 27 15:10:49 2018	(r468434)
@@ -0,0 +1,291 @@
+https://sourceforge.net/p/qmmp-dev/code/7849/
+
+--- src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp.orig	2017-11-25 10:42:37 UTC
++++ src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
+@@ -1,5 +1,5 @@
+ /***************************************************************************
+- *   Copyright (C) 2006-2017 by Ilya Kotov                                 *
++ *   Copyright (C) 2006-2018 by Ilya Kotov                                 *
+  *   forkotov02@ya.ru                                                      *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+@@ -22,7 +22,7 @@
+ #include <QFile>
+ #include "replaygainreader.h"
+ #include "decoder_ffmpeg.h"
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav-10: 55.34.1; ffmpeg-2.1: 55.39.100
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav-10: 55.34.1; ffmpeg-2.1: 55.39.100
+ extern "C"{
+ #include <libavutil/channel_layout.h>
+ #include <libavutil/frame.h>
+@@ -92,14 +92,14 @@ DecoderFFmpeg::~DecoderFFmpeg()
+ {
+     m_bitrate = 0;
+     m_temp_pkt.size = 0;
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+     if(c)
+         avcodec_free_context(&c);
+ #endif
+     if (ic)
+         avformat_free_context(ic);
+     if(m_pkt.data)
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+         av_packet_unref(&m_pkt);
+ #else
+         av_free_packet(&m_pkt);
+@@ -108,7 +108,7 @@ DecoderFFmpeg::~DecoderFFmpeg()
+         av_free(m_stream);
+ 
+     if(m_decoded_frame)
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
+         av_frame_free(&m_decoded_frame);
+ #else
+         av_free(m_decoded_frame);
+@@ -208,7 +208,7 @@ bool DecoderFFmpeg::initialize()
+     ReplayGainReader rg(ic);
+     setReplayGainInfo(rg.replayGainInfo());
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,4,0)) //ffmpeg-3.1:  57.48.101
+     c = avcodec_alloc_context3(NULL);
+ #endif
+ 
+@@ -221,13 +221,13 @@ bool DecoderFFmpeg::initialize()
+         return false;
+     }
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+     avcodec_parameters_to_context(c, ic->streams[audioIndex]->codecpar);
+ #else
+     c = ic->streams[audioIndex]->codec;
+ #endif
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
+     if (c->channels == 1)
+     {
+         c->request_channel_layout = AV_CH_LAYOUT_MONO;
+@@ -262,7 +262,7 @@ bool DecoderFFmpeg::initialize()
+         return false;
+     }
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
+     m_decoded_frame = av_frame_alloc();
+ #else
+     m_decoded_frame = avcodec_alloc_frame();
+@@ -270,7 +270,7 @@ bool DecoderFFmpeg::initialize()
+ 
+     m_totalTime = input()->isSequential() ? 0 : ic->duration * 1000 / AV_TIME_BASE;
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav 10
+     if(c->codec_id == AV_CODEC_ID_SHORTEN) //ffmpeg bug workaround
+         m_totalTime = 0;
+ #else
+@@ -373,13 +373,13 @@ qint64 DecoderFFmpeg::ffmpeg_decode()
+     if(m_pkt.stream_index == audioIndex)
+     {
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav-10: 55.34.1; ffmpeg-2.1:  55.39.100
+ 
+ #else
+         avcodec_get_frame_defaults(m_decoded_frame);
+ #endif
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+         int err = avcodec_send_packet(c, &m_temp_pkt);
+         if(err != 0 && err != AVERROR(EAGAIN) && err != AVERROR(EINVAL))
+         {
+@@ -396,7 +396,7 @@ qint64 DecoderFFmpeg::ffmpeg_decode()
+             qWarning("DecoderFFmpeg: avcodec_receive_frame error: %d", err);
+             return -1;
+         }
+-        got_frame = av_frame_get_pkt_size(m_decoded_frame);
++        got_frame = m_decoded_frame->pkt_size;
+ #else
+         int l = avcodec_decode_audio4(c, m_decoded_frame, &got_frame, &m_temp_pkt);
+ #endif
+@@ -417,7 +417,7 @@ qint64 DecoderFFmpeg::ffmpeg_decode()
+         m_temp_pkt.size -= l;
+     }
+     if (!m_temp_pkt.size && m_pkt.data)
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+         av_packet_unref(&m_pkt);
+ #else
+         av_free_packet(&m_pkt);
+@@ -434,7 +434,7 @@ void DecoderFFmpeg::seek(qint64 pos)
+     m_seekTime = timestamp;
+     av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
+     avcodec_flush_buffers(c);
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+     av_packet_unref(&m_pkt);
+ #else
+     av_free_packet(&m_pkt);
+@@ -459,7 +459,7 @@ void DecoderFFmpeg::fillBuffer()
+             if(m_pkt.stream_index != audioIndex)
+             {
+                 if(m_pkt.data)
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+                     av_packet_unref(&m_pkt);
+ #else
+                     av_free_packet(&m_pkt);
+@@ -467,7 +467,7 @@ void DecoderFFmpeg::fillBuffer()
+                 m_temp_pkt.size = 0;
+                 continue;
+             }
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav 10
+             if(m_seekTime && c->codec_id == AV_CODEC_ID_APE)
+ #else
+             if(m_seekTime && c->codec_id == CODEC_ID_APE)
+@@ -481,7 +481,7 @@ void DecoderFFmpeg::fillBuffer()
+             }
+             m_seekTime = 0;
+         }
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav 10
+         if(m_skipBytes > 0 && c->codec_id == AV_CODEC_ID_APE)
+ #else
+         if(m_skipBytes > 0 && c->codec_id == CODEC_ID_APE)
+@@ -524,14 +524,14 @@ void DecoderFFmpeg::fillBuffer()
+             m_output_at = 0;
+             m_temp_pkt.size = 0;
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav 10
+             if(c->codec_id == AV_CODEC_ID_SHORTEN || c->codec_id == AV_CODEC_ID_TWINVQ)
+ #else
+             if(c->codec_id == CODEC_ID_SHORTEN || c->codec_id == CODEC_ID_TWINVQ)
+ #endif
+             {
+                 if(m_pkt.data)
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+                     av_packet_unref(&m_pkt);
+ #else
+                     av_free_packet(&m_pkt);
+@@ -545,7 +545,7 @@ void DecoderFFmpeg::fillBuffer()
+         else if(m_output_at == 0)
+         {
+             if(m_pkt.data)
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(24<<8)+102)) //ffmpeg-3.0
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0
+                 av_packet_unref(&m_pkt);
+ #else
+                 av_free_packet(&m_pkt);
+--- src/plugins/Input/ffmpeg/decoder_ffmpeg.h.orig	2017-11-25 10:42:37 UTC
++++ src/plugins/Input/ffmpeg/decoder_ffmpeg.h
+@@ -1,5 +1,5 @@
+ /***************************************************************************
+- *   Copyright (C) 2006-2017 by Ilya Kotov                                 *
++ *   Copyright (C) 2006-2018 by Ilya Kotov                                 *
+  *   forkotov02@ya.ru                                                      *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+@@ -61,7 +61,12 @@ class DecoderFFmpeg : public Decoder (private)
+     AVPacket m_pkt;
+     AVPacket m_temp_pkt;
+     qint64 m_output_at;
++
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58,10,100)) //ffmpeg-3.5
++    uchar m_input_buf[INPUT_BUFFER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
++#else
+     uchar m_input_buf[INPUT_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
++#endif
+     int64_t m_seekTime;
+     qint64  m_skipBytes;
+     int m_channels;
+--- src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp.orig	2017-11-25 10:42:37 UTC
++++ src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
+@@ -1,5 +1,5 @@
+ /***************************************************************************
+- *   Copyright (C) 2008-2017 by Ilya Kotov                                 *
++ *   Copyright (C) 2008-2018 by Ilya Kotov                                 *
+  *   forkotov02@ya.ru                                                      *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+@@ -40,9 +40,11 @@ extern "C"{
+ 
+ DecoderFFmpegFactory::DecoderFFmpegFactory()
+ {
++#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,10,100)) //ffmpeg-3.5
+     avcodec_register_all();
+     avformat_network_init();
+     av_register_all();
++#endif
+ }
+ 
+ bool DecoderFFmpegFactory::canDecode(QIODevice *i) const
+@@ -93,7 +95,7 @@ const DecoderProperties DecoderFFmpegFactory::properti
+     filters = settings.value("FFMPEG/filters", filters).toStringList();
+ 
+     //remove unsupported filters
+-#if (LIBAVCODEC_VERSION_INT >= ((54<<16) + (51<<8) + 100)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,51,100)) //libav 10
+     if(!avcodec_find_decoder(AV_CODEC_ID_WMAV1))
+         filters.removeAll("*.wma");
+     if(!avcodec_find_decoder(AV_CODEC_ID_APE))
+--- src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp.orig	2017-11-25 10:42:37 UTC
++++ src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp
+@@ -1,5 +1,5 @@
+ /***************************************************************************
+- *   Copyright (C) 2009-2017 by Ilya Kotov                                 *
++ *   Copyright (C) 2009-2018 by Ilya Kotov                                 *
+  *   forkotov02@ya.ru                                                      *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+@@ -55,7 +55,7 @@ QHash<QString, QString> FFmpegMetaDataModel::audioProp
+ 
+     if(idx >= 0)
+     {
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+         AVCodecParameters *c = m_in->streams[idx]->codecpar;
+ #else
+         AVCodecContext *c = m_in->streams[idx]->codec;
+@@ -70,7 +70,7 @@ QPixmap FFmpegMetaDataModel::cover()
+ {
+     if(!m_in)
+         return QPixmap();
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+     AVCodecParameters *c = 0;
+ #else
+     AVCodecContext *c = 0;
+@@ -78,13 +78,13 @@ QPixmap FFmpegMetaDataModel::cover()
+ 
+     for (uint idx = 0; idx < m_in->nb_streams; idx++)
+     {
+-#if (LIBAVCODEC_VERSION_INT >= ((57<<16)+(48<<8)+0)) //ffmpeg-3.1:  57.48.101
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1:  57.48.101
+         c = m_in->streams[idx]->codecpar;
+ #else
+         c = m_in->streams[idx]->codec;
+ #endif
+ 
+-#if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(34<<8)+0)) //libav 10
++#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,34,0)) //libav 10
+         if (c->codec_type == AVMEDIA_TYPE_VIDEO && c->codec_id == AV_CODEC_ID_MJPEG)
+ #else
+         if (c->codec_type == AVMEDIA_TYPE_VIDEO && c->codec_id == CODEC_ID_MJPEG)
+--- src/plugins/Input/ffmpeg/ffmpegmetadatamodel.h.orig	2017-11-25 10:42:37 UTC
++++ src/plugins/Input/ffmpeg/ffmpegmetadatamodel.h
+@@ -24,7 +24,7 @@
+ extern "C"{
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+-#if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0))
++#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,32,0))
+ #include <libavutil/dict.h>
+ #endif
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804271510.w3RFAnvG052823>