]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'b93026777aada7742583d8c5ab079e9f4dfe9a5d'
authorJames Almer <jamrial@gmail.com>
Sun, 2 Sep 2018 22:20:36 +0000 (19:20 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 2 Sep 2018 22:20:36 +0000 (19:20 -0300)
* commit 'b93026777aada7742583d8c5ab079e9f4dfe9a5d':
  libfdk-aac: Use enum names instead of literal numbers for the output format

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/libfdk-aacenc.c

index d47137b227a6d5946abfde8dcf607869f134f557,c340a1e3e0c2b9f3f409893c3ab5b9a22d6d4028..25d33fec18585bd1b79ad06b22fe4b6eb7af51bf
@@@ -2,7 -2,7 +2,7 @@@
   * AAC encoder wrapper
   * Copyright (c) 2012 Martin Storsjo
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
   * Permission to use, copy, modify, and/or distribute this software for any
   * purpose with or without fee is hereby granted, provided that the above
@@@ -218,7 -218,7 +218,7 @@@ static av_cold int aac_encode_init(AVCo
          }
          if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATE,
                                         avctx->bit_rate)) != AACENC_OK) {
 -            av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %d: %s\n",
 +            av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %"PRId64": %s\n",
                     avctx->bit_rate, aac_get_error(err));
              goto error;
          }
      /* Choose bitstream format - if global header is requested, use
       * raw access units, otherwise use ADTS. */
      if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX,
-                                    avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
+                                    avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER ? TT_MP4_RAW :
+                                    s->latm ? TT_MP4_LOAS : TT_MP4_ADTS)) != AACENC_OK) {
          av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n",
                 aac_get_error(err));
          goto error;
@@@ -345,8 -346,10 +346,8 @@@ static int aac_encode_frame(AVCodecCont
      }
  
      /* The maximum packet size is 6144 bits aka 768 bytes per channel. */
 -    if ((ret = ff_alloc_packet(avpkt, FFMAX(8192, 768 * avctx->channels)))) {
 -        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
 +    if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels), 0)) < 0)
          return ret;
 -    }
  
      out_ptr                   = avpkt->data;
      out_buffer_size           = avpkt->size;