From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 47BB742CC3 for ; Tue, 3 May 2022 16:14:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1826568B3BA; Tue, 3 May 2022 19:14:01 +0300 (EEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 635E568B3A1 for ; Tue, 3 May 2022 19:13:59 +0300 (EEST) Received: by mail-qt1-f173.google.com with SMTP id p4so13310905qtq.12 for ; Tue, 03 May 2022 09:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EJy4EkCHTPKT+Md14Uwd3jqv/38w377N1wHEbw0EbuA=; b=K34gBIFkfsSAz2sJxvumoM6rh22agNfdtBypxoFiIcpYWqgbKl0fQzL7GwOJnqneo0 HQX/qpIHxV7GhSTU4yVLnkF67h4ehpZr/LDlPGdkDpPfeGfRvw4bBQBkpRN7IHY9ej73 KR2nXsAdW4o5zdKc1sGnKYUH7BUIL9IG3fYtnwNUG5Rcsq5AiBQnBRk0oggM9C2efBvS Au0F7ARW0HcLe+lwTXUaLms4WQMPBz7BKTTG7sAEwR0MeYAlaD5FruO+8R/kv6KkrIEX ef6krSfxEUdImONYsRNFKlimlD0Wd6b72zgCSxOblq8dso8SUrjbM5OrNFrIRhhXMwdl qsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EJy4EkCHTPKT+Md14Uwd3jqv/38w377N1wHEbw0EbuA=; b=jlYpgfYy6Xon7ui/nLPLsSZtwoJ2/AIxfTir2qLuLlMIFJ1e9iUKQ3OtL3nFSSPXgf kuItOUBVZMhliv6Z4gqeO8g/zGNm2blm9za5jcLaIIrQJ3JRUxcj9XURnagyTrVTiR+o 8ATVKbSs6hIIlNo/kPiD3RGp26EjdkK1zxQb/hW8cuOIJetPRevNXQQBgTPE/nPjljOx ggLwc8NJpnxqn39Vdaye13q3nXooFQOZ3vk17sb5Z4g9BpIFp2ibmJr0kAyia8WWPsQC 4HUg/1Ofi3GOFNcNcpx03+gMY5N0ayHEZymPRmDv8yzapW6wzWHKk2TXYY47S0fo3xrx XJZg== X-Gm-Message-State: AOAM530osAU0CAAwtySZ4DOEHlQzvqYZn0cjL7Hvzql7kNoB+wvBd2Fm 7ZbNG+0E7GaIIr0qUws76fUuo2Gx/7v+ X-Google-Smtp-Source: ABdhPJz6bXOqUr8nqAghKcvODWdN4g+xw7AdEEEivw1AWyGEn7S9lN/ssjHFsSSQC9N8IfgstbgCGA== X-Received: by 2002:a05:622a:14a:b0:2f3:9c08:7971 with SMTP id v10-20020a05622a014a00b002f39c087971mr14170242qtw.117.1651594438096; Tue, 03 May 2022 09:13:58 -0700 (PDT) Received: from thinkpad.. ([66.220.203.136]) by smtp.gmail.com with ESMTPSA id fp35-20020a05622a50a300b002f39b99f67asm5812731qtb.20.2022.05.03.09.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 09:13:57 -0700 (PDT) From: Traian Coza To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 May 2022 12:13:26 -0400 Message-Id: <20220503161328.842587-11-traian.coza@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220503161328.842587-1-traian.coza@gmail.com> References: <20220503161328.842587-1-traian.coza@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/12] Rearranged files, all tests are passing! X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Traian Coza Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- fftools/Makefile | 2 ++ fftools/ffmpeg.c | 6 ++++-- fftools/text_to_bitmap.c | 14 +++----------- fftools/text_to_bitmap.h | 14 ++++---------- libavcodec/Makefile | 1 - libavcodec/avcodec.c | 9 --------- 6 files changed, 13 insertions(+), 33 deletions(-) diff --git a/fftools/Makefile b/fftools/Makefile index 81ad6c4f4f..f9334a5622 100644 --- a/fftools/Makefile +++ b/fftools/Makefile @@ -15,6 +15,8 @@ OBJS-ffmpeg += \ fftools/ffmpeg_mux.o \ fftools/ffmpeg_opt.o \ +OBJS-ffmpeg-$(CONFIG_LIBASS) += fftools/text_to_bitmap.o + define DOFFTOOL OBJS-$(1) += fftools/cmdutils.o fftools/opt_common.o fftools/$(1).o $(OBJS-$(1)-yes) $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1)) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index ae622492ee..251a3ce427 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -72,7 +72,7 @@ # include "libavfilter/buffersink.h" #if CONFIG_LIBASS -#include "libavcodec/text_to_bitmap.h" +#include "fftools/text_to_bitmap.h" #endif #if HAVE_SYS_RESOURCE_H @@ -3239,7 +3239,7 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, return AVERROR_INVALIDDATA; } if (input_props == AV_CODEC_PROP_TEXT_SUB && output_props == AV_CODEC_PROP_BITMAP_SUB) - init_ass_context(input_streams, output_streams, nb_input_streams, nb_output_streams, ost->source_index, ost->index); + init_ass_context(ist, ost); #else if (input_props && output_props && input_props != output_props) { snprintf(error, error_len, @@ -4514,6 +4514,8 @@ static int transcode(void) ist = input_streams[i]; if (ist->decoding_needed) { avcodec_close(ist->dec_ctx); + if (ist->dec_ctx->ass_context != NULL) // This really has to be done here, sorry + free_ass_context(ist->dec_ctx->ass_context); if (ist->hwaccel_uninit) ist->hwaccel_uninit(ist->dec_ctx); } diff --git a/fftools/text_to_bitmap.c b/fftools/text_to_bitmap.c index 52d161d7b1..b4a0157174 100644 --- a/fftools/text_to_bitmap.c +++ b/fftools/text_to_bitmap.c @@ -27,8 +27,8 @@ #include "text_to_bitmap.h" #include "fftools/ffmpeg.h" -#include "avcodec.h" -#include "ass_split.h" +#include "../libavcodec/avcodec.h" +#include "../libavcodec/ass_split.h" /** * Holds the objects used by the rendering function so they don't have to be reinitialized every time @@ -51,16 +51,8 @@ struct ASS_Context { * @param ist_i index of input stream for transcoding * @param ost_i index of output stream for transcoding */ -void init_ass_context( - InputStream **input_streams, - OutputStream **output_streams, - int nb_input_streams, - int nb_output_streams, - int ist_i, - int ost_i) +void init_ass_context(InputStream *ist, OutputStream *ost) { - InputStream *ist = input_streams[ist_i]; - OutputStream *ost = output_streams[ost_i]; if (ist->dec_ctx->ass_context) return; ASS_Context *context = (ASS_Context *)malloc(sizeof(ASS_Context)); diff --git a/fftools/text_to_bitmap.h b/fftools/text_to_bitmap.h index 29037150c2..a9b48c6cf3 100644 --- a/fftools/text_to_bitmap.h +++ b/fftools/text_to_bitmap.h @@ -21,8 +21,8 @@ * text_to_bitmap header file */ -#ifndef AVCODEC_TEXT_TO_BITMAP_H -#define AVCODEC_TEXT_TO_BITMAP_H +#ifndef FFTOOLS_TEXT_TO_BITMAP_H +#define FFTOOLS_TEXT_TO_BITMAP_H #include #include "fftools/ffmpeg.h" @@ -30,14 +30,8 @@ struct ASS_Context; typedef struct ASS_Context ASS_Context; -void init_ass_context( - InputStream **input_streams, - OutputStream **output_streams, - int nb_input_streams, - int nb_output_streams, - int ist_i, - int ost_i); +void init_ass_context(InputStream *ist, OutputStream *ost); void render_avsub_ass(ASS_Context *, AVSubtitle *); void free_ass_context(ASS_Context *context); -#endif //AVCODEC_TEXT_TO_BITMAP_H +#endif //FFTOOLS_TEXT_TO_BITMAP_H diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 6d28513129..cfaa6f196a 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -151,7 +151,6 @@ OBJS-$(CONFIG_RV34DSP) += rv34dsp.o OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_SNAPPY) += snappy.o OBJS-$(CONFIG_STARTCODE) += startcode.o -OBJS-$(CONFIG_LIBASS) += text_to_bitmap.o OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o OBJS-$(CONFIG_TEXTUREDSPENC) += texturedspenc.o OBJS-$(CONFIG_TPELDSP) += tpeldsp.o diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 1e308f39c2..d11f035481 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -42,10 +42,6 @@ #include "thread.h" #include "version.h" -#if CONFIG_LIBASS -#include "libavcodec/text_to_bitmap.h" -#endif - #include "libavutil/ffversion.h" const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION; @@ -538,11 +534,6 @@ av_cold int avcodec_close(AVCodecContext *avctx) } else if (av_codec_is_decoder(avctx->codec)) av_freep(&avctx->subtitle_header); -#if CONFIG_LIBASS - if (av_codec_is_decoder(avctx->codec) && avctx->ass_context != NULL) - free_ass_context(avctx->ass_context); -#endif - avctx->codec = NULL; avctx->active_thread_type = 0; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".