diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-03 15:24:25 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-03 15:25:47 +0400 |
commit | 9bec4f777973c066ac12ae5ad2df107be23bdc7b (patch) | |
tree | 22e81bf056a0540936a5666cc9e36fd7a1dd4ecd /intern | |
parent | 15f449c52909d5275feb23d814988ded3369ba62 (diff) |
Fix T38455: Blenderplayer is not working
Was a regression since avg_frame_rate changes.
Didn't find reliable way to get stream duration which will
work with both FFmpeg and Libav so added some freaking black
magic to distinguish one from another.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ffmpeg/ffmpeg_compat.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index 6cae957471d..801ab6e659d 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -419,4 +419,15 @@ void av_frame_free(AVFrame **frame) } #endif +FFMPEG_INLINE +AVRational av_get_r_frame_rate_compat(const AVStream *stream) +{ + /* Stupid way to distinguish FFmpeg from Libav. */ +#if LIBAVCODEC_VERSION_MICRO >= 100 + return stream->r_frame_rate; +#else + return stream->avg_frame_rate; +#endif +} + #endif |