Bug 476612

Summary: Audio track corrupted after replace clip
Product: [Applications] kdenlive Reporter: red_Arti <jijiliu35>
Component: Rendering & ExportAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: git-master   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: bug-replacing-clip-audio
screen-record

Description red_Arti 2023-11-06 05:37:17 UTC
Created attachment 162892 [details]
bug-replacing-clip-audio

SUMMARY
If you replace a video clip with another video file (both two video files have pictures and sounds), somtimes the audio fail on the Kdenlive track.


STEPS TO REPRODUCE
1. Add 1.mkv to Kdenlive track. The picture and sound are both okay.
2. Right-click 1.mkv in the list, replace 1.mkv with 1.mp4 (by context-menu in the list)

1.mkv and 1.mp4 have same content. The difference is the sequence of audio and video stream.
Streams of 1.mkv : 0-audio 1-video
Streams of 1.mp4 : 0-video 1-audio

OBSERVED RESULT
The already-added-and-replaced clip in Kdenlive track fail to have audio.

EXPECTED RESULT
The already-added-and-replaced clip in Kdenlive track have audio correctly

SOFTWARE/OS VERSIONS
Kdenlive 23.08.2

ADDITIONAL INFORMATION
After replacing, if you drag 1.mp4 from list to track, to create another new instance on Kdenlive track, the new one has audio.
Comment 1 red_Arti 2023-11-06 05:39:24 UTC
Created attachment 162893 [details]
screen-record
Comment 2 Jean-Baptiste Mardelle 2023-11-06 12:43:23 UTC
Git commit 58e9d76d375c59e6fd9c2bdc128edf9d660d950f by Jean-Baptiste Mardelle.
Committed on 06/11/2023 at 13:43.
Pushed by mardelle into branch 'master'.

Fix replace clip keeping audio index from previous clip, sometimes breaking audio.

M  +12   -2    src/bin/projectclip.cpp
M  +2    -2    src/mltcontroller/clipcontroller.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/58e9d76d375c59e6fd9c2bdc128edf9d660d950f
Comment 3 Jean-Baptiste Mardelle 2023-11-06 16:57:50 UTC
Git commit aa68d9e2e5dc3c2f16edc7865a69acc9fa3ecb18 by Jean-Baptiste Mardelle.
Committed on 06/11/2023 at 17:57.
Pushed by mardelle into branch 'release/23.08'.

Fix replace clip keeping audio index from previous clip, sometimes breaking audio.

M  +12   -2    src/bin/projectclip.cpp
M  +2    -2    src/mltcontroller/clipcontroller.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/aa68d9e2e5dc3c2f16edc7865a69acc9fa3ecb18