Fix: incorrect ffmpeg video length estimation logic
71f2229b0 added a workaround for video files that contain entirely
incorrect stream duration, and corrects that by using container
duration instead. However it used math of `seconds=frames*rate` instead
`seconds=frames/rate`, effectively always ending up falling back to
container instead of stream duration.
Pull Request: https://projects.blender.org/blender/blender/pulls/126368
This commit is contained in:
committed by
Aras Pranckevicius
parent
4e6dff2995
commit
8903205dd9
@@ -270,7 +270,7 @@ static int startffmpeg(ImBufAnim *anim)
|
||||
/* Sanity check on the detected duration. This is to work around corruption like reported in
|
||||
* #68091. */
|
||||
if (frame_rate.den != 0 && pFormatCtx->duration > 0) {
|
||||
double stream_sec = anim->duration_in_frames * av_q2d(frame_rate);
|
||||
double stream_sec = anim->duration_in_frames / av_q2d(frame_rate);
|
||||
double container_sec = pFormatCtx->duration / double(AV_TIME_BASE);
|
||||
if (stream_sec > 4.0 * container_sec) {
|
||||
/* The stream is significantly longer than the container duration, which is
|
||||
|
||||
Reference in New Issue
Block a user