Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Bug: Fix collect_sequence_frame_data crash with Standalone Publisher …
Browse files Browse the repository at this point in the history
…for fps value not found
  • Loading branch information
Cyprien CAILLOT committed Sep 11, 2024
1 parent d9731d0 commit a0adb09
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ def process(self, instance):
instance.data[key] = value
self.log.debug(f"Collected Frame range data '{key}':{value} ")


def get_frame_data_from_repre_sequence(self, instance):
repres = instance.data.get("representations")
asset_data = instance.data["assetEntity"]["data"]

if repres:
first_repre = repres[0]
Expand All @@ -67,10 +65,22 @@ def get_frame_data_from_repre_sequence(self, instance):
collection = collections[0]
repres_frames = list(collection.indexes)

fps = None
# Try to retrieve the FPS value from the asset else the project
if "assetEntity" in instance.context.data:
fps = instance.data["assetEntity"]["data"].get("fps", None)
if not fps and "projectEntity" in instance.context.data:
fps = instance.context.data["projectEntity"]["data"].get("fps", None)

if fps is None:
self.log.warning("Cannot properly retrieve the FPS value."
" Skipping to avoid crash later in the process.")
return

return {
"frameStart": repres_frames[0],
"frameEnd": repres_frames[-1],
"handleStart": 0,
"handleEnd": 0,
"fps": asset_data["fps"]
"fps": fps
}

0 comments on commit a0adb09

Please sign in to comment.