Bug#896824: ignition-common: FTBFS with FFmpeg 4.0

2018-06-18 Thread James Cowgill
Control: tags -1 patch fixed-upstream

Hi,

On Tue, 24 Apr 2018 16:26:55 +0100 James Cowgill 
wrote:
> Source: ignition-common
> Version: 1.0.1-1
> Severity: important
> User: debian-multime...@lists.debian.org
> Usertags: ffmpeg-4.0-transition
> 
> Hi,
> 
> Your package FTBFS with version 4.0 of FFmpeg.

This is fixed in 1.1.1. I have also attached a patch containing the fix
which applies to 1.0.1.

James
Description: Fix FTBFS with FFmpeg 4.0
Origin: upstream, https://bitbucket.org/ignitionrobotics/ign-common/commits/89d45a69d76e
Bug: https://bitbucket.org/ignitionrobotics/ign-common/pull-requests/120
Bug-Debian: https://bugs.debian.org/896824
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/AudioDecoder.cc
+++ b/src/AudioDecoder.cc
@@ -257,8 +257,13 @@ bool AudioDecoder::SetFile(const std::st
 return false;
   }
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
+  if (this->data->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
+this->data->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED;
+#else
   if (this->data->codec->capabilities & CODEC_CAP_TRUNCATED)
 this->data->codecCtx->flags |= CODEC_FLAG_TRUNCATED;
+#endif
 
   // Open codec
   if (avcodec_open2(this->data->codecCtx, this->data->codec, nullptr) < 0)
--- a/src/Util.cc
+++ b/src/Util.cc
@@ -291,8 +291,10 @@ void ignition::common::load()
   if (first)
   {
 first = false;
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
 avcodec_register_all();
 av_register_all();
+#endif
 
 #if defined(__linux__) && defined(HAVE_AVDEVICE)
 avdevice_register_all();
--- a/src/Video.cc
+++ b/src/Video.cc
@@ -164,8 +164,13 @@ bool Video::Load(const std::string &_fil
 
   // Inform the codec that we can handle truncated bitstreams -- i.e.,
   // bitstreams where frame boundaries can fall in the middle of packets
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
+  if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
+this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED;
+#else
   if (codec->capabilities & CODEC_CAP_TRUNCATED)
 this->dataPtr->codecCtx->flags |= CODEC_FLAG_TRUNCATED;
+#endif
 
   // Open codec
   if (avcodec_open2(this->dataPtr->codecCtx, codec, nullptr) < 0)


signature.asc
Description: OpenPGP digital signature


Bug#896824: ignition-common: FTBFS with FFmpeg 4.0

2018-04-24 Thread James Cowgill
Source: ignition-common
Version: 1.0.1-1
Severity: important
User: debian-multime...@lists.debian.org
Usertags: ffmpeg-4.0-transition

Hi,

Your package FTBFS with version 4.0 of FFmpeg. In FFmpeg 4.0, there are
a number of API changes which have cause many packages to FTBFS.

Incomplete list of changes (based on looking at common build failures):
- Some fields in AVCodecContext have been removed and replaced with
  private options which can be set using the av_opt_set* APIs
- Most CODEC_* constants have been renamed to AV_CODEC_*
- The buffer constants FF_INPUT_BUFFER_PADDING_SIZE and
  FF_MIN_BUFFER_SIZE have been renamed to AV_INPUT_BUFFER_PADDING_SIZE
  and AV_INPUT_BUFFER_MIN_SIZE.
- The old resampling API provided by libavcodec has been removed. Use
  libswresample instead.
- The libavfilter/avfiltergraph.h header has been removed, include
  libavfilter/avfilter.h instead.
- The AVFrac structure (representing mixed rational numbers) has been
  removed.

Build log:
https://people.debian.org/~jcowgill/ffmpeg-4.0-20180424/ignition-common_amd64-2018-04-23T16:45:23Z.build

Thanks,
James






signature.asc
Description: OpenPGP digital signature