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
path: root/intern
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-06-09 22:03:07 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-06-11 15:04:48 +0300
commit4adbe31e2fc98f982aed3d97505513750ec348d4 (patch)
tree002cc553168d9712b6b935fcb3acae09fb55fc99 /intern
parent1fb2eaf1c5ed4f7fc121c24c9b6daa37331cf8ee (diff)
Fix: VSE indexer seeking not working correctly
Because of the added sanity checks in rB14508ef100c9 (D11492), seeking in proxies would not work correctly any more. This is because it wasn't working as intended before, but in most cases this wouldn't be noticeable. However now when the sanity checks are tripped it is very noticeable that something is wrong The indexer tried to use dts values for time stamps when we used pts in our decode functions to get the time positions. This would make it start in the wrong GOP frames when searching. Now that we enforce no crossing of GOP frames when decoding after seek, this would lead to issues. Now we correctly use pts (or dts if pts is not available) and thus we don't have any seeking issues because of time stamp format missmatch. Reviewed By: Richard Antalik Differential Revision: http://developer.blender.org/D11561
Diffstat (limited to 'intern')
-rw-r--r--intern/ffmpeg/ffmpeg_compat.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index 0c22cf82688..ce4bfc7d5e2 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -113,22 +113,23 @@ void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
}
FFMPEG_INLINE
-int64_t av_get_pts_from_frame(AVFormatContext *avctx, AVFrame *picture)
+int64_t timestamp_from_pts_or_dts(int64_t pts, int64_t dts)
{
- int64_t pts;
- pts = picture->pts;
-
- if (pts == AV_NOPTS_VALUE) {
- pts = picture->pkt_dts;
- }
+ /* Some videos do not have any pts values, use dts instead in those cases if
+ * possible. Usually when this happens dts can act as pts because as all frames
+ * should then be presented in their decoded in order. IE pts == dts. */
if (pts == AV_NOPTS_VALUE) {
- pts = 0;
+ return dts;
}
-
- (void)avctx;
return pts;
}
+FFMPEG_INLINE
+int64_t av_get_pts_from_frame(AVFrame *picture)
+{
+ return timestamp_from_pts_or_dts(picture->pts, picture->pkt_dts);
+}
+
/* -------------------------------------------------------------------- */
/** \name Deinterlace code block
*