Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

auframe: auframe_bytes_to_timestamp use uint64_t #80

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/rem_auframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ static inline void auframe_update(struct auframe *af, void *sampv,
size_t auframe_size(const struct auframe *af);
void auframe_mute(struct auframe *af);
double auframe_level(struct auframe *af);
size_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n);
uint64_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n);
5 changes: 3 additions & 2 deletions src/auframe/auframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ double auframe_level(struct auframe *af)
}


size_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n)
uint64_t auframe_bytes_to_timestamp(const struct auframe *af, size_t n)
{
size_t sample_size = aufmt_sample_size(af->fmt);

return n * AUDIO_TIMEBASE / (af->srate * af->ch * sample_size);
return ((uint64_t) n) * AUDIO_TIMEBASE /
(af->srate * af->ch * sample_size);
}