mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-09 08:18:49 +01:00
Remove xine metronom.pts_per_smpls check
This commit is contained in:
parent
221ab51d90
commit
1773283456
@ -361,20 +361,6 @@ if(NOT CMAKE_CROSSCOMPILING)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_XINE)
|
|
||||||
check_cxx_source_compiles("
|
|
||||||
#define METRONOM_INTERNAL
|
|
||||||
#include <iostream>
|
|
||||||
#include <xine/metronom.h>
|
|
||||||
int main() {
|
|
||||||
metronom_t metronom;
|
|
||||||
std::cout << metronom.pts_per_smpls;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
XINE_ANALYZER)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set up definitions
|
# Set up definitions
|
||||||
|
|
||||||
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
|
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
|
||||||
|
@ -535,12 +535,9 @@ optional_source(HAVE_GSTREAMER
|
|||||||
|
|
||||||
# Xine
|
# Xine
|
||||||
optional_source(HAVE_XINE
|
optional_source(HAVE_XINE
|
||||||
SOURCES engine/xineengine.cpp
|
SOURCES engine/xineengine.cpp engine/xinescope.c
|
||||||
HEADERS engine/xineengine.h
|
HEADERS engine/xineengine.h
|
||||||
)
|
)
|
||||||
optional_source(XINE_ANALYZER
|
|
||||||
SOURCES engine/xinescope.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# VLC
|
# VLC
|
||||||
optional_source(HAVE_VLC
|
optional_source(HAVE_VLC
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#cmakedefine HAVE_GSTREAMER
|
#cmakedefine HAVE_GSTREAMER
|
||||||
#cmakedefine HAVE_VLC
|
#cmakedefine HAVE_VLC
|
||||||
#cmakedefine HAVE_XINE
|
#cmakedefine HAVE_XINE
|
||||||
#cmakedefine XINE_ANALYZER
|
|
||||||
|
|
||||||
#cmakedefine HAVE_SUBSONIC
|
#cmakedefine HAVE_SUBSONIC
|
||||||
#cmakedefine HAVE_TIDAL
|
#cmakedefine HAVE_TIDAL
|
||||||
|
@ -15,23 +15,12 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef XINE_ENGINE_INTERNAL
|
|
||||||
# define XINE_ENGINE_INTERNAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef METRONOM_INTERNAL
|
|
||||||
# define METRONOM_INTERNAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <xine.h>
|
#include <xine.h>
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
# include <xine/metronom.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -58,9 +47,7 @@
|
|||||||
#include "enginebase.h"
|
#include "enginebase.h"
|
||||||
#include "enginetype.h"
|
#include "enginetype.h"
|
||||||
#include "xineengine.h"
|
#include "xineengine.h"
|
||||||
#ifdef XINE_ANALYZER
|
#include "xinescope.h"
|
||||||
# include "xinescope.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LLONG_MAX
|
#ifndef LLONG_MAX
|
||||||
#define LLONG_MAX 9223372036854775807LL
|
#define LLONG_MAX 9223372036854775807LL
|
||||||
@ -77,10 +64,8 @@ XineEngine::XineEngine(TaskManager *task_manager)
|
|||||||
audioport_(nullptr),
|
audioport_(nullptr),
|
||||||
stream_(nullptr),
|
stream_(nullptr),
|
||||||
eventqueue_(nullptr),
|
eventqueue_(nullptr),
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
post_(nullptr),
|
post_(nullptr),
|
||||||
prune_(nullptr),
|
prune_(nullptr),
|
||||||
#endif
|
|
||||||
preamp_(1.0),
|
preamp_(1.0),
|
||||||
have_metadata_(false) {
|
have_metadata_(false) {
|
||||||
|
|
||||||
@ -115,7 +100,7 @@ bool XineEngine::Init() {
|
|||||||
|
|
||||||
xine_init(xine_);
|
xine_init(xine_);
|
||||||
|
|
||||||
#if !defined(XINE_SAFE_MODE) && defined(XINE_ANALYZER)
|
#if !defined(XINE_SAFE_MODE)
|
||||||
prune_.reset(new PruneScopeThread(this));
|
prune_.reset(new PruneScopeThread(this));
|
||||||
prune_->start();
|
prune_->start();
|
||||||
#endif
|
#endif
|
||||||
@ -169,7 +154,7 @@ bool XineEngine::OpenAudioDriver() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(XINE_SAFE_MODE) && defined(XINE_ANALYZER)
|
#if !defined(XINE_SAFE_MODE)
|
||||||
post_ = scope_plugin_new(xine_, audioport_);
|
post_ = scope_plugin_new(xine_, audioport_);
|
||||||
if (!post_) {
|
if (!post_) {
|
||||||
xine_close_audio_driver(xine_, audioport_);
|
xine_close_audio_driver(xine_, audioport_);
|
||||||
@ -187,12 +172,10 @@ bool XineEngine::OpenAudioDriver() {
|
|||||||
|
|
||||||
void XineEngine::CloseAudioDriver() {
|
void XineEngine::CloseAudioDriver() {
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
if (post_) {
|
if (post_) {
|
||||||
xine_post_dispose(xine_, post_);
|
xine_post_dispose(xine_, post_);
|
||||||
post_ = nullptr;
|
post_ = nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (audioport_) {
|
if (audioport_) {
|
||||||
xine_close_audio_driver(xine_, audioport_);
|
xine_close_audio_driver(xine_, audioport_);
|
||||||
@ -259,14 +242,12 @@ bool XineEngine::EnsureStream() {
|
|||||||
|
|
||||||
void XineEngine::Cleanup() {
|
void XineEngine::Cleanup() {
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
// Wait until the prune scope thread is done
|
// Wait until the prune scope thread is done
|
||||||
if (prune_) {
|
if (prune_) {
|
||||||
prune_->exit();
|
prune_->exit();
|
||||||
prune_->wait();
|
prune_->wait();
|
||||||
}
|
}
|
||||||
prune_.reset();
|
prune_.reset();
|
||||||
#endif
|
|
||||||
|
|
||||||
CloseStream();
|
CloseStream();
|
||||||
CloseAudioDriver();
|
CloseAudioDriver();
|
||||||
@ -310,7 +291,7 @@ bool XineEngine::Load(const QUrl &stream_url, const QUrl &original_url, const En
|
|||||||
int result = xine_open(stream_, stream_url.toString().toUtf8());
|
int result = xine_open(stream_, stream_url.toString().toUtf8());
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
||||||
#if !defined(XINE_SAFE_MODE) && defined(XINE_ANALYZER)
|
#if !defined(XINE_SAFE_MODE)
|
||||||
xine_post_out_t *source = xine_get_audio_source(stream_);
|
xine_post_out_t *source = xine_get_audio_source(stream_);
|
||||||
xine_post_in_t *target = (xine_post_in_t*)xine_post_input(post_, const_cast<char*>("audio in"));
|
xine_post_in_t *target = (xine_post_in_t*)xine_post_input(post_, const_cast<char*>("audio in"));
|
||||||
xine_post_wire(source, target);
|
xine_post_wire(source, target);
|
||||||
@ -893,8 +874,6 @@ void XineEngine::DetermineAndShowErrorMessage() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
|
|
||||||
const Engine::Scope &XineEngine::scope(const int chunk_length) {
|
const Engine::Scope &XineEngine::scope(const int chunk_length) {
|
||||||
|
|
||||||
Q_UNUSED(chunk_length);
|
Q_UNUSED(chunk_length);
|
||||||
@ -903,7 +882,6 @@ const Engine::Scope &XineEngine::scope(const int chunk_length) {
|
|||||||
return scope_;
|
return scope_;
|
||||||
|
|
||||||
MyNode *const myList = scope_plugin_list(post_);
|
MyNode *const myList = scope_plugin_list(post_);
|
||||||
metronom_t *const myMetronom = scope_plugin_metronom(post_);
|
|
||||||
const int myChannels = scope_plugin_channels(post_);
|
const int myChannels = scope_plugin_channels(post_);
|
||||||
int scopeidx = 0;
|
int scopeidx = 0;
|
||||||
|
|
||||||
@ -925,7 +903,7 @@ const Engine::Scope &XineEngine::scope(const int chunk_length) {
|
|||||||
int64_t diff = current_vpts_;
|
int64_t diff = current_vpts_;
|
||||||
diff -= best_node->vpts;
|
diff -= best_node->vpts;
|
||||||
diff *= 1<<16;
|
diff *= 1<<16;
|
||||||
diff /= myMetronom->pts_per_smpls;
|
diff /= 32768;
|
||||||
|
|
||||||
const int16_t *data16 = best_node->mem;
|
const int16_t *data16 = best_node->mem;
|
||||||
data16 += diff;
|
data16 += diff;
|
||||||
@ -1005,8 +983,6 @@ void PruneScopeThread::run() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EngineBase::PluginDetailsList XineEngine::GetPluginList() const {
|
EngineBase::PluginDetailsList XineEngine::GetPluginList() const {
|
||||||
|
|
||||||
PluginDetailsList ret;
|
PluginDetailsList ret;
|
||||||
|
@ -62,9 +62,7 @@ class XineEngine : public Engine::Base {
|
|||||||
qint64 position_nanosec() const override;
|
qint64 position_nanosec() const override;
|
||||||
qint64 length_nanosec() const override;
|
qint64 length_nanosec() const override;
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
const Engine::Scope& scope(int chunk_length);
|
const Engine::Scope& scope(int chunk_length);
|
||||||
#endif
|
|
||||||
|
|
||||||
OutputDetailsList GetOutputsList() const override;
|
OutputDetailsList GetOutputsList() const override;
|
||||||
bool ValidOutput(const QString &output) override;
|
bool ValidOutput(const QString &output) override;
|
||||||
@ -94,10 +92,9 @@ class XineEngine : public Engine::Base {
|
|||||||
xine_audio_port_t *audioport_;
|
xine_audio_port_t *audioport_;
|
||||||
xine_stream_t *stream_;
|
xine_stream_t *stream_;
|
||||||
xine_event_queue_t *eventqueue_;
|
xine_event_queue_t *eventqueue_;
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
xine_post_t *post_;
|
xine_post_t *post_;
|
||||||
std::unique_ptr<PruneScopeThread> prune_;
|
std::unique_ptr<PruneScopeThread> prune_;
|
||||||
#endif
|
|
||||||
float preamp_;
|
float preamp_;
|
||||||
|
|
||||||
QUrl stream_url_;
|
QUrl stream_url_;
|
||||||
@ -135,27 +132,23 @@ class XineEngine : public Engine::Base {
|
|||||||
|
|
||||||
PluginDetailsList GetPluginList() const;
|
PluginDetailsList GetPluginList() const;
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
private slots:
|
private slots:
|
||||||
void PruneScope();
|
void PruneScope();
|
||||||
#endif
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void InfoMessage(const QString&);
|
void InfoMessage(const QString&);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef XINE_ANALYZER
|
|
||||||
class PruneScopeThread : public QThread {
|
class PruneScopeThread : public QThread {
|
||||||
public:
|
public:
|
||||||
PruneScopeThread(XineEngine *parent);
|
PruneScopeThread(XineEngine *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XineEngine *engine_;
|
XineEngine *engine_;
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -80,7 +80,7 @@ static void scope_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *b
|
|||||||
|
|
||||||
{
|
{
|
||||||
int64_t
|
int64_t
|
||||||
K = myMetronom->pts_per_smpls; /*smpls = 1<<16 samples*/
|
K = 32768; /*smpls = 1<<16 samples*/
|
||||||
K *= num_samples;
|
K *= num_samples;
|
||||||
K /= (1<<16);
|
K /= (1<<16);
|
||||||
K += new_node->vpts;
|
K += new_node->vpts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user