improved audio scrub
This commit is contained in:
@@ -213,6 +213,7 @@ void Viewer::seek(long p) {
|
||||
update_parents();
|
||||
reset_all_audio();
|
||||
assert_audio_device();
|
||||
audio_scrub = true;
|
||||
}
|
||||
|
||||
void Viewer::go_to_start() {
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ extern "C" {
|
||||
QAudioOutput* audio_output;
|
||||
QIODevice* audio_io_device;
|
||||
bool audio_device_set = false;
|
||||
bool force_audio_send = false;
|
||||
bool audio_scrub = false;
|
||||
QMutex audio_write_lock;
|
||||
QAudioInput* audio_input = NULL;
|
||||
QFile output_recording;
|
||||
@@ -122,7 +122,7 @@ void AudioSenderThread::run() {
|
||||
cond.wait(&lock);
|
||||
if (close) {
|
||||
break;
|
||||
} else if (panel_sequence_viewer->playing || panel_footage_viewer->playing || force_audio_send) {
|
||||
} else if (panel_sequence_viewer->playing || panel_footage_viewer->playing || audio_scrub) {
|
||||
int written_bytes = 0;
|
||||
|
||||
int adjusted_read_index = audio_ibuffer_read%audio_ibuffer_size;
|
||||
@@ -134,7 +134,7 @@ void AudioSenderThread::run() {
|
||||
written_bytes += send_audio_to_output(0, audio_ibuffer_size);
|
||||
}
|
||||
|
||||
force_audio_send = false;
|
||||
audio_scrub = false;
|
||||
}
|
||||
}
|
||||
lock.unlock();
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ extern qint8 audio_ibuffer[audio_ibuffer_size];
|
||||
extern int audio_ibuffer_read;
|
||||
extern long audio_ibuffer_frame;
|
||||
extern double audio_ibuffer_timecode;
|
||||
extern bool force_audio_send;
|
||||
extern bool audio_scrub;
|
||||
void clear_audio_ibuffer();
|
||||
|
||||
void init_audio(Sequence *s);
|
||||
|
||||
@@ -354,7 +354,6 @@ void cache_audio_worker(Clip* c, bool scrubbing, Clip* nest) {
|
||||
audio_write_lock.unlock();
|
||||
|
||||
if (scrubbing) {
|
||||
force_audio_send = true;
|
||||
audio_thread->notifyReceiver();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -437,7 +437,7 @@ GLuint ViewerWidget::compose_sequence(Clip* nest, bool render_audio) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (render_audio || config.enable_audio_scrubbing) {
|
||||
if (render_audio || (config.enable_audio_scrubbing && audio_scrub)) {
|
||||
switch (c->media_type) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
case MEDIA_TYPE_TONE:
|
||||
|
||||
Reference in New Issue
Block a user