Skip to content

Conversation

@cedrik-fuoco-adsk
Copy link
Contributor

Fix logging in MovieFFmpeg with multiple threads

Linked issues

n/a

Summarize your change.

The mechanism used to prevent duplicate log messages in MovieFFmpeg.cpp did not work correctly in a multithreaded context.
This PR refactors the code to use std::once_flag and std::call_once, which is more robust.

Describe the reason for the change.

This issue was discovered while testing another fix. When opening RV from the command line and passing a media file as a parameter, the same log messages were printed multiple times and became intertwined.

Example:
WARNING: FFmpeg detected pixel format AV_PIX_FMT_NONE for frames in WARNING: FFmpeg detected pixel format AV_PIX_FMT_NONE for frames in media.avi. Using fallback pixel format: WARNING: FFmpeg detected pixel format AV_PIX_FMT_NONE for frames in

After the fix:
WARNING: FFmpeg detected pixel format AV_PIX_FMT_NONE for frames in media.avi. Using fallback pixel format: bgr24

Describe what you have tested and on which operating system.

Rocky Linux 9.6

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk
Copy link
Contributor Author

@bernie-laberge Could you review this? It does not require any testing.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk cedrik-fuoco-adsk force-pushed the fix-movieffmpeg-log-threading-issue branch from 03478ba to bf0a501 Compare January 9, 2026 14:03
@cedrik-fuoco-adsk
Copy link
Contributor Author

@bernie-laberge Do you mind re-approving this PR? You had previously approved it, but I had to recreate it.

Copy link
Contributor

@bernie-laberge bernie-laberge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cedrik-fuoco-adsk cedrik-fuoco-adsk merged commit 07eb5e2 into AcademySoftwareFoundation:main Jan 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants