summaryrefslogtreecommitdiff
path: root/plugins/mp3/patches
diff options
context:
space:
mode:
authorroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
committerroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
commit0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch)
tree11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/mp3/patches
downloadx-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz
x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2
hello world
Diffstat (limited to 'plugins/mp3/patches')
-rw-r--r--plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff145
-rw-r--r--plugins/mp3/patches/mp3-with_oss.diff11
2 files changed, 156 insertions, 0 deletions
diff --git a/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff b/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff
new file mode 100644
index 0000000..6b20fe0
--- /dev/null
+++ b/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff
@@ -0,0 +1,145 @@
+diff -Naur mp3-0.9.15/mp3.c mp3-0.9.15-span/mp3.c
+--- mp3-0.9.15/mp3.c 2006-08-30 17:39:24.000000000 +0200
++++ mp3-0.9.15-span/mp3.c 2006-09-27 14:05:13.000000000 +0200
+@@ -1786,6 +1786,12 @@
+ }
+ return true;
+ }
++ else if (strcmp(Id, SPAN_PROVIDER_CHECK_ID) == 0) {
++ if(Data) {
++ *((Span_Provider_Check_1_0*)Data)->isActive = true;
++ }
++ return true;
++ }
+ return false;
+ }
+
+diff -Naur mp3-0.9.15/player-mp3.c mp3-0.9.15-span/player-mp3.c
+--- mp3-0.9.15/player-mp3.c 2006-07-30 19:59:31.000000000 +0200
++++ mp3-0.9.15-span/player-mp3.c 2006-09-27 14:21:42.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <vdr/ringbuffer.h>
+ #include <vdr/thread.h>
+ #include <vdr/tools.h>
++#include <vdr/plugin.h>
+
+ #include "common.h"
+ #include "setup-mp3.h"
+@@ -1304,6 +1305,23 @@
+ outlen+=(sizeof(header)-6);
+ buff[4+FHS]=outlen>>8;
+ buff[5+FHS]=outlen;
++
++// Spectrum Analyzer: Hand over the PCM16-data to SpAn
++ int offset = sizeof(header)+FHS;
++ Span_SetPcmData_1_0 SetPcmData;
++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, NULL);
++ if (Plugin)
++ {
++ SetPcmData.length = (unsigned int)(outlen-offset);
++// the timestamp (ms) of the frame(s) to be visualized:
++ SetPcmData.index = index;
++// tell SpAn the ringbuffer's size for it's internal bookkeeping of the data to be visualized:
++ SetPcmData.bufferSize = MP3BUFSIZE;
++ SetPcmData.data = buff + offset + 1; // get rid of the header
++ SetPcmData.bigEndian = true;
++ cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, &SetPcmData);
++ }
++
+ f=new cFrame(buff,-(outlen+6+FHS),ftUnknown,index);
+ }
+ if(!f) free(buff);
+@@ -1469,8 +1487,25 @@
+ fh->samplerate=sr;
+ cFrame *f=0;
+ unsigned int outlen=scale.ScaleBlock(buff+FHS,sizeof(buff)-FHS,Samples,Data[0],Data[1],MP3Setup.AudioMode?amDitherLE:amRoundLE);
+- if(outlen)
++ if(outlen)
++ {
++// Spectrum Analyzer: Hand over the PCM16-data to SpAn
++ int offset = FHS;
++ Span_SetPcmData_1_0 SetPcmData;
++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, NULL);
++ if (Plugin)
++ {
++ SetPcmData.length = (unsigned int)(outlen-offset);
++// the timestamp (ms) of the frame(s) to be visualized:
++ SetPcmData.index = index;
++// tell SpAn the ringbuffer's size for it's internal bookkeeping of the data to be visualized:
++ SetPcmData.bufferSize = MP3BUFSIZE;
++ SetPcmData.data = buff + offset + 1; // get rid of the header
++ SetPcmData.bigEndian = false;
++ cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, &SetPcmData);
++ }
+ f=new cFrame(buff,outlen+FHS,ftUnknown,index);
++ }
+ return f;
+ }
+
+@@ -1592,6 +1627,7 @@
+ #ifdef DEBUG_DELAY
+ int lastwrite=0;
+ #endif
++ bool frameIncomplete = true;
+
+ dsyslog("mp3: player thread started (pid=%d)", getpid());
+ state=msStop;
+@@ -1658,10 +1694,23 @@
+ #endif
+ int w=output->Output(p,pc,SOF);
+ if(w>0) {
++// Spectrum Analyzer: Tell SpAn which timestamp is currently playing
++ if ( frameIncomplete )
++ {
++ Span_SetPlayindex_1_0 SetPlayindexData;
++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PLAYINDEX_ID, NULL);
++ if (Plugin)
++ {
++ SetPlayindexData.index = playindex;
++ cPluginManager::CallFirstService(SPAN_SET_PLAYINDEX_ID, &SetPlayindexData);
++ }
++ frameIncomplete = false;
++ }
+ p+=w; pc-=w;
+ if(pc<=0) {
+ ringBuffer->Drop(pframe);
+ pframe=0;
++ frameIncomplete = true;
+ goto next;
+ }
+ }
+diff -Naur mp3-0.9.15/player-mp3.h mp3-0.9.15-span/player-mp3.h
+--- mp3-0.9.15/player-mp3.h 2006-07-30 19:59:20.000000000 +0200
++++ mp3-0.9.15-span/player-mp3.h 2006-09-27 14:13:31.000000000 +0200
+@@ -27,6 +27,31 @@
+
+ // -------------------------------------------------------------------
+
++#define SPAN_PROVIDER_CHECK_ID "Span-ProviderCheck-v1.0"
++#define SPAN_SET_PCM_DATA_ID "Span-SetPcmData-v1.1"
++#define SPAN_SET_PLAYINDEX_ID "Span-SetPlayindex-v1.0"
++
++//Span requests to collect possible providers / clients
++struct Span_Provider_Check_1_0 {
++ bool *isActive;
++ bool *isRunning;
++};
++
++// SpanData
++struct Span_SetPcmData_1_0 {
++ unsigned int length; // the length of the PCM-data
++ const unsigned char *data; // the PCM-Data
++ int index; // the timestamp (ms) of the frame(s) to be visualized
++ unsigned int bufferSize; // for span-internal bookkeeping of the data to be visualized
++ bool bigEndian; // are the pcm16-data coded bigEndian?
++};
++
++struct Span_SetPlayindex_1_0 {
++ int index; // the timestamp (ms) of the frame(s) being currently played
++};
++
++// -------------------------------------------------------------------
++
+ class cRingBufferFrame;
+ class cFrame;
+
diff --git a/plugins/mp3/patches/mp3-with_oss.diff b/plugins/mp3/patches/mp3-with_oss.diff
new file mode 100644
index 0000000..b54b435
--- /dev/null
+++ b/plugins/mp3/patches/mp3-with_oss.diff
@@ -0,0 +1,11 @@
+--- Makefile.ORG
++++ Makefile
+@@ -32,7 +32,7 @@
+ #WITHOUT_LIBVORBISFILE=1
+
+ ### uncomment the following line, if you want OSS sound output
+-#WITH_OSS_OUTPUT=1
++WITH_OSS_OUTPUT=1
+
+ ### uncomment the following line, if you want to include debug symbols
+ #DBG=1