merged master
This commit is contained in:
+6
-1
@@ -8,6 +8,7 @@
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/viewer.h"
|
||||
#include "ui/audiomonitor.h"
|
||||
#include "playback/playback.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <QApplication>
|
||||
@@ -106,9 +107,13 @@ void clear_audio_ibuffer() {
|
||||
if (audio_thread != NULL) audio_thread->lock.unlock();
|
||||
}
|
||||
|
||||
int current_audio_freq() {
|
||||
return rendering ? sequence->audio_frequency : audio_output->format().sampleRate();
|
||||
}
|
||||
|
||||
int get_buffer_offset_from_frame(double framerate, long frame) {
|
||||
if (frame >= audio_ibuffer_frame) {
|
||||
return qFloor(((double) (frame - audio_ibuffer_frame)/framerate)*audio_output->format().sampleRate())*av_get_bytes_per_sample(AV_SAMPLE_FMT_S16)*av_get_channel_layout_nb_channels(AV_CH_LAYOUT_STEREO);
|
||||
return qFloor(((double) (frame - audio_ibuffer_frame)/framerate)*current_audio_freq())*av_get_bytes_per_sample(AV_SAMPLE_FMT_S16)*av_get_channel_layout_nb_channels(AV_CH_LAYOUT_STEREO);
|
||||
} else {
|
||||
dout << "[WARNING] Invalid values passed to get_buffer_offset_from_frame";
|
||||
return 0;
|
||||
|
||||
@@ -43,6 +43,8 @@ extern double audio_ibuffer_timecode;
|
||||
extern bool audio_scrub;
|
||||
void clear_audio_ibuffer();
|
||||
|
||||
int current_audio_freq();
|
||||
|
||||
bool is_audio_device_set();
|
||||
|
||||
void init_audio();
|
||||
|
||||
+513
-513
File diff suppressed because it is too large
Load Diff
@@ -116,11 +116,11 @@ double get_timecode(Clip* c, long playhead) {
|
||||
|
||||
void get_clip_frame(Clip* c, long playhead) {
|
||||
if (c->finished_opening) {
|
||||
FootageStream* ms = c->media->to_footage()->get_stream_from_file_index(c->track < 0, c->media_stream);
|
||||
const FootageStream* ms = c->media->to_footage()->get_stream_from_file_index(c->track < 0, c->media_stream);
|
||||
|
||||
int64_t target_pts = qMax(static_cast<int64_t>(0), playhead_to_timestamp(c, playhead));
|
||||
int64_t second_pts = qRound64(av_q2d(av_inv_q(c->stream->time_base)));
|
||||
if (ms->video_interlacing != VIDEO_PROGRESSIVE) {
|
||||
if (ms->video_interlacing != VIDEO_PROGRESSIVE) {
|
||||
target_pts *= 2;
|
||||
second_pts *= 2;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void get_clip_frame(Clip* c, long playhead) {
|
||||
|
||||
c->queue_lock.lock();
|
||||
if (c->queue.size() > 0) {
|
||||
if (ms->infinite_length) {
|
||||
if (ms->infinite_length) {
|
||||
target_frame = c->queue.at(0);
|
||||
#ifdef GCF_DEBUG
|
||||
dout << "GCF ==> USE PRECISE (INFINITE)";
|
||||
|
||||
Reference in New Issue
Block a user