Update API usage to deal with current vs new FFmpeg API.

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/audio/moc/Makefile,v
retrieving revision 1.19
diff -u -p -u -p -r1.19 Makefile
--- Makefile    5 Dec 2018 20:19:01 -0000       1.19
+++ Makefile    17 Feb 2019 22:10:04 -0000
@@ -7,7 +7,7 @@ HOMEPAGE =      http://moc.daper.net/
 MASTER_SITES = http://ftp.daper.net/pub/soft/moc/stable/ \
                https://distfiles.nl/
 EXTRACT_SUFX = .tar.bz2
-REVISION =     4
+REVISION =     5
 
 # GPLv3+
 PERMIT_PACKAGE_CDROM = Yes
Index: patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
===================================================================
RCS file: patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
diff -N patches/patch-decoder_plugins_ffmpeg_ffmpeg_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-decoder_plugins_ffmpeg_ffmpeg_c       17 Feb 2019 22:09:52 
-0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+
+Maint: Migrate to FFmpeg/LibAV's AV_-prefixed #defines.
+
+Index: decoder_plugins/ffmpeg/ffmpeg.c
+--- decoder_plugins/ffmpeg/ffmpeg.c.orig
++++ decoder_plugins/ffmpeg/ffmpeg.c
+@@ -984,7 +984,7 @@ static void *ffmpeg_open (const char *file)
+        * FFmpeg/LibAV in use.  For some versions this will be caught in
+        * *_find_stream_info() above and misreported as an unfound codec
+        * parameters error. */
+-      if (data->codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
++      if (data->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
+               decoder_error (&data->error, ERROR_FATAL, 0,
+                               "The codec is experimental and may damage MOC: 
%s",
+                               data->codec->name);
+@@ -993,8 +993,8 @@ static void *ffmpeg_open (const char *file)
+ #endif
+ 
+       set_downmixing (data);
+-      if (data->codec->capabilities & CODEC_CAP_TRUNCATED)
+-              data->enc->flags |= CODEC_FLAG_TRUNCATED;
++      if (data->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
++              data->enc->flags |= AV_CODEC_FLAG_TRUNCATED;
+ 
+ #ifdef HAVE_AVCODEC_OPEN2
+       if (avcodec_open2 (data->enc, data->codec, NULL) < 0)
+@@ -1025,7 +1025,7 @@ static void *ffmpeg_open (const char *file)
+ 
+       data->sample_width = sfmt_Bps (data->fmt);
+ 
+-      if (data->codec->capabilities & CODEC_CAP_DELAY)
++      if (data->codec->capabilities & AV_CODEC_CAP_DELAY)
+               data->delay = true;
+       data->seek_broken = is_seek_broken (data);
+       data->timing_broken = is_timing_broken (data->ic);

Reply via email to