]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libvo-aacenc.c
ra288: use memcpy() to copy decoded samples to output
[ffmpeg] / libavcodec / libvo-aacenc.c
index 7006d78c42a92132a78af7534de5bb3333974143..647971a8927b2b2b975fb47562f81174bb80261b 100644 (file)
@@ -59,16 +59,16 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
     if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, &params)
         != VO_ERR_NONE) {
         av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n");
-        return AVERROR_UNKNOWN;
+        return AVERROR(EINVAL);
     }
 
     for (index = 0; index < 16; index++)
-        if (avctx->sample_rate == ff_mpeg4audio_sample_rates[index])
+        if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[index])
             break;
     if (index == 16) {
         av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n",
                                     avctx->sample_rate);
-        return AVERROR_NOTSUPP;
+        return AVERROR(ENOSYS);
     }
     if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
         avctx->extradata_size = 2;
@@ -110,21 +110,20 @@ static int aac_encode_frame(AVCodecContext *avctx,
     if (s->codec_api.GetOutputData(s->handle, &output, &output_info)
         != VO_ERR_NONE) {
         av_log(avctx, AV_LOG_ERROR, "Unable to encode frame\n");
-        return AVERROR_UNKNOWN;
+        return AVERROR(EINVAL);
     }
     return output.Length;
 }
 
 AVCodec ff_libvo_aacenc_encoder = {
-    "libvo_aacenc",
-    CODEC_TYPE_AUDIO,
-    CODEC_ID_AAC,
-    sizeof(AACContext),
-    aac_encode_init,
-    aac_encode_frame,
-    aac_encode_close,
-    NULL,
+    .name           = "libvo_aacenc",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_AAC,
+    .priv_data_size = sizeof(AACContext),
+    .init           = aac_encode_init,
+    .encode         = aac_encode_frame,
+    .close          = aac_encode_close,
     .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
-    .long_name = NULL_IF_CONFIG_SMALL("libvo-aacenc AAC"),
+    .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC"),
 };