Diffstat (limited to 'core/multimedia/opieplayer/libmad/libmadplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmad/libmadplugin.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp index 9d1ff8c..1989b4a 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp +++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp | |||
@@ -382,7 +382,7 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
382 | len = http_read_line(tcp_sock, http_request, sizeof(http_request)); | 382 | len = http_read_line(tcp_sock, http_request, sizeof(http_request)); |
383 | 383 | ||
384 | if (len == -1) { | 384 | if (len == -1) { |
385 | qDebug( "http_open: "+ QString(strerror(errno)) +"\n"); | 385 | // qDebug( "http_open: "+ QString(strerror(errno)) +"\n"); |
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | 388 | ||
@@ -396,7 +396,7 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
396 | if (QString(http_request).left(4) == "ICY ") { | 396 | if (QString(http_request).left(4) == "ICY ") { |
397 | /* This is shoutcast/icecast streaming */ | 397 | /* This is shoutcast/icecast streaming */ |
398 | if (strncmp(http_request + 4, "200 ", 4)) { | 398 | if (strncmp(http_request + 4, "200 ", 4)) { |
399 | qDebug("http_open: " + QString(http_request) + "\n"); | 399 | // qDebug("http_open: " + QString(http_request) + "\n"); |
400 | return 0; | 400 | return 0; |
401 | } | 401 | } |
402 | } else if (QString(http_request).left(4) == "icy-") { | 402 | } else if (QString(http_request).left(4) == "icy-") { |
@@ -417,7 +417,7 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
417 | 417 | ||
418 | info = QString(name + genre + url + bitrate + message).replace( QRegExp("\n"), " : " ); | 418 | info = QString(name + genre + url + bitrate + message).replace( QRegExp("\n"), " : " ); |
419 | 419 | ||
420 | qDebug("Stream info: " + info); | 420 | // qDebug("Stream info: " + info); |
421 | 421 | ||
422 | return (tcp_sock); | 422 | return (tcp_sock); |
423 | } | 423 | } |
@@ -429,7 +429,7 @@ bool LibMadPlugin::open( const QString& path ) { | |||
429 | Config cfg("OpiePlayer"); | 429 | Config cfg("OpiePlayer"); |
430 | cfg.setGroup("Options"); | 430 | cfg.setGroup("Options"); |
431 | bufferSize = cfg.readNumEntry("MPeg_BufferSize",MPEG_BUFFER_SIZE); | 431 | bufferSize = cfg.readNumEntry("MPeg_BufferSize",MPEG_BUFFER_SIZE); |
432 | qDebug("buffer size is %d", bufferSize); | 432 | // qDebug("buffer size is %d", bufferSize); |
433 | d->bad_last_frame = 0; | 433 | d->bad_last_frame = 0; |
434 | d->flush = TRUE; | 434 | d->flush = TRUE; |
435 | info = QString( "" ); | 435 | info = QString( "" ); |
@@ -450,13 +450,13 @@ bool LibMadPlugin::open( const QString& path ) { | |||
450 | printID3Tags(); | 450 | printID3Tags(); |
451 | } | 451 | } |
452 | if (d->input.fd == -1) { | 452 | if (d->input.fd == -1) { |
453 | qDebug("error opening %s", d->input.path ); | 453 | // qDebug("error opening %s", d->input.path ); |
454 | return FALSE; | 454 | return FALSE; |
455 | } | 455 | } |
456 | 456 | ||
457 | struct stat stat; | 457 | struct stat stat; |
458 | if (fstat(d->input.fd, &stat) == -1) { | 458 | if (fstat(d->input.fd, &stat) == -1) { |
459 | qDebug("error calling fstat"); return FALSE; | 459 | // qDebug("error calling fstat"); return FALSE; |
460 | } | 460 | } |
461 | if (S_ISREG(stat.st_mode) && stat.st_size > 0) | 461 | if (S_ISREG(stat.st_mode) && stat.st_size > 0) |
462 | d->input.fileLength = stat.st_size; | 462 | d->input.fileLength = stat.st_size; |
@@ -468,7 +468,7 @@ bool LibMadPlugin::open( const QString& path ) { | |||
468 | d->input.length = stat.st_size; | 468 | d->input.length = stat.st_size; |
469 | d->input.fdm = map_file(d->input.fd, &d->input.length); | 469 | d->input.fdm = map_file(d->input.fd, &d->input.length); |
470 | if (d->input.fdm == 0) { | 470 | if (d->input.fdm == 0) { |
471 | qDebug("error mmapping file"); return FALSE; | 471 | // qDebug("error mmapping file"); return FALSE; |
472 | } | 472 | } |
473 | d->input.data = (unsigned char *)d->input.fdm; | 473 | d->input.data = (unsigned char *)d->input.fdm; |
474 | } | 474 | } |
@@ -477,7 +477,7 @@ bool LibMadPlugin::open( const QString& path ) { | |||
477 | if (d->input.data == 0) { | 477 | if (d->input.data == 0) { |
478 | d->input.data = (unsigned char *)malloc( bufferSize /*MPEG_BUFFER_SIZE*/); | 478 | d->input.data = (unsigned char *)malloc( bufferSize /*MPEG_BUFFER_SIZE*/); |
479 | if (d->input.data == 0) { | 479 | if (d->input.data == 0) { |
480 | qDebug("error allocating input buffer"); | 480 | // qDebug("error allocating input buffer"); |
481 | return FALSE; | 481 | return FALSE; |
482 | } | 482 | } |
483 | d->input.length = 0; | 483 | d->input.length = 0; |
@@ -505,7 +505,7 @@ bool LibMadPlugin::close() { | |||
505 | #if defined(HAVE_MMAP) | 505 | #if defined(HAVE_MMAP) |
506 | if (d->input.fdm) { | 506 | if (d->input.fdm) { |
507 | if (unmap_file(d->input.fdm, d->input.length) == -1) { | 507 | if (unmap_file(d->input.fdm, d->input.length) == -1) { |
508 | qDebug("error munmapping file"); | 508 | // qDebug("error munmapping file"); |
509 | result = FALSE; | 509 | result = FALSE; |
510 | } | 510 | } |
511 | d->input.fdm = 0; | 511 | d->input.fdm = 0; |
@@ -519,7 +519,7 @@ bool LibMadPlugin::close() { | |||
519 | } | 519 | } |
520 | 520 | ||
521 | if (::close(d->input.fd) == -1) { | 521 | if (::close(d->input.fd) == -1) { |
522 | qDebug("error closing file %s", d->input.path); | 522 | // qDebug("error closing file %s", d->input.path); |
523 | result = FALSE; | 523 | result = FALSE; |
524 | } | 524 | } |
525 | 525 | ||
@@ -555,7 +555,7 @@ int LibMadPlugin::audioChannels( int ) { | |||
555 | int LibMadPlugin::audioFrequency( int ) { | 555 | int LibMadPlugin::audioFrequency( int ) { |
556 | debugMsg( "LibMadPlugin::audioFrequency" ); | 556 | debugMsg( "LibMadPlugin::audioFrequency" ); |
557 | long t; short t1[5]; audioReadSamples( t1, 2, 1, t, 0 ); | 557 | long t; short t1[5]; audioReadSamples( t1, 2, 1, t, 0 ); |
558 | qDebug( "LibMadPlugin::audioFrequency: %i", d->frame.header.samplerate ); | 558 | // qDebug( "LibMadPlugin::audioFrequency: %i", d->frame.header.samplerate ); |
559 | return d->frame.header.samplerate; | 559 | return d->frame.header.samplerate; |
560 | } | 560 | } |
561 | 561 | ||
@@ -574,9 +574,9 @@ int LibMadPlugin::audioSamples( int ) { | |||
574 | return 0; | 574 | return 0; |
575 | int samples = (d->input.fileLength / (d->frame.header.bitrate/8)) * d->frame.header.samplerate; | 575 | int samples = (d->input.fileLength / (d->frame.header.bitrate/8)) * d->frame.header.samplerate; |
576 | 576 | ||
577 | qDebug( "LibMadPlugin::audioSamples: %i * %i * 8 / %i", (int)d->input.fileLength, | 577 | // qDebug( "LibMadPlugin::audioSamples: %i * %i * 8 / %i", (int)d->input.fileLength, |
578 | (int)d->frame.header.samplerate, (int)d->frame.header.bitrate ); | 578 | // (int)d->frame.header.samplerate, (int)d->frame.header.bitrate ); |
579 | qDebug( "LibMadPlugin::audioSamples: %i", samples ); | 579 | // qDebug( "LibMadPlugin::audioSamples: %i", samples ); |
580 | 580 | ||
581 | return samples; | 581 | return samples; |
582 | 582 | ||
@@ -680,7 +680,7 @@ bool LibMadPlugin::read() { | |||
680 | while (len == -1 && errno == EINTR); | 680 | while (len == -1 && errno == EINTR); |
681 | 681 | ||
682 | if (len == -1) { | 682 | if (len == -1) { |
683 | qDebug("error reading audio"); | 683 | // qDebug("error reading audio"); |
684 | return FALSE; | 684 | return FALSE; |
685 | } | 685 | } |
686 | else if (len == 0) { | 686 | else if (len == 0) { |
@@ -758,7 +758,7 @@ bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) { | |||
758 | } | 758 | } |
759 | if ( d->stream.error == MAD_ERROR_BADCRC ) { | 759 | if ( d->stream.error == MAD_ERROR_BADCRC ) { |
760 | mad_frame_mute(&d->frame); | 760 | mad_frame_mute(&d->frame); |
761 | qDebug( "error decoding, bad crc" ); | 761 | // qDebug( "error decoding, bad crc" ); |
762 | } | 762 | } |
763 | } | 763 | } |
764 | 764 | ||
@@ -821,17 +821,17 @@ double LibMadPlugin::getTime() { | |||
821 | 821 | ||
822 | 822 | ||
823 | void LibMadPlugin::printID3Tags() { | 823 | void LibMadPlugin::printID3Tags() { |
824 | qDebug( "LibMadPlugin::printID3Tags" ); | 824 | // qDebug( "LibMadPlugin::printID3Tags" ); |
825 | 825 | ||
826 | char id3v1[128 + 1]; | 826 | char id3v1[128 + 1]; |
827 | 827 | ||
828 | if ( ::lseek( d->input.fd, -128, SEEK_END ) == -1 ) { | 828 | if ( ::lseek( d->input.fd, -128, SEEK_END ) == -1 ) { |
829 | qDebug( "error seeking to id3 tags" ); | 829 | // qDebug( "error seeking to id3 tags" ); |
830 | return; | 830 | return; |
831 | } | 831 | } |
832 | 832 | ||
833 | if ( ::read( d->input.fd, id3v1, 128 ) != 128 ) { | 833 | if ( ::read( d->input.fd, id3v1, 128 ) != 128 ) { |
834 | qDebug( "error reading in id3 tags" ); | 834 | // qDebug( "error reading in id3 tags" ); |
835 | return; | 835 | return; |
836 | } | 836 | } |
837 | 837 | ||
@@ -841,7 +841,7 @@ void LibMadPlugin::printID3Tags() { | |||
841 | int len[5] = { 30, 30, 30, 4, 30 }; | 841 | int len[5] = { 30, 30, 30, 4, 30 }; |
842 | QString label[5] = { tr( "Title" ), tr( "Artist" ), tr( "Album" ), tr( "Year" ), tr( "Comment" ) }; | 842 | QString label[5] = { tr( "Title" ), tr( "Artist" ), tr( "Album" ), tr( "Year" ), tr( "Comment" ) }; |
843 | char *ptr = id3v1 + 3, *ptr2 = ptr + len[0]; | 843 | char *ptr = id3v1 + 3, *ptr2 = ptr + len[0]; |
844 | qDebug( "ID3 tags in file:" ); | 844 | // qDebug( "ID3 tags in file:" ); |
845 | info = ""; | 845 | info = ""; |
846 | for ( int i = 0; i < 5; ptr += len[i], i++, ptr2 += len[i] ) { | 846 | for ( int i = 0; i < 5; ptr += len[i], i++, ptr2 += len[i] ) { |
847 | char push = *ptr2; | 847 | char push = *ptr2; |
@@ -862,7 +862,7 @@ void LibMadPlugin::printID3Tags() { | |||
862 | } | 862 | } |
863 | 863 | ||
864 | if ( ::lseek(d->input.fd, 0, SEEK_SET) == -1 ) { | 864 | if ( ::lseek(d->input.fd, 0, SEEK_SET) == -1 ) { |
865 | qDebug( "error seeking back to beginning" ); | 865 | // qDebug( "error seeking back to beginning" ); |
866 | return; | 866 | return; |
867 | } | 867 | } |
868 | } | 868 | } |