Bug 433601

Summary: kdenlive keeps file handle opened after removing an audio clip
Product: [Applications] kdenlive Reporter: Larsen <larsen007>
Component: Audio Effects & TransitionsAssignee: Jean-Baptiste Mardelle <jb>
Status: CONFIRMED ---    
Severity: normal CC: berndmj, erjiang, fritzibaby
Priority: NOR Keywords: triaged
Version First Reported In: 24.12.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Larsen 2021-02-25 15:25:42 UTC
STEPS TO REPRODUCE
- Extract audio from a clip
- Delete the audio file from the project
- Try to delete the file on disk

OBSERVED RESULT
File cannot be deleted as the file handle is still opened in kdenlive.

EXPECTED RESULT
File handle should be closed after removing a clip from kdenlive.

SOFTWARE/OS VERSIONS
Windows 10
Comment 1 emohr 2021-03-14 17:28:38 UTC
If you have a video clip contains video & audio and you delete the audio part only the clip is blocked on the disk as the Kdenlve still needs the video part of the clip.
Comment 2 Larsen 2021-03-14 18:26:29 UTC
After I have extracted audio this is a separate file (.wav), isn' it?
Comment 3 erjiang 2022-07-23 06:01:39 UTC
Looks like this happens on Linux too from checking `lsof`:

kdenlive 125055 eric  136r      REG               0,53  45830290   586247 /home/videos/testclip0001.wav (deleted)

Clip was already removed from Project Bin.
Comment 4 Bernd 2024-12-24 01:06:01 UTC
Hi and thank you for your patience.

Your bug report was for a version of Kdenlive that is at least four years old. Can you please check whether this issue still exists in the latest version 24.12.0?

If yes, please update this report to reflect the new version and set the status to CONFIRMED.

If it works now like you expect it would, you may change the status of this report to RESOLVED - FIXED.

At any rate, this report will be closed if there is no activity for the next 30 days.
Comment 5 Larsen 2024-12-24 20:45:59 UTC
Still happens with 24.12.0
Comment 6 emohr 2024-12-25 11:30:58 UTC
I can confirm that Kdenlive blocks the file on disk to delete/move even if the clip is deleted in the project bin. 
Here the steps: 
- add an A/V clip to the project bin
- extract the audio
- delete the A/V clip in the project bin

You can’t move the AV clip on the disk as Kdenlive still blocks the A/V clip.
That should not be and I guess it blocks memory as well.