From patchwork Sun Feb 12 14:35:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Dekker X-Patchwork-Id: 2516 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp503180vsb; Sun, 12 Feb 2017 06:35:41 -0800 (PST) X-Received: by 10.28.71.133 with SMTP id m5mr14147849wmi.132.1486910141702; Sun, 12 Feb 2017 06:35:41 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 32si9867226wrn.333.2017.02.12.06.35.41; Sun, 12 Feb 2017 06:35:41 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li; dkim=neutral (body hash did not verify) header.i=@messagingengine.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AEFF5689DCC; Sun, 12 Feb 2017 16:35:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8FF59689888 for ; Sun, 12 Feb 2017 16:35:26 +0200 (EET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5590C2082A for ; Sun, 12 Feb 2017 09:35:30 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sun, 12 Feb 2017 09:35:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=itanimul.li; h= date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=1W5 WQ3Lmz1lpX84FRTI2Vw+qy4I=; b=fx91TUWgeU1AJHqqk0MW1x53/hILHBe6Cfo xOGUplDYzXX8FLnd0zhYEppkgi9awvtT8n2SpHaRMv9HQaUjtGl44lELu0RO8U9F fuSiXM/4q1oZ21K1/o+eL8EYin+mnHu8cfbj9OCxJocu7gdijnpuF3d4Tszgurvs XwwShie0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=smtpout; bh=1W5WQ3Lmz1lpX84FRTI2Vw+qy4I=; b=jWdd6 GCzKpGdqnnsNux/3OZ/XSL+UboSVyJSDR+rX7ISYo9i1zB50YgUMB68Mv+IbzSn6 uQa+xGL99Z0bh0UzRGWPg2MZZ9P/UlRtrdPYr0Awh/dbBi8C7OpgeBQX5ZjkI9ZU lxC/StlVg2MN81EwHSaIujppy4IwEy7zw+rlVM= X-ME-Sender: X-Sasl-enc: a4txAZ7Rbjf61xnAXgPB9TZGcBABbzQSBEa00Yhh7i1a 1486910129 Received: from localhost (cpc75394-sotn16-2-0-cust168.15-1.cable.virginm.net [82.22.8.169]) by mail.messagingengine.com (Postfix) with ESMTPA id E4B047E2E6 for ; Sun, 12 Feb 2017 09:35:29 -0500 (EST) From: Josh de Kock To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Feb 2017 14:35:26 +0000 Message-Id: <20170212143526.95303-1-josh@itanimul.li> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH v2] lavc/libzvbi: remove deprecated API usage X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi Carl, I'm not sure, 0.2.28 doesn't compile on my system. It has been tested with the latest version 0.2.38. Does the updated patch look better? Josh Signed-off-by: Josh de Kock --- libavcodec/libzvbi-teletextdec.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index d1f0a9f..290e89f 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -41,6 +41,7 @@ #define BITMAP_CHAR_WIDTH 12 #define BITMAP_CHAR_HEIGHT 10 #define MAX_SLICES 64 +#define VBI_VERSION (VBI_VERSION_MAJOR * 10000 + VBI_VERSION_MINOR * 100 + VBI_VERSION_MICRO) typedef struct TeletextPage { @@ -395,7 +396,11 @@ static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_si if (!ctx->vbi) { if (!(ctx->vbi = vbi_decoder_new())) return AVERROR(ENOMEM); +#if VBI_VERSION >= 234 // 0.2.34 + if (!vbi_event_handler_register(ctx->vbi, VBI_EVENT_TTX_PAGE, handler, ctx)) { +#else if (!vbi_event_handler_add(ctx->vbi, VBI_EVENT_TTX_PAGE, handler, ctx)) { +#endif vbi_decoder_delete(ctx->vbi); ctx->vbi = NULL; return AVERROR(ENOMEM); @@ -524,8 +529,14 @@ static int teletext_close_decoder(AVCodecContext *avctx) subtitle_rect_free(&ctx->pages[--ctx->nb_pages].sub_rect); av_freep(&ctx->pages); - vbi_decoder_delete(ctx->vbi); - ctx->vbi = NULL; + if (ctx->vbi) { +#if VBI_VERSION >= 234 // 0.2.34 + vbi_event_handler_unregister(ctx->vbi, handler, ctx); +#endif + vbi_decoder_delete(ctx->vbi); + ctx->vbi = NULL; + } + ctx->pts = AV_NOPTS_VALUE; if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP)) ctx->readorder = 0;