author | llornkcor <llornkcor> | 2003-06-12 03:17:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-06-12 03:17:27 (UTC) |
commit | 0d4598bd57f7bcb89e894d11a2f33607d2d1e57c (patch) (unidiff) | |
tree | cdac9dc890b945e10f261aa483137b5435bad655 | |
parent | d5fb55632847e18026506af6b482c2cd3def3222 (diff) | |
download | opie-0d4598bd57f7bcb89e894d11a2f33607d2d1e57c.zip opie-0d4598bd57f7bcb89e894d11a2f33607d2d1e57c.tar.gz opie-0d4598bd57f7bcb89e894d11a2f33607d2d1e57c.tar.bz2 |
remove qdebug
-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 | |||
@@ -381,9 +381,9 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
381 | 381 | ||
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 | ||
389 | if (QString(http_request).left(9) == "Location:") { | 389 | if (QString(http_request).left(9) == "Location:") { |
@@ -395,9 +395,9 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
395 | 395 | ||
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-") { |
403 | /* we can have: icy-noticeX, icy-name, icy-genre, icy-url, icy-pub, icy-metaint, icy-br */ | 403 | /* we can have: icy-noticeX, icy-name, icy-genre, icy-url, icy-pub, icy-metaint, icy-br */ |
@@ -416,9 +416,9 @@ int LibMadPlugin::http_open(const QString& path ) { | |||
416 | } while (strcmp(http_request, "\n") != 0); | 416 | } while (strcmp(http_request, "\n") != 0); |
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 | } |
424 | 424 | ||
@@ -428,9 +428,9 @@ bool LibMadPlugin::open( const QString& path ) { | |||
428 | debugMsg( "LibMadPlugin::open" ); | 428 | debugMsg( "LibMadPlugin::open" ); |
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( "" ); |
436 | 436 | ||
@@ -449,15 +449,15 @@ bool LibMadPlugin::open( const QString& path ) { | |||
449 | // thats a better place, since it should only seek for ID3 tags on mp3 files, not streams | 449 | // thats a better place, since it should only seek for ID3 tags on mp3 files, not streams |
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; |
463 | else | 463 | else |
@@ -467,18 +467,18 @@ bool LibMadPlugin::open( const QString& path ) { | |||
467 | if (S_ISREG(stat.st_mode) && stat.st_size > 0) { | 467 | if (S_ISREG(stat.st_mode) && stat.st_size > 0) { |
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 | } |
475 | #endif | 475 | #endif |
476 | 476 | ||
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; |
484 | } | 484 | } |
@@ -504,9 +504,9 @@ bool LibMadPlugin::close() { | |||
504 | 504 | ||
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; |
512 | d->input.data = 0; | 512 | d->input.data = 0; |
@@ -518,9 +518,9 @@ bool LibMadPlugin::close() { | |||
518 | d->input.data = 0; | 518 | d->input.data = 0; |
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 | ||
526 | d->input.fd = 0; | 526 | d->input.fd = 0; |
@@ -554,9 +554,9 @@ int LibMadPlugin::audioChannels( int ) { | |||
554 | 554 | ||
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 | ||
562 | 562 | ||
@@ -573,11 +573,11 @@ int LibMadPlugin::audioSamples( int ) { | |||
573 | if ( d->frame.header.bitrate == 0 ) | 573 | if ( d->frame.header.bitrate == 0 ) |
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 | ||
583 | // return 10000000; | 583 | // return 10000000; |
@@ -679,9 +679,9 @@ bool LibMadPlugin::read() { | |||
679 | } | 679 | } |
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) { |
687 | d->input.eof = 1; | 687 | d->input.eof = 1; |
@@ -757,9 +757,9 @@ bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) { | |||
757 | return FALSE; // Feed me | 757 | return FALSE; // Feed me |
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 | ||
765 | mad_synth_frame(&d->synth, &d->frame); | 765 | mad_synth_frame(&d->synth, &d->frame); |
@@ -820,19 +820,19 @@ double LibMadPlugin::getTime() { | |||
820 | } | 820 | } |
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 | ||
838 | if ( ::strncmp( (const char *)id3v1, "TAG", 3 ) != 0 ) { | 838 | if ( ::strncmp( (const char *)id3v1, "TAG", 3 ) != 0 ) { |
@@ -840,9 +840,9 @@ void LibMadPlugin::printID3Tags() { | |||
840 | } else { | 840 | } else { |
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; |
848 | *ptr2 = '\0'; | 848 | *ptr2 = '\0'; |
@@ -861,9 +861,9 @@ void LibMadPlugin::printID3Tags() { | |||
861 | info += tr( ", Track: " ) + id3v1[127]; | 861 | info += tr( ", Track: " ) + id3v1[127]; |
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 | } |
869 | 869 | ||