Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
5b4a2b80
Commit
5b4a2b80
authored
Aug 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix incorrect stream or no audio on insert.
Fixes
#786
parent
055abf4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
5b4a2b80
...
...
@@ -1148,11 +1148,16 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
}
}
}
else
if
(
audioDrop
)
{
//
Using our
target
s
//
Drag & drop, use our first audio
target
audioStream
=
m_audioTarget
.
first
();
}
else
{
// Using target tracks
if
(
m_audioTarget
.
contains
(
trackId
))
{
audioStream
=
m_audioTarget
.
value
(
trackId
);
}
}
res
=
requestClipCreation
(
binIdWithInOut
,
id
,
getTrackById_const
(
trackId
)
->
trackType
(),
audioDrop
?
audioStream
:
-
1
,
1.0
,
false
,
local_undo
,
local_redo
);
res
=
requestClipCreation
(
binIdWithInOut
,
id
,
getTrackById_const
(
trackId
)
->
trackType
(),
audioStream
,
1.0
,
false
,
local_undo
,
local_redo
);
res
=
res
&&
requestClipMove
(
id
,
trackId
,
position
,
true
,
refreshView
,
logUndo
,
logUndo
,
local_undo
,
local_redo
);
QList
<
int
>
target_track
;
if
(
audioDrop
)
{
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
5b4a2b80
...
...
@@ -2213,7 +2213,13 @@ int TimelineController::insertZone(const QString &binId, QPoint zone, bool overw
int
aTrack
=
-
1
;
int
vTrack
=
-
1
;
if
(
clip
->
hasAudio
()
&&
!
m_model
->
m_audioTarget
.
isEmpty
())
{
aTrack
=
m_model
->
m_audioTarget
.
firstKey
();
QList
<
int
>
audioTracks
=
m_model
->
m_audioTarget
.
keys
();
for
(
int
tid
:
audioTracks
)
{
if
(
m_model
->
getTrackById_const
(
tid
)
->
shouldReceiveTimelineOp
())
{
aTrack
=
tid
;
break
;
}
}
}
if
(
clip
->
hasVideo
())
{
vTrack
=
videoTarget
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment