diff options
author | Jan Ekström <jeebjp@gmail.com> | 2019-02-23 01:48:08 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2020-03-16 19:35:17 +0200 |
commit | 7ba3ea212fc054ba48618bf87018269fee5504ce (patch) | |
tree | 2c70339a4da19c9b67d9e647613b4a5590695951 /fftools/ffmpeg_filter.c | |
parent | 39fbd0631407f6ce7575699248cb05057203af58 (diff) |
ffmpeg: explicitly handle sub2video subpicture initialization
Each time the sub2video structure is initialized, the sub2video
subpicture is initialized together with the first received heartbeat.
The heartbeat's PTS is utilized as the subpicture start time.
Additionally, add some documentation on the stages.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 40cc4c191c..b66faa50b5 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -740,6 +740,12 @@ static int sub2video_prepare(InputStream *ist, InputFilter *ifilter) return AVERROR(ENOMEM); ist->sub2video.last_pts = INT64_MIN; ist->sub2video.end_pts = INT64_MIN; + + /* sub2video structure has been (re-)initialized. + Mark it as such so that the system will be + initialized with the first received heartbeat. */ + ist->sub2video.initialize = 1; + return 0; } @@ -1168,7 +1174,7 @@ int configure_filtergraph(FilterGraph *fg) while (av_fifo_size(ist->sub2video.sub_queue)) { AVSubtitle tmp; av_fifo_generic_read(ist->sub2video.sub_queue, &tmp, sizeof(tmp), NULL); - sub2video_update(ist, &tmp); + sub2video_update(ist, INT64_MIN, &tmp); avsubtitle_free(&tmp); } } |