summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad/libmadplugin.cpp
authorllornkcor <llornkcor>2002-04-10 19:13:40 (UTC)
committer llornkcor <llornkcor>2002-04-10 19:13:40 (UTC)
commit9237a75548f9b932fbb1900d8ea28dbee9da81ac (patch) (side-by-side diff)
treea0249408df5ce581af8bcee5b6f58bcee1db461a /core/multimedia/opieplayer/libmad/libmadplugin.cpp
parent11d754ffa429875b526c49f125d8a844c5cda3d8 (diff)
downloadopie-9237a75548f9b932fbb1900d8ea28dbee9da81ac.zip
opie-9237a75548f9b932fbb1900d8ea28dbee9da81ac.tar.gz
opie-9237a75548f9b932fbb1900d8ea28dbee9da81ac.tar.bz2
bug fix
Diffstat (limited to 'core/multimedia/opieplayer/libmad/libmadplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
index 9f8ba65..8ede537 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
@@ -34,2 +34,3 @@
#include <qapplication.h>
+#include <qpe/config.h>
@@ -49,2 +50,3 @@ extern "C" {
#define MPEG_BUFFER_SIZE 65536
+//#define MPEG_BUFFER_SIZE 32768 //16384 // 8192
//#define debugMsg(a) qDebug(a)
@@ -167,3 +169,6 @@ bool LibMadPlugin::open( const QString& path ) {
debugMsg( "LibMadPlugin::open" );
-
+ Config cfg("MediaPlayer");
+ cfg.setGroup("Options");
+ bufferSize = cfg.readNumEntry("MPeg_BufferSize",MPEG_BUFFER_SIZE);
+ qDebug("buffer size is %d", bufferSize);
d->bad_last_frame = 0;
@@ -199,3 +204,3 @@ bool LibMadPlugin::open( const QString& path ) {
if (d->input.data == 0) {
- d->input.data = (unsigned char *)malloc(MPEG_BUFFER_SIZE);
+ d->input.data = (unsigned char *)malloc( bufferSize /*MPEG_BUFFER_SIZE*/);
if (d->input.data == 0) {
@@ -371,3 +376,3 @@ bool LibMadPlugin::read() {
do {
- len = ::read(d->input.fd, d->input.data + d->input.length, MPEG_BUFFER_SIZE - d->input.length);
+ len = ::read(d->input.fd, d->input.data + d->input.length, bufferSize /* MPEG_BUFFER_SIZE*/ - d->input.length);
}
@@ -382,3 +387,3 @@ bool LibMadPlugin::read() {
- assert(MPEG_BUFFER_SIZE - d->input.length >= MAD_BUFFER_GUARD);
+ assert(bufferSize /*MPEG_BUFFER_SIZE*/ - d->input.length >= MAD_BUFFER_GUARD);