diff options
author | wm4 <wm4@nowhere> | 2016-11-10 11:44:20 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-11-10 12:06:17 +0100 |
commit | 98e7b4e538d42b6df1aa3c5f4a4c6c162a06b737 (patch) | |
tree | 66ebf1b3ae7dc438a2495691540a6867e26f0a89 /video/out/cocoa_common.m | |
parent | ca175871cd509f5bd629597c1e0417d4243b9742 (diff) | |
download | mpv-98e7b4e538d42b6df1aa3c5f4a4c6c162a06b737.tar.bz2 mpv-98e7b4e538d42b6df1aa3c5f4a4c6c162a06b737.tar.xz |
av_common: always make sure to return a valid timebase
av_reduce(&num, &den, 1, 14112000, 1000000) can return num=0, den=1.
This means a 1/14112000 timebase (as used by the mp3 demuxer) would
become invalid.
The intention of mp_get_codec_timebase() is to always return a valid
timebase. av_reduce() probably does the logically correct thing - so add
a fallback to the safe default timebase.
Also, increase the av_reduce() parameter to INT_MAX. Let's just pray
this doesn't cause any actual problems. libavformat does the same, but
might be in a different position due to using av_rescale() etc., while
we convert between fractional timestamps and floats.
Diffstat (limited to 'video/out/cocoa_common.m')
0 files changed, 0 insertions, 0 deletions