From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 17/21] fftools/ffmpeg: move fix_sub_duration_heartbeat() to ffmpeg_dec
Date: Wed, 14 Jun 2023 18:49:04 +0200
Message-ID: <20230614164908.28712-17-anton@khirnov.net> (raw)
In-Reply-To: <20230614164908.28712-1-anton@khirnov.net>
This way ffmpeg.c does not need to access InputStream.prev_sub and it
can be made private.
---
fftools/ffmpeg.c | 18 ------------------
fftools/ffmpeg.h | 2 +-
fftools/ffmpeg_dec.c | 20 +++++++++++++++++++-
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 4e6205e3cb..435e12a37b 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -768,24 +768,6 @@ int subtitle_wrap_frame(AVFrame *frame, AVSubtitle *subtitle, int copy)
return 0;
}
-static int fix_sub_duration_heartbeat(InputStream *ist, int64_t signal_pts)
-{
- int ret = AVERROR_BUG;
- AVSubtitle *prev_subtitle = &ist->prev_sub.subtitle;
- AVSubtitle subtitle;
-
- if (!ist->fix_sub_duration || !prev_subtitle->num_rects ||
- signal_pts <= prev_subtitle->pts)
- return 0;
-
- if ((ret = copy_av_subtitle(&subtitle, prev_subtitle)) < 0)
- return ret;
-
- subtitle.pts = signal_pts;
-
- return process_subtitle(ist, &subtitle);
-}
-
int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt)
{
OutputFile *of = output_files[ost->file_index];
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 5d60da085b..b4b55f5a73 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -879,7 +879,7 @@ OutputStream *ost_iter(OutputStream *prev);
void close_output_stream(OutputStream *ost);
int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt);
-int process_subtitle(InputStream *ist, AVSubtitle *subtitle);
+int fix_sub_duration_heartbeat(InputStream *ist, int64_t signal_pts);
void update_benchmark(const char *fmt, ...);
/**
diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c
index 996e7318d9..879101fe21 100644
--- a/fftools/ffmpeg_dec.c
+++ b/fftools/ffmpeg_dec.c
@@ -376,7 +376,7 @@ static void sub2video_flush(InputStream *ist)
}
}
-int process_subtitle(InputStream *ist, AVSubtitle *subtitle)
+static int process_subtitle(InputStream *ist, AVSubtitle *subtitle)
{
int got_output = 1;
int ret = 0;
@@ -428,6 +428,24 @@ out:
return ret;
}
+int fix_sub_duration_heartbeat(InputStream *ist, int64_t signal_pts)
+{
+ int ret = AVERROR_BUG;
+ AVSubtitle *prev_subtitle = &ist->prev_sub.subtitle;
+ AVSubtitle subtitle;
+
+ if (!ist->fix_sub_duration || !prev_subtitle->num_rects ||
+ signal_pts <= prev_subtitle->pts)
+ return 0;
+
+ if ((ret = copy_av_subtitle(&subtitle, prev_subtitle)) < 0)
+ return ret;
+
+ subtitle.pts = signal_pts;
+
+ return process_subtitle(ist, &subtitle);
+}
+
static int transcode_subtitles(InputStream *ist, const AVPacket *pkt,
AVFrame *frame)
{
--
2.40.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".
next prev parent reply other threads:[~2023-06-14 16:51 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 16:48 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg_dec: drop always-0 InputStream.prev_sub.ret Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg_dec: simplify process_subtitle() Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 03/21] tests/fate: rename ffmpeg-streamloop to ffmpeg-streamloop-copy Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 04/21] tests/fate: add a test for -streamloop with transcoding video+audio Anton Khirnov
2023-06-14 16:57 ` Andreas Rheinhardt
2023-06-16 6:01 ` [FFmpeg-devel] [PATCH 04/21 v2] " Anton Khirnov
2023-06-19 10:52 ` "zhilizhao(赵志立)"
2023-06-19 12:29 ` James Almer
2023-06-19 12:34 ` "zhilizhao(赵志立)"
2023-06-19 13:22 ` James Almer
2023-06-19 13:39 ` Zhao Zhili
2023-06-19 15:48 ` Lynne
2023-06-19 20:33 ` Martin Storsjö
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 05/21] fftools/ffmpeg_demux: move the loop out of add_input_streams() Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 06/21] fftools/ffmpeg_demux: reindent after previous commit Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 07/21] fftools/ffmpeg_hw: inline hwaccel_decode_init() into its caller Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_dec: remove pointless InputStream.hwaccel_retrieve_data Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_dec: move InputStream.hwaccel_pix_fmt to Decoder Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 10/21] fftools/ffmpeg_enc: move dup_warning global variable to Encoder Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add an AVClass to FilterGraph Anton Khirnov
2023-06-14 16:48 ` [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: reject filtergraphs with zero outputs Anton Khirnov
2023-06-14 16:53 ` Paul B Mahol
2023-06-14 17:00 ` Anton Khirnov
2023-06-14 17:11 ` Paul B Mahol
2023-06-14 17:14 ` Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 13/21] fftools/ffmpeg_filter: make configure_filtergraph() static Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg_dec: stop using Decoder.pkt Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 15/21] fftools/ffmpeg: attach bits_per_raw_sample information to frames Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg_dec: move decoding to a separate thread Anton Khirnov
2023-06-16 20:58 ` Michael Niedermayer
2023-06-17 2:55 ` Anton Khirnov
2023-06-14 16:49 ` Anton Khirnov [this message]
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 18/21] fftools/ffmpeg_dec: move InputStream.prev_sub to Decoder Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 19/21] fftools/ffmpeg_enc: constify the subtitle passed to enc_subtitle() Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: use AVFrame to pass subtitles from decoders to filters Anton Khirnov
2023-06-14 16:49 ` [FFmpeg-devel] [PATCH 21/21] fftools/ffmpeg: pass subtitle decoder dimensions to sub2video Anton Khirnov
2023-06-18 8:35 ` [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg_dec: drop always-0 InputStream.prev_sub.ret Anton Khirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230614164908.28712-17-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git