mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 01:40:04 +01:00
ffmpeg: delay processing of subtitles before filters are initialized
If a subtitle packet came before the first video frame could be fully decoded, the subtitle packet would get discarded. This puts the subtitle into a queue instead, and processes it once the attached filter graph is initialized.
This commit is contained in:
3
ffmpeg.h
3
ffmpeg.h
@@ -337,6 +337,7 @@ typedef struct InputStream {
|
||||
struct sub2video {
|
||||
int64_t last_pts;
|
||||
int64_t end_pts;
|
||||
AVFifoBuffer *sub_queue; ///< queue of AVSubtitle* before filter init
|
||||
AVFrame *frame;
|
||||
int w, h;
|
||||
} sub2video;
|
||||
@@ -636,6 +637,8 @@ int filtergraph_is_simple(FilterGraph *fg);
|
||||
int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
|
||||
int init_complex_filtergraph(FilterGraph *fg);
|
||||
|
||||
void sub2video_update(InputStream *ist, AVSubtitle *sub);
|
||||
|
||||
int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
|
||||
|
||||
int ffmpeg_parse_options(int argc, char **argv);
|
||||
|
||||
Reference in New Issue
Block a user