diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/encode.h | 1 | ||||
-rw-r--r-- | common/encode_lavc.c | 8 | ||||
-rw-r--r-- | common/encode_lavc.h | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/common/encode.h b/common/encode.h index a4c7d821d9..7d6cacd86a 100644 --- a/common/encode.h +++ b/common/encode.h @@ -18,6 +18,7 @@ bool encode_lavc_showhelp(struct mp_log *log, struct encode_output_conf *options int encode_lavc_getstatus(struct encode_lavc_context *ctx, char *buf, int bufsize, float relative_position); void encode_lavc_expect_stream(struct encode_lavc_context *ctx, int mt); void encode_lavc_set_video_fps(struct encode_lavc_context *ctx, float fps); +void encode_lavc_set_audio_pts(struct encode_lavc_context *ctx, double pts); bool encode_lavc_didfail(struct encode_lavc_context *ctx); // check if encoding failed #endif diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 39787430bf..5f9e2a0390 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -386,6 +386,14 @@ void encode_lavc_set_video_fps(struct encode_lavc_context *ctx, float fps) ctx->vo_fps = fps; } +void encode_lavc_set_audio_pts(struct encode_lavc_context *ctx, double pts) +{ + if (ctx) { + ctx->last_audio_in_pts = pts; + ctx->samples_since_last_pts = 0; + } +} + static void encode_2pass_prepare(struct encode_lavc_context *ctx, AVDictionary **dictp, AVStream *stream, struct stream **bytebuf, diff --git a/common/encode_lavc.h b/common/encode_lavc.h index 96fc17f1bb..deaf42b684 100644 --- a/common/encode_lavc.h +++ b/common/encode_lavc.h @@ -55,6 +55,9 @@ struct encode_lavc_context { double audio_pts_offset; double last_video_in_pts; + double last_audio_in_pts; + int64_t samples_since_last_pts; + // anti discontinuity mode double next_in_pts; double discontinuity_pts_offset; |