summaryrefslogtreecommitdiff
path: root/ffmpeg_filter.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-10 11:51:02 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-03-10 13:45:15 +0100
commitf9b34b8bf967e8e80df9bcb4a16556a9d4526484 (patch)
treee2d11f970af4565a30b43a4e6303fc426bf35b94 /ffmpeg_filter.c
parentf185a040b0d5f6766c8016cc84b415d414d38246 (diff)
ffmpeg: port sub2video to AVFrame.
And re-enable the FATE test.
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index bdf43638ae..1c30961228 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -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;
}