fix qball's bug, crossfading playing with funny samplerate
git-svn-id: https://svn.musicpd.org/mpd/trunk@1585 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
d8dbd29c2d
commit
6eb6c454be
@ -486,7 +486,9 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) {
|
|||||||
pc->queueState = PLAYER_QUEUE_DECODE;
|
pc->queueState = PLAYER_QUEUE_DECODE;
|
||||||
kill(getppid(),SIGUSR1);
|
kill(getppid(),SIGUSR1);
|
||||||
}
|
}
|
||||||
if(next>=0 && doCrossFade==0 && !dc->start) {
|
if(next>=0 && doCrossFade==0 && !dc->start &&
|
||||||
|
dc->state!=DECODE_STATE_START)
|
||||||
|
{
|
||||||
nextChunk = -1;
|
nextChunk = -1;
|
||||||
if(isCurrentAudioFormat(&(cb->audioFormat))) {
|
if(isCurrentAudioFormat(&(cb->audioFormat))) {
|
||||||
doCrossFade = 1;
|
doCrossFade = 1;
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void initInputStream() {
|
||||||
|
inputStream_initFile();
|
||||||
|
inputStream_initHttp();
|
||||||
|
}
|
||||||
|
|
||||||
int openInputStream(InputStream * inStream, char * url) {
|
int openInputStream(InputStream * inStream, char * url) {
|
||||||
inStream->offset = 0;
|
inStream->offset = 0;
|
||||||
inStream->size = 0;
|
inStream->size = 0;
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
void inputStream_initFile() {
|
||||||
|
}
|
||||||
|
|
||||||
int inputStream_fileOpen(InputStream * inStream, char * filename) {
|
int inputStream_fileOpen(InputStream * inStream, char * filename) {
|
||||||
FILE * fp;
|
FILE * fp;
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "inputStream.h"
|
#include "inputStream.h"
|
||||||
|
|
||||||
|
void inputStream_initFile();
|
||||||
|
|
||||||
int inputStream_fileOpen(InputStream * inStream, char * filename);
|
int inputStream_fileOpen(InputStream * inStream, char * filename);
|
||||||
|
|
||||||
int inputStream_fileSeek(InputStream * inStream, long offset, int whence);
|
int inputStream_fileSeek(InputStream * inStream, long offset, int whence);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "conf.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -61,6 +62,55 @@ typedef struct _InputStreemHTTPData {
|
|||||||
int icyOffset;
|
int icyOffset;
|
||||||
} InputStreamHTTPData;
|
} InputStreamHTTPData;
|
||||||
|
|
||||||
|
void inputStream_initHttp() {
|
||||||
|
if(getConf()[CONF_HTTP_PROXY_HOST]) {
|
||||||
|
char * portStr = getConf()[CONF_HTTP_PROXY_PORT];
|
||||||
|
int port = 0;
|
||||||
|
char * test;
|
||||||
|
|
||||||
|
if(!portStr) {
|
||||||
|
ERROR("http_proxy_host specified but not the http_"
|
||||||
|
"proxy_port\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
port = strtol(portStr, &test, 10);
|
||||||
|
if(port <= 0 || *test != '\0') {
|
||||||
|
ERROR("http_proxy_port \"%s\" is not a positive integer"
|
||||||
|
"\n", portStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConf()[CONF_HTTP_PROXY_USER] &&
|
||||||
|
!getConf()[CONF_HTTP_PROXY_PASSWORD])
|
||||||
|
{
|
||||||
|
ERROR("http_proxy_user specified, but not http_proxy_"
|
||||||
|
"password\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConf()[CONF_HTTP_PROXY_PASSWORD] &&
|
||||||
|
!getConf()[CONF_HTTP_PROXY_USER])
|
||||||
|
{
|
||||||
|
ERROR("http proxy password specified, but not http "
|
||||||
|
"proxy user\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(getConf()[CONF_HTTP_PROXY_PORT]) {
|
||||||
|
ERROR("http_proxy_port specified but not http_proxy_host\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
else if(getConf()[CONF_HTTP_PROXY_USER]) {
|
||||||
|
ERROR("http_proxy_user specified but not http_proxy_host\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
else if(getConf()[CONF_HTTP_PROXY_PASSWORD]) {
|
||||||
|
ERROR("http_proxy_password specified but not http_proxy_host"
|
||||||
|
"\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static InputStreamHTTPData * newInputStreamHTTPData() {
|
static InputStreamHTTPData * newInputStreamHTTPData() {
|
||||||
InputStreamHTTPData * ret = malloc(sizeof(InputStreamHTTPData));
|
InputStreamHTTPData * ret = malloc(sizeof(InputStreamHTTPData));
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "inputStream.h"
|
#include "inputStream.h"
|
||||||
|
|
||||||
|
void inputStream_initHttp();
|
||||||
|
|
||||||
int inputStream_httpOpen(InputStream * inStream, char * filename);
|
int inputStream_httpOpen(InputStream * inStream, char * filename);
|
||||||
|
|
||||||
int inputStream_httpSeek(InputStream * inStream, long offset, int whence);
|
int inputStream_httpSeek(InputStream * inStream, long offset, int whence);
|
||||||
|
Loading…
Reference in New Issue
Block a user