diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2020-06-02 00:14:45 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2020-06-19 23:12:49 +0800 |
commit | 548ef7a12b565dff5dc418b378ec158a5566a127 (patch) | |
tree | d17d9b17d6f03722d754c0bdcb75e542b67e0dfc /libavfilter/internal.h | |
parent | 04172d233de58cbb5a2dab6839696628a97c7b52 (diff) |
avfilter: add D2TS, TS2D, TS2T as a common macro in internal.h
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavfilter/internal.h')
-rw-r--r-- | libavfilter/internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/internal.h b/libavfilter/internal.h index abe7537b5d..6cb601f36f 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -234,6 +234,10 @@ void ff_avfilter_link_set_out_status(AVFilterLink *link, int status, int64_t pts void ff_command_queue_pop(AVFilterContext *filter); +#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) +#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) + /* misc trace functions */ #define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func) |