summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-09 08:52:53 +0100
committerwm4 <wm4@nowhere>2013-03-13 23:51:30 +0100
commitdfe7b3898da2e6f9036de0c5c13dccf4a8ca45f7 (patch)
tree11b0f95c640dc31fbeecf600d49bb42b228c8ee8 /demux
parentd8bde114fd9685111274713c03985c72de3377b1 (diff)
downloadmpv-dfe7b3898da2e6f9036de0c5c13dccf4a8ca45f7.tar.bz2
mpv-dfe7b3898da2e6f9036de0c5c13dccf4a8ca45f7.tar.xz
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.)
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 843bd171e4..ba34e7acfa 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -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) *