]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libschroedingerenc.c
Pad the extradata in the AAC ADTS to AudioSpecificConfig bitstream filter.
[ffmpeg] / libavcodec / libschroedingerenc.c
index 94033cc2562f96e191947075cc9fa22ca3c7053a..44d4dcd428fe0797008ec30b42b546c8e49da093 100644 (file)
@@ -223,15 +223,13 @@ static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avccontext,
     /* Input line size may differ from what the codec supports. Especially
      * when transcoding from one format to another. So use avpicture_layout
      * to copy the frame. */
-    in_frame = schro_frame_new_and_alloc(NULL,
-                                         p_schro_params->frame_format,
-                                         p_schro_params->format->width,
-                                         p_schro_params->format->height);
+    in_frame = ff_create_schro_frame(avccontext, p_schro_params->frame_format);
 
-    avpicture_layout((AVPicture *)in_data, avccontext->pix_fmt,
-                     avccontext->width, avccontext->height,
-                     in_frame->components[0].data,
-                     p_schro_params->frame_size);
+    if (in_frame)
+        avpicture_layout((AVPicture *)in_data, avccontext->pix_fmt,
+                          avccontext->width, avccontext->height,
+                          in_frame->components[0].data,
+                          p_schro_params->frame_size);
 
     return in_frame;
 }
@@ -416,6 +414,6 @@ AVCodec libschroedinger_encoder = {
     libschroedinger_encode_frame,
     libschroedinger_encode_close,
    .capabilities = CODEC_CAP_DELAY,
-   .pix_fmts     = (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
+   .pix_fmts     = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
    .long_name    = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
 };