Commit a94845ee authored by Max Kellermann's avatar Max Kellermann

moved global variable "ob" to outputBuffer.h

This releases several include file dependencies. As a side effect, "CHUNK_SIZE" isn't defined by decoder_api.h anymore, so we have to define it directly in the plugins which need it. It just isn't worth it to add it to the decoder plugin API.
parent 15c9352b
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "utils.h" #include "utils.h"
#include "normalize.h" #include "normalize.h"
#include "playerData.h" #include "playerData.h"
#include "outputBuffer.h"
#include "gcc.h" #include "gcc.h"
void decoder_plugin_register(struct decoder_plugin *plugin) void decoder_plugin_register(struct decoder_plugin *plugin)
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
#include <audiofile.h> #include <audiofile.h>
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
static int getAudiofileTotalTime(char *file) static int getAudiofileTotalTime(char *file)
{ {
int total_time; int total_time;
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <wavpack/wavpack.h> #include <wavpack/wavpack.h>
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
#define ERRORLEN 80 #define ERRORLEN 80
static struct { static struct {
......
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
*/ */
#include "outputBuffer.h" #include "outputBuffer.h"
#include "playerData.h"
#include "utils.h" #include "utils.h"
struct output_buffer ob;
void ob_init(unsigned int size, Notify *notify) void ob_init(unsigned int size, Notify *notify)
{ {
assert(size > 0); assert(size > 0);
......
...@@ -36,7 +36,7 @@ typedef struct _OutputBufferChunk { ...@@ -36,7 +36,7 @@ typedef struct _OutputBufferChunk {
* A ring set of buffers where the decoder appends data after the end, * A ring set of buffers where the decoder appends data after the end,
* and the player consumes data from the beginning. * and the player consumes data from the beginning.
*/ */
typedef struct _OutputBuffer { struct output_buffer {
ob_chunk *chunks; ob_chunk *chunks;
unsigned int size; unsigned int size;
...@@ -54,7 +54,9 @@ typedef struct _OutputBuffer { ...@@ -54,7 +54,9 @@ typedef struct _OutputBuffer {
AudioFormat audioFormat; AudioFormat audioFormat;
Notify *notify; Notify *notify;
} OutputBuffer; };
extern struct output_buffer ob;
void ob_init(unsigned int size, Notify *notify); void ob_init(unsigned int size, Notify *notify);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "playerData.h" #include "playerData.h"
#include "decode.h" #include "decode.h"
#include "outputBuffer.h"
#include "conf.h" #include "conf.h"
#include "log.h" #include "log.h"
#include "utils.h" #include "utils.h"
...@@ -27,7 +28,6 @@ ...@@ -27,7 +28,6 @@
unsigned int buffered_before_play; unsigned int buffered_before_play;
PlayerControl pc; PlayerControl pc;
OutputBuffer ob;
void initPlayerData(void) void initPlayerData(void)
{ {
......
...@@ -20,11 +20,9 @@ ...@@ -20,11 +20,9 @@
#define PLAYER_DATA_H #define PLAYER_DATA_H
#include "player.h" #include "player.h"
#include "outputBuffer.h"
extern unsigned int buffered_before_play; extern unsigned int buffered_before_play;
extern PlayerControl pc; extern PlayerControl pc;
extern OutputBuffer ob;
void initPlayerData(void); void initPlayerData(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment