summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmad') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/Makefile.in2
-rw-r--r--core/multimedia/opieplayer/libmad/libmad.pro18
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.cpp302
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.h4
-rw-r--r--core/multimedia/opieplayer/libmad/libmadpluginimpl.h4
5 files changed, 167 insertions, 163 deletions
diff --git a/core/multimedia/opieplayer/libmad/Makefile.in b/core/multimedia/opieplayer/libmad/Makefile.in
index e9f74e7..552043c 100644
--- a/core/multimedia/opieplayer/libmad/Makefile.in
+++ b/core/multimedia/opieplayer/libmad/Makefile.in
@@ -211,13 +211,15 @@ layer3.o: layer3.c \
211huffman.o: huffman.c \ 211huffman.o: huffman.c \
212 libmad_global.h \ 212 libmad_global.h \
213 huffman.h 213 huffman.h
214 214
215libmadplugin.o: libmadplugin.cpp \ 215libmadplugin.o: libmadplugin.cpp \
216 libmadplugin.h \ 216 libmadplugin.h \
217 ../mediaplayerplugininterface.h \
217 mad.h 218 mad.h
218 219
219libmadpluginimpl.o: libmadpluginimpl.cpp \ 220libmadpluginimpl.o: libmadpluginimpl.cpp \
220 libmadplugin.h \ 221 libmadplugin.h \
222 ../mediaplayerplugininterface.h \
221 libmadpluginimpl.h 223 libmadpluginimpl.h
222 224
223 225
diff --git a/core/multimedia/opieplayer/libmad/libmad.pro b/core/multimedia/opieplayer/libmad/libmad.pro
index 6c40a15..06e19e4 100644
--- a/core/multimedia/opieplayer/libmad/libmad.pro
+++ b/core/multimedia/opieplayer/libmad/libmad.pro
@@ -1,12 +1,12 @@
1 TEMPLATE= lib 1TEMPLATE = lib
2 CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 HEADERS = libmad_version.h fixed.h bit.h timer.h stream.h frame.h synth.h decoder.h \ 3HEADERS = libmad_version.h fixed.h bit.h timer.h stream.h frame.h synth.h decoder.h \
4 layer12.h layer3.h huffman.h libmad_global.h mad.h libmadplugin.h libmadpluginimpl.h 4 layer12.h layer3.h huffman.h libmad_global.h mad.h libmadplugin.h libmadpluginimpl.h
5 SOURCES = version.c fixed.c bit.c timer.c stream.c frame.c synth.c decoder.c \ 5SOURCES = version.c fixed.c bit.c timer.c stream.c frame.c synth.c decoder.c \
6 layer12.c layer3.c huffman.c libmadplugin.cpp libmadpluginimpl.cpp 6 layer12.c layer3.c huffman.c libmadplugin.cpp libmadpluginimpl.cpp
7 TARGET = madplugin 7TARGET = madplugin
8 DESTDIR = ../../plugins/codecs 8DESTDIR = ../../plugins/codecs
9INCLUDEPATH += $(OPIEDIR)/include .. 9INCLUDEPATH += $(OPIEDIR)/include ..
10DEPENDPATH += ../$(OPIEDIR)/include .. 10DEPENDPATH += ../$(OPIEDIR)/include ..
11LIBS += -lqpe -lm 11LIBS += -lqpe -lm
12 VERSION = 1.0.0 12VERSION = 1.0.0
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
index 9d04f7e..9f8ba65 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
@@ -44,13 +44,13 @@
44extern "C" { 44extern "C" {
45#include "mad.h" 45#include "mad.h"
46} 46}
47 47
48 48
49#define MPEG_BUFFER_SIZE 65536 49#define MPEG_BUFFER_SIZE 65536
50 //#define debugMsg(a) qDebug(a) 50//#define debugMsg(a) qDebug(a)
51#define debugMsg(a) 51#define debugMsg(a)
52 52
53 53
54class Input { 54class Input {
55public: 55public:
56 char const *path; 56 char const *path;
@@ -142,24 +142,24 @@ LibMadPlugin::~LibMadPlugin() {
142 142
143 143
144bool LibMadPlugin::isFileSupported( const QString& path ) { 144bool LibMadPlugin::isFileSupported( const QString& path ) {
145 debugMsg( "LibMadPlugin::isFileSupported" ); 145 debugMsg( "LibMadPlugin::isFileSupported" );
146 146
147 // Mpeg file extensions 147 // Mpeg file extensions
148 //"mp2","mp3","m1v","m2v","m2s","mpg","vob","mpeg","ac3" 148 // "mp2","mp3","m1v","m2v","m2s","mpg","vob","mpeg","ac3"
149 // Other media extensions 149 // Other media extensions
150 // "wav","mid","mod","s3m","ogg","avi","mov","sid" 150 // "wav","mid","mod","s3m","ogg","avi","mov","sid"
151 151
152 char *ext = strrchr( path.latin1(), '.' ); 152 char *ext = strrchr( path.latin1(), '.' );
153 153
154 // Test file extension 154 // Test file extension
155 if ( ext ) { 155 if ( ext ) {
156 if ( strncasecmp(ext, ".mp2", 4) == 0 ) 156 if ( strncasecmp(ext, ".mp2", 4) == 0 )
157 return TRUE; 157 return TRUE;
158 if ( strncasecmp(ext, ".mp3", 4) == 0 ) 158 if ( strncasecmp(ext, ".mp3", 4) == 0 )
159 return TRUE; 159 return TRUE;
160 } 160 }
161 161
162 return FALSE; 162 return FALSE;
163} 163}
164 164
165 165
@@ -173,39 +173,39 @@ bool LibMadPlugin::open( const QString& path ) {
173 //qDebug( "Opening %s", path.latin1() ); 173 //qDebug( "Opening %s", path.latin1() );
174 174
175 d->input.path = path.latin1(); 175 d->input.path = path.latin1();
176 d->input.fd = ::open( d->input.path, O_RDONLY ); 176 d->input.fd = ::open( d->input.path, O_RDONLY );
177 if (d->input.fd == -1) { 177 if (d->input.fd == -1) {
178 qDebug("error opening %s", d->input.path ); 178 qDebug("error opening %s", d->input.path );
179 return FALSE; 179 return FALSE;
180 } 180 }
181 181
182 printID3Tags(); 182 printID3Tags();
183 183
184#if defined(HAVE_MMAP) 184#if defined(HAVE_MMAP)
185 struct stat stat; 185 struct stat stat;
186 if (fstat(d->input.fd, &stat) == -1) { 186 if (fstat(d->input.fd, &stat) == -1) {
187 qDebug("error calling fstat"); return FALSE; 187 qDebug("error calling fstat"); return FALSE;
188 } 188 }
189 if (S_ISREG(stat.st_mode) && stat.st_size > 0) { 189 if (S_ISREG(stat.st_mode) && stat.st_size > 0) {
190 d->input.length = stat.st_size; 190 d->input.length = stat.st_size;
191 d->input.fdm = map_file(d->input.fd, &d->input.length); 191 d->input.fdm = map_file(d->input.fd, &d->input.length);
192 if (d->input.fdm == 0) { 192 if (d->input.fdm == 0) {
193 qDebug("error mmapping file"); return FALSE; 193 qDebug("error mmapping file"); return FALSE;
194 } 194 }
195 d->input.data = (unsigned char *)d->input.fdm; 195 d->input.data = (unsigned char *)d->input.fdm;
196 } 196 }
197#endif 197#endif
198 198
199 if (d->input.data == 0) { 199 if (d->input.data == 0) {
200 d->input.data = (unsigned char *)malloc(MPEG_BUFFER_SIZE); 200 d->input.data = (unsigned char *)malloc(MPEG_BUFFER_SIZE);
201 if (d->input.data == 0) { 201 if (d->input.data == 0) {
202 qDebug("error allocating input buffer"); 202 qDebug("error allocating input buffer");
203 return FALSE; 203 return FALSE;
204 } 204 }
205 d->input.length = 0; 205 d->input.length = 0;
206 } 206 }
207 207
208 d->input.eof = 0; 208 d->input.eof = 0;
209 209
210 mad_stream_init(&d->stream); 210 mad_stream_init(&d->stream);
211 mad_frame_init(&d->frame); 211 mad_frame_init(&d->frame);
@@ -223,29 +223,29 @@ bool LibMadPlugin::close() {
223 mad_synth_finish(&d->synth); 223 mad_synth_finish(&d->synth);
224 mad_frame_finish(&d->frame); 224 mad_frame_finish(&d->frame);
225 mad_stream_finish(&d->stream); 225 mad_stream_finish(&d->stream);
226 226
227#if defined(HAVE_MMAP) 227#if defined(HAVE_MMAP)
228 if (d->input.fdm) { 228 if (d->input.fdm) {
229 if (unmap_file(d->input.fdm, d->input.length) == -1) { 229 if (unmap_file(d->input.fdm, d->input.length) == -1) {
230 qDebug("error munmapping file"); 230 qDebug("error munmapping file");
231 result = FALSE; 231 result = FALSE;
232 } 232 }
233 d->input.fdm = 0; 233 d->input.fdm = 0;
234 d->input.data = 0; 234 d->input.data = 0;
235 } 235 }
236#endif 236#endif
237 237
238 if (d->input.data) { 238 if (d->input.data) {
239 free(d->input.data); 239 free(d->input.data);
240 d->input.data = 0; 240 d->input.data = 0;
241 } 241 }
242 242
243 if (::close(d->input.fd) == -1) { 243 if (::close(d->input.fd) == -1) {
244 qDebug("error closing file %s", d->input.path); 244 qDebug("error closing file %s", d->input.path);
245 result = FALSE; 245 result = FALSE;
246 } 246 }
247 247
248 d->input.fd = 0; 248 d->input.fd = 0;
249 249
250 return result; 250 return result;
251} 251}
@@ -320,76 +320,76 @@ bool LibMadPlugin::audioReReadSamples( short *, int, long, int ) {
320 320
321bool LibMadPlugin::read() { 321bool LibMadPlugin::read() {
322 debugMsg( "LibMadPlugin::read" ); 322 debugMsg( "LibMadPlugin::read" );
323 int len; 323 int len;
324 324
325 if (d->input.eof) 325 if (d->input.eof)
326 return FALSE; 326 return FALSE;
327 327
328#if defined(HAVE_MMAP) 328#if defined(HAVE_MMAP)
329 if (d->input.fdm) { 329 if (d->input.fdm) {
330 unsigned long skip = 0; 330 unsigned long skip = 0;
331 331
332 if (d->stream.next_frame) { 332 if (d->stream.next_frame) {
333 struct stat stat; 333 struct stat stat;
334 334
335 if (fstat(d->input.fd, &stat) == -1) 335 if (fstat(d->input.fd, &stat) == -1)
336 return FALSE; 336 return FALSE;
337 337
338 if (stat.st_size + MAD_BUFFER_GUARD <= (signed)d->input.length) 338 if (stat.st_size + MAD_BUFFER_GUARD <= (signed)d->input.length)
339 return FALSE; 339 return FALSE;
340 340
341 // file size changed; update memory map 341 // file size changed; update memory map
342 skip = d->stream.next_frame - d->input.data; 342 skip = d->stream.next_frame - d->input.data;
343 343
344 if (unmap_file(d->input.fdm, d->input.length) == -1) { 344 if (unmap_file(d->input.fdm, d->input.length) == -1) {
345 d->input.fdm = 0; 345 d->input.fdm = 0;
346 d->input.data = 0; 346 d->input.data = 0;
347 return FALSE; 347 return FALSE;
348 } 348 }
349 349
350 d->input.length = stat.st_size; 350 d->input.length = stat.st_size;
351 351
352 d->input.fdm = map_file(d->input.fd, &d->input.length); 352 d->input.fdm = map_file(d->input.fd, &d->input.length);
353 if (d->input.fdm == 0) { 353 if (d->input.fdm == 0) {
354 d->input.data = 0; 354 d->input.data = 0;
355 return FALSE; 355 return FALSE;
356 } 356 }
357 357
358 d->input.data = (unsigned char *)d->input.fdm; 358 d->input.data = (unsigned char *)d->input.fdm;
359 } 359 }
360 360
361 mad_stream_buffer(&d->stream, d->input.data + skip, d->input.length - skip); 361 mad_stream_buffer(&d->stream, d->input.data + skip, d->input.length - skip);
362 362
363 } else 363 } else
364#endif 364#endif
365 { 365 {
366 if (d->stream.next_frame) { 366 if (d->stream.next_frame) {
367 memmove(d->input.data, d->stream.next_frame, 367 memmove(d->input.data, d->stream.next_frame,
368 d->input.length = &d->input.data[d->input.length] - d->stream.next_frame); 368 d->input.length = &d->input.data[d->input.length] - d->stream.next_frame);
369 } 369 }
370 370
371 do { 371 do {
372 len = ::read(d->input.fd, d->input.data + d->input.length, MPEG_BUFFER_SIZE - d->input.length); 372 len = ::read(d->input.fd, d->input.data + d->input.length, MPEG_BUFFER_SIZE - d->input.length);
373 } 373 }
374 while (len == -1 && errno == EINTR); 374 while (len == -1 && errno == EINTR);
375 375
376 if (len == -1) { 376 if (len == -1) {
377 qDebug("error reading audio"); 377 qDebug("error reading audio");
378 return FALSE; 378 return FALSE;
379 } 379 }
380 else if (len == 0) { 380 else if (len == 0) {
381 d->input.eof = 1; 381 d->input.eof = 1;
382 382
383 assert(MPEG_BUFFER_SIZE - d->input.length >= MAD_BUFFER_GUARD); 383 assert(MPEG_BUFFER_SIZE - d->input.length >= MAD_BUFFER_GUARD);
384 384
385 while (len < MAD_BUFFER_GUARD) 385 while (len < MAD_BUFFER_GUARD)
386 d->input.data[d->input.length + len++] = 0; 386 d->input.data[d->input.length + len++] = 0;
387 } 387 }
388 388
389 mad_stream_buffer(&d->stream, d->input.data, d->input.length += len); 389 mad_stream_buffer(&d->stream, d->input.data, d->input.length += len);
390 } 390 }
391 391
392 return TRUE; 392 return TRUE;
393} 393}
394 394
395 395
@@ -408,22 +408,22 @@ inline long audio_linear_dither( mad_fixed_t sample, mad_fixed_t& error )
408} 408}
409 409
410 410
411inline void audio_pcm( short *data, unsigned int nsamples, mad_fixed_t *left, mad_fixed_t *right ) 411inline void audio_pcm( short *data, unsigned int nsamples, mad_fixed_t *left, mad_fixed_t *right )
412{ 412{
413 if ( right ) { 413 if ( right ) {
414 while (nsamples--) { 414 while (nsamples--) {
415 data[0] = audio_linear_dither( *left++, left_err ); 415 data[0] = audio_linear_dither( *left++, left_err );
416 data[1] = audio_linear_dither( *right++, right_err ); 416 data[1] = audio_linear_dither( *right++, right_err );
417 data += 2; 417 data += 2;
418 } 418 }
419 } else { 419 } else {
420 while (nsamples--) { 420 while (nsamples--) {
421 data[0] = data[1] = audio_linear_dither( *left++, left_err ); 421 data[0] = data[1] = audio_linear_dither( *left++, left_err );
422 data += 2; 422 data += 2;
423 } 423 }
424 } 424 }
425} 425}
426 426
427 427
428bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) { 428bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) {
429 debugMsg( "LibMadPlugin::decode" ); 429 debugMsg( "LibMadPlugin::decode" );
@@ -433,42 +433,42 @@ bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) {
433 int offset = buffered; 433 int offset = buffered;
434 samplesMade = 0; 434 samplesMade = 0;
435 435
436 static int maxBuffered = 8000; // 65536; 436 static int maxBuffered = 8000; // 65536;
437 437
438 if ( samples > maxBuffered ) 438 if ( samples > maxBuffered )
439 samples = maxBuffered; 439 samples = maxBuffered;
440 440
441 if ( d->flush ) { 441 if ( d->flush ) {
442 buffered = 0; 442 buffered = 0;
443 offset = 0; 443 offset = 0;
444 d->flush = FALSE; 444 d->flush = FALSE;
445 } 445 }
446 446
447 while ( buffered < maxBuffered ) { 447 while ( buffered < maxBuffered ) {
448 448
449 while (mad_frame_decode(&d->frame, &d->stream) == -1) { 449 while (mad_frame_decode(&d->frame, &d->stream) == -1) {
450 if (!MAD_RECOVERABLE(d->stream.error)) { 450 if (!MAD_RECOVERABLE(d->stream.error)) {
451 debugMsg( "feed me" ); 451 debugMsg( "feed me" );
452 return FALSE; // Feed me 452 return FALSE; // Feed me
453 } 453 }
454 if ( d->stream.error == MAD_ERROR_BADCRC ) { 454 if ( d->stream.error == MAD_ERROR_BADCRC ) {
455 mad_frame_mute(&d->frame); 455 mad_frame_mute(&d->frame);
456 qDebug( "error decoding, bad crc" ); 456 qDebug( "error decoding, bad crc" );
457 } 457 }
458 } 458 }
459 459
460 mad_synth_frame(&d->synth, &d->frame); 460 mad_synth_frame(&d->synth, &d->frame);
461 int decodedSamples = d->synth.pcm.length; 461 int decodedSamples = d->synth.pcm.length;
462 memcpy( &(buffer[0][offset]), d->synth.pcm.samples[0], decodedSamples * sizeof(mad_fixed_t) ); 462 memcpy( &(buffer[0][offset]), d->synth.pcm.samples[0], decodedSamples * sizeof(mad_fixed_t) );
463 if ( d->synth.pcm.channels == 2 ) 463 if ( d->synth.pcm.channels == 2 )
464 memcpy( &(buffer[1][offset]), d->synth.pcm.samples[1], decodedSamples * sizeof(mad_fixed_t) ); 464 memcpy( &(buffer[1][offset]), d->synth.pcm.samples[1], decodedSamples * sizeof(mad_fixed_t) );
465 offset += decodedSamples; 465 offset += decodedSamples;
466 buffered += decodedSamples; 466 buffered += decodedSamples;
467 } 467 }
468 468//qApp->processEvents();
469 audio_pcm( output, samples, buffer[0], (d->synth.pcm.channels == 2) ? buffer[1] : 0 ); 469 audio_pcm( output, samples, buffer[0], (d->synth.pcm.channels == 2) ? buffer[1] : 0 );
470// audio_pcm( output, samples, buffer[1], buffer[0] ); 470// audio_pcm( output, samples, buffer[1], buffer[0] );
471// audio_pcm( output, samples, buffer[0], buffer[1] ); 471// audio_pcm( output, samples, buffer[0], buffer[1] );
472 samplesMade = samples; 472 samplesMade = samples;
473 memmove( buffer[0], &(buffer[0][samples]), (buffered - samples) * sizeof(mad_fixed_t) ); 473 memmove( buffer[0], &(buffer[0][samples]), (buffered - samples) * sizeof(mad_fixed_t) );
474 if ( d->synth.pcm.channels == 2 ) 474 if ( d->synth.pcm.channels == 2 )
@@ -490,38 +490,38 @@ bool LibMadPlugin::audioReadStereoSamples( short *output, long samples, long& sa
490bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long samples, long& samplesMade, int ) { 490bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long samples, long& samplesMade, int ) {
491 debugMsg( "LibMadPlugin::audioReadStereoSamples" ); 491 debugMsg( "LibMadPlugin::audioReadStereoSamples" );
492 492
493 static bool needInput = TRUE; 493 static bool needInput = TRUE;
494 494
495 if ( samples == 0 ) 495 if ( samples == 0 )
496 return FALSE; 496 return FALSE;
497 497
498 do { 498 do {
499 if ( needInput ) 499 if ( needInput )
500 if ( !read() ) { 500 if ( !read() ) {
501 // if ( d->input.eof ) 501// if ( d->input.eof )
502 // needInput = FALSE; 502// needInput = FALSE;
503 // else 503// else
504 return FALSE; 504 return FALSE;
505 } 505 }
506 506
507 needInput = FALSE; 507 needInput = FALSE;
508 508
509 if ( decode( output, samples, samplesMade ) ) 509 if ( decode( output, samples, samplesMade ) )
510 return TRUE; 510 return TRUE;
511 else 511 else
512 needInput = TRUE; 512 needInput = TRUE;
513 } 513 }
514 while ( ( samplesMade < samples ) && ( !d->input.eof ) ); 514 while ( ( samplesMade < samples ) && ( !d->input.eof ) );
515/* 515/*
516 static bool firstTimeThru = TRUE; 516 static bool firstTimeThru = TRUE;
517 517
518 if ( firstTimeThru ) { 518 if ( firstTimeThru ) {
519 firstTimeThru = FALSE; 519 firstTimeThru = FALSE;
520 decode( output, samples, samplesMade ); 520 decode( output, samples, samplesMade );
521 return FALSE; 521 return FALSE;
522 } else 522 } else
523*/ 523*/
524 return FALSE; 524 return FALSE;
525} 525}
526 526
527 527
@@ -534,45 +534,45 @@ double LibMadPlugin::getTime() {
534void LibMadPlugin::printID3Tags() { 534void LibMadPlugin::printID3Tags() {
535 debugMsg( "LibMadPlugin::printID3Tags" ); 535 debugMsg( "LibMadPlugin::printID3Tags" );
536 536
537 char id3v1[128 + 1]; 537 char id3v1[128 + 1];
538 538
539 if ( ::lseek( d->input.fd, -128, SEEK_END ) == -1 ) { 539 if ( ::lseek( d->input.fd, -128, SEEK_END ) == -1 ) {
540 qDebug( "error seeking to id3 tags" ); 540 qDebug( "error seeking to id3 tags" );
541 return; 541 return;
542 } 542 }
543 543
544 if ( ::read( d->input.fd, id3v1, 128 ) != 128 ) { 544 if ( ::read( d->input.fd, id3v1, 128 ) != 128 ) {
545 qDebug( "error reading in id3 tags" ); 545 qDebug( "error reading in id3 tags" );
546 return; 546 return;
547 } 547 }
548 548
549 if ( ::strncmp( (const char *)id3v1, "TAG", 3 ) != 0 ) { 549 if ( ::strncmp( (const char *)id3v1, "TAG", 3 ) != 0 ) {
550 debugMsg( "sorry, no id3 tags" ); 550 debugMsg( "sorry, no id3 tags" );
551 } else { 551 } else {
552 int len[5] = { 30, 30, 30, 4, 30 }; 552 int len[5] = { 30, 30, 30, 4, 30 };
553 QString label[5] = { tr( "Title" ), tr( "Artist" ), tr( "Album" ), tr( "Year" ), tr( "Comment" ) }; 553 QString label[5] = { tr( "Title" ), tr( "Artist" ), tr( "Album" ), tr( "Year" ), tr( "Comment" ) };
554 char *ptr = id3v1 + 3, *ptr2 = ptr + len[0]; 554 char *ptr = id3v1 + 3, *ptr2 = ptr + len[0];
555 qDebug( "ID3 tags in file:" ); 555 qDebug( "ID3 tags in file:" );
556 info = ""; 556 info = "";
557 for ( int i = 0; i < 5; ptr += len[i], i++, ptr2 += len[i] ) { 557 for ( int i = 0; i < 5; ptr += len[i], i++, ptr2 += len[i] ) {
558 char push = *ptr2; 558 char push = *ptr2;
559 *ptr2 = '\0'; 559 *ptr2 = '\0';
560 char *ptr3 = ptr2; 560 char *ptr3 = ptr2;
561 while ( ptr3-1 >= ptr && isspace(ptr3[-1]) ) ptr3--; 561 while ( ptr3-1 >= ptr && isspace(ptr3[-1]) ) ptr3--;
562 char push2 = *ptr3; *ptr3 = '\0'; 562 char push2 = *ptr3; *ptr3 = '\0';
563 if ( strcmp( ptr, "" ) ) 563 if ( strcmp( ptr, "" ) )
564 info += ( i != 0 ? ", " : "" ) + label[i] + ": " + ptr; 564 info += ( i != 0 ? ", " : "" ) + label[i] + ": " + ptr;
565 //qDebug( info.latin1() ); 565 //qDebug( info.latin1() );
566 *ptr3 = push2; 566 *ptr3 = push2;
567 *ptr2 = push; 567 *ptr2 = push;
568 } 568 }
569 if (id3v1[126] == 0 && id3v1[127] != 0) 569 if (id3v1[126] == 0 && id3v1[127] != 0)
570 info += tr( ", Track: " ) + id3v1[127]; 570 info += tr( ", Track: " ) + id3v1[127];
571 } 571 }
572 572
573 if ( ::lseek(d->input.fd, 0, SEEK_SET) == -1 ) { 573 if ( ::lseek(d->input.fd, 0, SEEK_SET) == -1 ) {
574 qDebug( "error seeking back to beginning" ); 574 qDebug( "error seeking back to beginning" );
575 return; 575 return;
576 } 576 }
577} 577}
578 578
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.h b/core/multimedia/opieplayer/libmad/libmadplugin.h
index d85e0d4..d163458 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.h
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.h
@@ -18,13 +18,14 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBMAD_PLUGIN_H 20#ifndef LIBMAD_PLUGIN_H
21#define LIBMAD_PLUGIN_H 21#define LIBMAD_PLUGIN_H
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qpe/mediaplayerplugininterface.h> 24//#include <qpe/mediaplayerplugininterface.h>
25#include "../mediaplayerplugininterface.h"
25 26
26 27
27// #define OLD_MEDIAPLAYER_API 28// #define OLD_MEDIAPLAYER_API
28 29
29 30
30class LibMadPluginData; 31class LibMadPluginData;
@@ -49,12 +50,13 @@ public:
49 // If decoder doesn't support audio then return 0 here 50 // If decoder doesn't support audio then return 0 here
50 int audioStreams(); 51 int audioStreams();
51 int audioChannels( int stream ); 52 int audioChannels( int stream );
52 int audioFrequency( int stream ); 53 int audioFrequency( int stream );
53 int audioSamples( int stream ); 54 int audioSamples( int stream );
54 bool audioSetSample( long sample, int stream ); 55 bool audioSetSample( long sample, int stream );
56 int audioBitsPerSample(int) {return 0;}
55 long audioGetSample( int stream ); 57 long audioGetSample( int stream );
56#ifdef OLD_MEDIAPLAYER_API 58#ifdef OLD_MEDIAPLAYER_API
57 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 59 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
58 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 60 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
59 bool audioReadSamples( short *output, int channel, long samples, int stream ); 61 bool audioReadSamples( short *output, int channel, long samples, int stream );
60 bool audioReReadSamples( short *output, int channel, long samples, int stream ); 62 bool audioReReadSamples( short *output, int channel, long samples, int stream );
diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
index 2c5ed3b..bc864ee 100644
--- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
+++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
@@ -17,13 +17,14 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBMAD_PLUGIN_IMPL_H 20#ifndef LIBMAD_PLUGIN_IMPL_H
21#define LIBMAD_PLUGIN_IMPL_H 21#define LIBMAD_PLUGIN_IMPL_H
22 22
23#include <qpe/mediaplayerplugininterface.h> 23//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h"
24 25
25 26
26class LibMadPlugin; 27class LibMadPlugin;
27 28
28 29
29class LibMadPluginImpl : public MediaPlayerPluginInterface 30class LibMadPluginImpl : public MediaPlayerPluginInterface
@@ -38,13 +39,12 @@ public:
38 Q_REFCOUNT 39 Q_REFCOUNT
39 40
40#endif 41#endif
41 42
42 virtual MediaPlayerDecoder *decoder(); 43 virtual MediaPlayerDecoder *decoder();
43 virtual MediaPlayerEncoder *encoder(); 44 virtual MediaPlayerEncoder *encoder();
44
45private: 45private:
46 LibMadPlugin *libmadplugin; 46 LibMadPlugin *libmadplugin;
47 ulong ref; 47 ulong ref;
48}; 48};
49 49
50 50