History

avformat/movenc: Avoid floats & float rounding in tmcd nb_frames calculation

Michael Niedermayer committed 11 years ago

Commit 894d8cf1 parent f902b0b1 file · +1 −1Browse files

Unified · Split

libavformat/movenc.c+1−1
@@ -1801,7 +1801,7 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track) · 1800 unmodified lines
18011801 int64_t pos = avio_tell(pb);
18021802 #if 1
18031803 int frame_duration = av_rescale(track->timescale, track->enc->time_base.num, track->enc->time_base.den);
1804− int nb_frames = 1.0/av_q2d(track->enc->time_base) + 0.5;
1804+ int nb_frames = ROUNDED_DIV(track->enc->time_base.den, track->enc->time_base.num);
18051805 AVDictionaryEntry *t = NULL;
18061806
18071807 if (nb_frames > 255) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t