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

cedrik-fuoco-adsk commented Dec 17, 2025

I will cherry-pick the changes for the LTS branch as well.

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

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