Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ffmpeg/ffmpeg_compat.h')
-rw-r--r--intern/ffmpeg/ffmpeg_compat.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index fae8590568d..d8172902a4c 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -71,6 +71,7 @@
#define avio_open url_fopen
#define avio_tell url_ftell
#define avio_close url_fclose
+#define avio_size url_fsize
#endif
/* there are some version inbetween, which have avio_... functions but no
@@ -130,4 +131,19 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
}
#endif
+static inline
+int64_t av_get_pts_from_frame(AVFormatContext *avctx, AVFrame * picture)
+{
+ int64_t pts = picture->pkt_pts;
+
+ if (pts == AV_NOPTS_VALUE) {
+ pts = picture->pkt_dts;
+ }
+ if (pts == AV_NOPTS_VALUE) {
+ pts = 0;
+ }
+
+ return pts;
+}
+
#endif