diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-13 10:29:01 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-05-22 17:10:44 +0200 |
commit | f980df2c043ae95a2b3c046c55838fed568ab925 (patch) | |
tree | c101aa78a6b5a10261b045a30ad06610bd15bc76 /fftools | |
parent | c4a3f7edb834f8359c166bc0afef2f67f231e1a9 (diff) | |
download | ffmpeg-f980df2c043ae95a2b3c046c55838fed568ab925.tar.gz |
fftools/ffmpeg_filter: move InputFilter.type to private data
It is not accessed outside of ffmpeg_filter.
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffmpeg.h | 1 | ||||
-rw-r--r-- | fftools/ffmpeg_filter.c | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index c33e537faa..04c41a5311 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -281,7 +281,6 @@ typedef struct InputFilter { AVFilterContext *filter; struct FilterGraph *graph; uint8_t *name; - enum AVMediaType type; // AVMEDIA_TYPE_SUBTITLE for sub2video } InputFilter; typedef struct OutputFilter { diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index e6e9e00985..5656fa87df 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -60,6 +60,9 @@ typedef struct InputFilterPriv { // used to hold submitted input AVFrame *frame; + // AVMEDIA_TYPE_SUBTITLE for sub2video + enum AVMediaType type; + int eof; // parameters configured for this input @@ -264,6 +267,7 @@ static InputFilter *ifilter_alloc(FilterGraph *fg, InputStream *ist) ifp->format = -1; ifp->fallback.format = -1; ifp->ist = ist; + ifp->type = ist->st->codecpar->codec_type; ifp->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW); if (!ifp->frame_queue) @@ -440,8 +444,6 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in) av_assert0(ist); ifilter = ifilter_alloc(fg, ist); - - ifilter->type = ist->st->codecpar->codec_type; ifilter->name = describe_filter_link(fg, in, 1); ret = ist_filter_add(ist, ifilter, 0); @@ -1457,8 +1459,8 @@ int ifilter_has_all_input_formats(FilterGraph *fg) int i; for (i = 0; i < fg->nb_inputs; i++) { InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]); - if (ifp->format < 0 && (fg->inputs[i]->type == AVMEDIA_TYPE_AUDIO || - fg->inputs[i]->type == AVMEDIA_TYPE_VIDEO)) + if (ifp->format < 0 && (ifp->type == AVMEDIA_TYPE_AUDIO || + ifp->type == AVMEDIA_TYPE_VIDEO)) return 0; } return 1; @@ -1562,7 +1564,7 @@ int ifilter_send_eof(InputFilter *ifilter, int64_t pts, AVRational tb) } } - if (ifp->format < 0 && (ifilter->type == AVMEDIA_TYPE_AUDIO || ifilter->type == AVMEDIA_TYPE_VIDEO)) { + if (ifp->format < 0 && (ifp->type == AVMEDIA_TYPE_AUDIO || ifp->type == AVMEDIA_TYPE_VIDEO)) { av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifp->ist->file_index, ifp->ist->st->index); |