You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/imf: relocate static function imf_time_to_ts()
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
committed by
Zane van Iperen
parent
f8dc89b34d
commit
9ca4d80d6b
@@ -154,6 +154,25 @@ static int imf_uri_is_dos_abs_path(const char *string)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base)
|
||||||
|
{
|
||||||
|
int dst_num;
|
||||||
|
int dst_den;
|
||||||
|
AVRational r;
|
||||||
|
|
||||||
|
r = av_div_q(t, time_base);
|
||||||
|
|
||||||
|
if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (dst_den != 1)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
*ts = dst_num;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a ASSETMAP XML file to extract the UUID-URI mapping of assets.
|
* Parse a ASSETMAP XML file to extract the UUID-URI mapping of assets.
|
||||||
* @param s the current format context, if any (can be NULL).
|
* @param s the current format context, if any (can be NULL).
|
||||||
@@ -772,25 +791,6 @@ static int get_resource_context_for_timestamp(AVFormatContext *s, IMFVirtualTrac
|
|||||||
return AVERROR_STREAM_NOT_FOUND;
|
return AVERROR_STREAM_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base)
|
|
||||||
{
|
|
||||||
int dst_num;
|
|
||||||
int dst_den;
|
|
||||||
AVRational r;
|
|
||||||
|
|
||||||
r = av_div_q(t, time_base);
|
|
||||||
|
|
||||||
if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (dst_den != 1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
*ts = dst_num;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int imf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
static int imf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
IMFVirtualTrackResourcePlaybackCtx *resource = NULL;
|
IMFVirtualTrackResourcePlaybackCtx *resource = NULL;
|
||||||
|
Reference in New Issue
Block a user