]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg_filter.c
ffmpeg: add OPT_INPUT to -guess_layout_max.
[ffmpeg] / ffmpeg_filter.c
index 1919f78e24c0161d3968faf03d5291af6d946b01..056b1df1c1ff28cfd7b1fe1cf181f41eaccceb9b 100644 (file)
@@ -141,7 +141,7 @@ static char *choose_ ## var ## s(OutputStream *ost)                            \
     if (ost->st->codec->var != none) {                                         \
         get_name(ost->st->codec->var);                                         \
         return av_strdup(name);                                                \
-    } else if (ost->enc->supported_list) {                                     \
+    } else if (ost->enc && ost->enc->supported_list) {                         \
         const type *p;                                                         \
         AVIOContext *s = NULL;                                                 \
         uint8_t *ret;                                                          \
@@ -290,7 +290,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
 
     snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
     ret = avfilter_graph_create_filter(&ofilter->filter,
-                                       avfilter_get_by_name("ffbuffersink"),
+                                       avfilter_get_by_name("buffersink"),
                                        name, NULL, NULL, fg->graph);
     av_freep(&buffersink_params);
 
@@ -376,7 +376,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
     params->all_channel_counts = 1;
     snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
     ret = avfilter_graph_create_filter(&ofilter->filter,
-                                       avfilter_get_by_name("ffabuffersink"),
+                                       avfilter_get_by_name("abuffersink"),
                                        name, NULL, params, fg->graph);
     av_freep(&params);
     if (ret < 0)
@@ -501,9 +501,7 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
 static int sub2video_prepare(InputStream *ist)
 {
     AVFormatContext *avf = input_files[ist->file_index]->ctx;
-    int i, ret, w, h;
-    uint8_t *image[4];
-    int linesize[4];
+    int i, w, h;
 
     /* Compute the size of the canvas for the subtitles stream.
        If the subtitles codec has set a size, use it. Otherwise use the
@@ -530,17 +528,9 @@ static int sub2video_prepare(InputStream *ist)
        palettes for all rectangles are identical or compatible */
     ist->resample_pix_fmt = ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
 
-    ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32);
-    if (ret < 0)
-        return ret;
-    memset(image[0], 0, h * linesize[0]);
-    ist->sub2video.ref = avfilter_get_video_buffer_ref_from_arrays(
-            image, linesize, AV_PERM_READ | AV_PERM_PRESERVE,
-            w, h, AV_PIX_FMT_RGB32);
-    if (!ist->sub2video.ref) {
-        av_free(image[0]);
+    ist->sub2video.frame = av_frame_alloc();
+    if (!ist->sub2video.frame)
         return AVERROR(ENOMEM);
-    }
     return 0;
 }