mirror of https://github.com/mpv-player/mpv
demux_lavf: use avg_frame_rate instead of r_frame_rate
r_frame_rate was deprecated and was finally removed from Libav and FFmpeg git. Not sure what's the correct replacement. avg_frame_rate may or may not be worse than the fallback of using the time_base as guess. The framerate is mostly unused, but needed for frame-based subtitles and for encoding. (It appears encoding guesses a timebase based on the FPS, and I'm not sure why we don't just use the source timebase.)
This commit is contained in:
parent
d8bde114fd
commit
dfe7b3898d
|
@ -369,8 +369,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i)
|
|||
* heuristic makes up works with subtitles in practice.
|
||||
*/
|
||||
double fps;
|
||||
if (st->r_frame_rate.num)
|
||||
fps = av_q2d(st->r_frame_rate);
|
||||
if (st->avg_frame_rate.num)
|
||||
fps = av_q2d(st->avg_frame_rate);
|
||||
else
|
||||
fps = 1.0 / FFMAX(av_q2d(st->time_base),
|
||||
av_q2d(st->codec->time_base) *
|
||||
|
|
Loading…
Reference in New Issue