Fixes to xine engine

This commit is contained in:
Jonas Kvinge 2018-06-28 23:12:39 +02:00
parent 505c1feb42
commit fc66e2e2c7
7 changed files with 108 additions and 116 deletions

View File

@ -42,7 +42,7 @@ Engine::Base::Base()
end_nanosec_(0),
scope_(kScopeSize),
output_(""),
device_(QVariant("")),
device_(QVariant()),
rg_enabled_(false),
rg_mode_(0),
rg_preamp_(0),

View File

@ -63,7 +63,7 @@ GstEnginePipeline::GstEnginePipeline(GstEngine *engine)
id_(sId++),
valid_(false),
output_(""),
device_(""),
device_(QVariant()),
eq_enabled_(false),
eq_preamp_(0),
stereo_balance_(0.0f),

View File

@ -357,6 +357,7 @@ EngineBase::PluginDetailsList VLCEngine::GetPluginList() const {
details.name = QString::fromUtf8(audio_output->psz_name);
details.description = QString::fromUtf8(audio_output->psz_description);
ret << details;
//GetDevicesList(audio_output->psz_name);
}
libvlc_audio_output_list_release(audio_output_list);

View File

@ -201,7 +201,8 @@ bool XineEngine::Load(const QUrl &url, Engine::TrackChangeFlags change, bool for
xine_close(stream_);
int result = xine_open(stream_, url.path().toUtf8());
//int result = xine_open(stream_, url.path().toUtf8());
int result = xine_open(stream_, url.toString().toUtf8());
if (result) {
#ifndef XINE_SAFE_MODE
@ -370,7 +371,7 @@ EngineBase::OutputDetailsList XineEngine::GetOutputsList() const {
}
bool XineEngine::CustomDeviceSupport(const QString &name) {
return (name == DefaultOutput() ? false : true);
return (name == "alsa" || name == "oss" || name == "jack" || name == "pulseaudio");
}
void XineEngine::ReloadSettings() {

View File

@ -2,17 +2,14 @@
Copyright: See COPYING file that comes with this distribution
This has to be a c file or for some reason it won't link! (GCC 3.4.1)
*/
/* gcc doesn't like inline for me */
#define inline
/* need access to port_ticket */
#define XINE_ENGINE_INTERNAL
#include "config.h"
#include <time.h>
#include "xinescope.h"
#include <xine/post.h>
#include <xine/xine_internal.h>
@ -73,10 +70,10 @@ static void scope_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *b
/* I keep my own metronom because xine wouldn't for some reason */
memcpy(&this->metronom, stream->metronom, sizeof(metronom_t));
new_node = malloc(sizeof(MyNode));
new_node = (MyNode *) malloc(sizeof(MyNode));
new_node->vpts = myMetronom->got_audio_samples(myMetronom, buf->vpts, buf->num_frames);
new_node->num_frames = buf->num_frames;
new_node->mem = malloc(num_samples * 2);
new_node->mem = (int16_t *) malloc(num_samples * 2);
memcpy(new_node->mem, buf->mem, num_samples * 2);
{
@ -91,8 +88,8 @@ static void scope_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *b
port->original_port->put_buffer(port->original_port, buf, stream);
/* finally we should append the current buffer to the list
* this is thread-safe due to the way we handle the list in the GUI thread */
/* Finally we should append the current buffer to the list
* This is thread-safe due to the way we handle the list in the GUI thread */
new_node->next = this->list->next;
this->list->next = new_node;
@ -100,8 +97,9 @@ static void scope_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *b
#undef this
}
static void scope_dispose(post_plugin_t *this) {
MyNode *list = ((scope_plugin_t*)this)->list;
static void scope_dispose(post_plugin_t *post) {
MyNode *list = ((scope_plugin_t*)post)->list;
MyNode *prev;
MyNode *node = list;
@ -117,7 +115,7 @@ static void scope_dispose(post_plugin_t *this) {
while(node != list);
free(this);
free(post);
}
@ -125,10 +123,10 @@ static void scope_dispose(post_plugin_t *this) {
* plugin init function *
************************/
xine_post_t* scope_plugin_new(xine_t *xine, xine_audio_port_t *audio_target) {
xine_post_t *scope_plugin_new(xine_t *xine, xine_audio_port_t *audio_target) {
scope_plugin_t *scope_plugin = calloc(1, sizeof(scope_plugin_t));
post_plugin_t *post_plugin = (post_plugin_t*)scope_plugin;
scope_plugin_t *scope_plugin = (scope_plugin_t *) calloc(1, sizeof(scope_plugin_t));
post_plugin_t *post_plugin = (post_plugin_t *)scope_plugin;
{
post_in_t *input;
@ -154,13 +152,13 @@ xine_post_t* scope_plugin_new(xine_t *xine, xine_audio_port_t *audio_target) {
post_plugin->xine = xine;
/* scope_plugin_t init */
scope_plugin->list = calloc(1, sizeof(MyNode));
scope_plugin->list = (MyNode *) calloc(1, sizeof(MyNode));
scope_plugin->list->next = scope_plugin->list;
return &post_plugin->xine_post;
}
MyNode* scope_plugin_list(void *post) {
MyNode *scope_plugin_list(void *post) {
return ((scope_plugin_t*)post)->list;
}

View File

@ -17,8 +17,7 @@
typedef struct my_node_s MyNode;
struct my_node_s
{
struct my_node_s {
MyNode *next;
int16_t *mem;
int num_frames;
@ -30,21 +29,13 @@ struct my_node_s
extern "C"
{
#endif
xine_post_t*
scope_plugin_new( xine_t*, xine_audio_port_t* );
xine_post_t *scope_plugin_new( xine_t*, xine_audio_port_t* );
/* we sacrifice type-safety here because some GCCs appear broken
* and choke on redefining the xine_post_t typedef
*/
/* we sacrifice type-safety here because some GCCs appear broken and choke on redefining the xine_post_t typedef */
MyNode*
scope_plugin_list( void* );
int
scope_plugin_channels( void* );
metronom_t*
scope_plugin_metronom( void* );
MyNode *scope_plugin_list(void*);
int scope_plugin_channels(void*);
metronom_t *scope_plugin_metronom(void*);
#ifdef __cplusplus
}
#endif

View File

@ -233,9 +233,10 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device) {
ui_->combobox_device->setEnabled(false);
ui_->lineedit_device->setText("");
#ifndef Q_OS_WIN32
ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Automatically select", QVariant(""));
#ifdef Q_OS_WIN
if (engine()->type() != Engine::GStreamer)
#endif
ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Automatically select", QVariant(""));
for (DeviceFinder *f : dialog()->app()->enginedevice()->device_finders_) {
if (!f->outputs().contains(output)) continue;