diff mbox

[FFmpeg-devel] libavcodec/libaomenc: fix breakage from upstream

Message ID 20181219160337.59272-1-tessarek@evermeet.cx
State Accepted
Headers show

Commit Message

Helmut K. C. Tessarek Dec. 19, 2018, 4:03 p.m. UTC
commit https://aomedia.googlesource.com/aom/+/4667aa1a373566e9c124afcd58c71731ab0d7377
changed parts of the code that broke compilation of libavcodec/libaomenc.c
---
 libavcodec/libaomenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer Dec. 19, 2018, 4:28 p.m. UTC | #1
On 12/19/2018 1:03 PM, Helmut K. C. Tessarek wrote:
> commit https://aomedia.googlesource.com/aom/+/4667aa1a373566e9c124afcd58c71731ab0d7377
> changed parts of the code that broke compilation of libavcodec/libaomenc.c
> ---
>  libavcodec/libaomenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> index 09ef423ce1..6d1955f9cc 100644
> --- a/libavcodec/libaomenc.c
> +++ b/libavcodec/libaomenc.c
> @@ -195,7 +195,7 @@ static av_cold void free_frame_list(struct FrameListData *list)
>  }
>  
>  static av_cold int codecctl_int(AVCodecContext *avctx,
> -                                enum aome_enc_control_id id, int val)
> +                                aome_enc_control_id id, int val)

This will break compilation with libaom 1.0.0 because it wasn't
typedefed before this change. You will need to use an #ifdef UENUM1BYTE
check or similar to choose one line or the other.

Sigh, they keep making breaking changes like it's all internal headers.

>  {
>      AOMContext *ctx = avctx->priv_data;
>      char buf[80];
> @@ -291,7 +291,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
>  
>  static void set_color_range(AVCodecContext *avctx)
>  {
> -    enum aom_color_range aom_cr;
> +    aom_color_range_t aom_cr;

This one is ok and doesn't break 1.0.0, fortunately.

>      switch (avctx->color_range) {
>      case AVCOL_RANGE_UNSPECIFIED:
>      case AVCOL_RANGE_MPEG:       aom_cr = AOM_CR_STUDIO_RANGE; break;
>
Helmut K. C. Tessarek Dec. 19, 2018, 5:14 p.m. UTC | #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512



On 2018-12-19 17:28, James Almer wrote:
> This will break compilation with libaom 1.0.0 because it wasn't 
> typedefed before this change. You will need to use an #ifdef
> UENUM1BYTE check or similar to choose one line or the other.

Yep, an ifdef on UENUM1BYTE should work.

> Sigh, they keep making breaking changes like it's all internal
> headers.

Hmm, one would assume that Google understood the concept of semantic
versioning.

Cheers,
  K. C.

- -- 
regards Helmut K. C. Tessarek              KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAlwafGAACgkQvgmFNJ1E
3QCW2xAAjmlVUjfOWxfpeFPzkng8CInnFwESB09o7ujiBRMSsDuA+zCiRvuJYdau
bjXnrLP7PTFmhrTym4p8Lr29KqfQnLBHi1utj7+JyANr6x7xr907C6r0caMY2+K7
OBGhdUib6XCaTt+o2sqEASJ9k3nzVLQJrMc/wizCkQjjTk7iWeXdJdbnjII2YPpC
y1lz5YDA5ViY0tm1gJTzKjbS8/4XX+WjSpsCzKQAxvGCpGvK4BoPLVrHvihigjWV
0HOqPEHP+efaLxhADyvoK/VcOCUL0LWUicmQTKgn5n1bqb3M6JYFPCDx5Ukpc1fd
+5L9mcvOWaVv/vFAd5FcolOu/kvs7a0oUedNvhY1BxdpRIcGhXgeG2OLJWojny3l
QFMcoBW1E+m7McAdhRnFD6ziMWXBjO5/vO2SALM+dpll861S4PmbpakosNPPspgy
CibAeoMFgmziA5qDvdTfNhy8fYBA5sF7GEg6PZ+LcVEOlxTZu4xqCfZf3AQeVhpw
9eq3xFOqszysxjVAOrVQ8IzOMvFdswB98dyiE4mmD3eo5GDQaYPNbu+iUYKCm4DA
nIAFJFU5/Zgjf1wREzt0yz6DPUuaOct9uvRzwG/xbW37Zk09R3qXrPhCbXe9rV3C
YuZHohVhUuUWvbnw6mEsH7PsWJzEDNhduSk7AZlopAJQ9hLSMuk=
=OYCw
-----END PGP SIGNATURE-----
diff mbox

Patch

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 09ef423ce1..6d1955f9cc 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -195,7 +195,7 @@  static av_cold void free_frame_list(struct FrameListData *list)
 }
 
 static av_cold int codecctl_int(AVCodecContext *avctx,
-                                enum aome_enc_control_id id, int val)
+                                aome_enc_control_id id, int val)
 {
     AOMContext *ctx = avctx->priv_data;
     char buf[80];
@@ -291,7 +291,7 @@  static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
 
 static void set_color_range(AVCodecContext *avctx)
 {
-    enum aom_color_range aom_cr;
+    aom_color_range_t aom_cr;
     switch (avctx->color_range) {
     case AVCOL_RANGE_UNSPECIFIED:
     case AVCOL_RANGE_MPEG:       aom_cr = AOM_CR_STUDIO_RANGE; break;