forked from FFmpeg/FFmpeg
fftools/ffmpeg_filter: pass ts offset through OutputFilterOptions
Reduces the need to access OutputFile, which will allow decoupling filtering from encoding in future commits.
This commit is contained in:
parent
651c79da36
commit
b3864e7a08
3 changed files with 5 additions and 2 deletions
|
@ -266,6 +266,8 @@ typedef struct InputFilterOptions {
|
||||||
typedef struct OutputFilterOptions {
|
typedef struct OutputFilterOptions {
|
||||||
// Codec used for encoding, may be NULL
|
// Codec used for encoding, may be NULL
|
||||||
const AVCodec *enc;
|
const AVCodec *enc;
|
||||||
|
|
||||||
|
int64_t ts_offset;
|
||||||
} OutputFilterOptions;
|
} OutputFilterOptions;
|
||||||
|
|
||||||
typedef struct InputFilter {
|
typedef struct InputFilter {
|
||||||
|
|
|
@ -766,7 +766,6 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
|
||||||
unsigned sched_idx_enc,
|
unsigned sched_idx_enc,
|
||||||
const OutputFilterOptions *opts)
|
const OutputFilterOptions *opts)
|
||||||
{
|
{
|
||||||
const OutputFile *of = ost->file;
|
|
||||||
OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
|
OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
|
||||||
FilterGraph *fg = ofilter->graph;
|
FilterGraph *fg = ofilter->graph;
|
||||||
FilterGraphPriv *fgp = fgp_from_fg(fg);
|
FilterGraphPriv *fgp = fgp_from_fg(fg);
|
||||||
|
@ -778,7 +777,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
|
||||||
ofilter->ost = ost;
|
ofilter->ost = ost;
|
||||||
av_freep(&ofilter->linklabel);
|
av_freep(&ofilter->linklabel);
|
||||||
|
|
||||||
ofp->ts_offset = of->start_time == AV_NOPTS_VALUE ? 0 : of->start_time;
|
ofp->ts_offset = opts->ts_offset;
|
||||||
ofp->enc_timebase = ost->enc_timebase;
|
ofp->enc_timebase = ost->enc_timebase;
|
||||||
|
|
||||||
switch (ost->enc_ctx->codec_type) {
|
switch (ost->enc_ctx->codec_type) {
|
||||||
|
|
|
@ -1373,6 +1373,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
|
||||||
(type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {
|
(type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {
|
||||||
OutputFilterOptions opts = {
|
OutputFilterOptions opts = {
|
||||||
.enc = enc,
|
.enc = enc,
|
||||||
|
.ts_offset = mux->of.start_time == AV_NOPTS_VALUE ?
|
||||||
|
0 : mux->of.start_time,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ofilter) {
|
if (ofilter) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue