From 38069c6f9ceb457620293cb91ceba2a8f3cdcf9a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Jan 2019 19:11:53 +1100 Subject: [PATCH] deselect clips underneath when deleting --- panels/timeline.cpp | 1 + playback/audio.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 84f18808a..c65838279 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -830,6 +830,7 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector& area } } } + deselect_area(s.in, s.out, s.track); } relink_clips_using_ids(pre_clips, post_clips); ca->append(new AddClipCommand(sequence, post_clips)); diff --git a/playback/audio.cpp b/playback/audio.cpp index bfdf8972e..87be6a646 100644 --- a/playback/audio.cpp +++ b/playback/audio.cpp @@ -166,7 +166,7 @@ void AudioSenderThread::run() { int AudioSenderThread::send_audio_to_output(int offset, int max) { // send audio to device - int actual_write = audio_io_device->write((const char*) audio_ibuffer+offset, max); + unsigned long actual_write = audio_io_device->write((const char*) audio_ibuffer+offset, max); unsigned long audio_ibuffer_limit = audio_ibuffer_read + actual_write; @@ -185,19 +185,20 @@ int AudioSenderThread::send_audio_to_output(int offset, int max) { } int channel_count = av_get_channel_layout_nb_channels(s->audio_layout); long sample_cache_playhead = panel_timeline->audio_monitor->sample_cache_offset + (panel_timeline->audio_monitor->sample_cache.size()/channel_count); - int next_buffer_offset, buffer_offset_adjusted, i; - int buffer_offset = get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead); + unsigned long next_buffer_offset, buffer_offset_adjusted; + int i; + unsigned long buffer_offset = get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead); if (samples.size() != channel_count) samples.resize(channel_count); samples.fill(0); // TODO: I don't like this, but i'm not sure if there's a smarter way to do it - while (buffer_offset < audio_ibuffer_limit) { + while (static_cast(buffer_offset) < audio_ibuffer_limit) { sample_cache_playhead++; - next_buffer_offset = qMin(get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead), audio_ibuffer_limit); + next_buffer_offset = qMin(get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead), static_cast(audio_ibuffer_limit)); while (buffer_offset < next_buffer_offset) { for (i=0;i