Mercurial > audlegacy-plugins
comparison src/madplug/decoder.c @ 778:209b08a3eff6 trunk
[svn] - hide seek bar for unseekable (info->size = 0) stream.
| author | yaz |
|---|---|
| date | Sat, 03 Mar 2007 22:55:57 -0800 |
| parents | 22c82f3c0411 |
| children | 83a38bcfe7c8 |
comparison
equal
deleted
inserted
replaced
| 777:13bb2cf2f9e6 | 778:209b08a3eff6 |
|---|---|
| 429 info->title = xmms_get_titlestring(audmad_config.title_override == TRUE ? | 429 info->title = xmms_get_titlestring(audmad_config.title_override == TRUE ? |
| 430 audmad_config.id3_format : xmms_get_gentitle_format(), info->tuple); | 430 audmad_config.id3_format : xmms_get_gentitle_format(), info->tuple); |
| 431 | 431 |
| 432 tlen = (gint) mad_timer_count(info->duration, MAD_UNITS_MILLISECONDS), | 432 tlen = (gint) mad_timer_count(info->duration, MAD_UNITS_MILLISECONDS), |
| 433 mad_plugin->set_info(info->title, | 433 mad_plugin->set_info(info->title, |
| 434 tlen == 0 ? -1 : tlen, | 434 (tlen == 0 || info->size <= 0) ? -1 : tlen, |
| 435 info->bitrate, info->freq, info->channels); | 435 info->bitrate, info->freq, info->channels); |
| 436 #ifdef DEBUG | 436 #ifdef DEBUG |
| 437 g_message("decode: tlen = %d\n", tlen); | 437 g_message("decode: tlen = %d\n", tlen); |
| 438 #endif | 438 #endif |
| 439 | 439 |
| 494 while (skip); | 494 while (skip); |
| 495 seek_skip = FALSE; | 495 seek_skip = FALSE; |
| 496 } | 496 } |
| 497 | 497 |
| 498 while (info->playback->playing) { | 498 while (info->playback->playing) { |
| 499 if (info->seek != -1 && info->size != 0) { | 499 if (info->seek != -1 && info->size > 0) { |
| 500 #ifdef DEBUG | 500 #ifdef DEBUG |
| 501 g_message("seeking: %d", info->seek); | 501 g_message("seeking: %d", info->seek); |
| 502 #endif | 502 #endif |
| 503 int new_position; | 503 int new_position; |
| 504 int seconds = | 504 int seconds = |
| 549 continue; | 549 continue; |
| 550 } | 550 } |
| 551 | 551 |
| 552 info->bitrate = frame.header.bitrate; | 552 info->bitrate = frame.header.bitrate; |
| 553 | 553 |
| 554 if (!info->remote && !audmad_config.show_avg_vbr_bitrate && info->vbr && (iteration % 40 == 0)) { | 554 if (!audmad_config.show_avg_vbr_bitrate && info->vbr && (iteration % 40 == 0)) { |
| 555 #ifdef DEBUG | |
| 556 g_message("decode vbr tlen = %d", tlen); | |
| 557 #endif | |
| 555 mad_plugin->set_info(info->title, | 558 mad_plugin->set_info(info->title, |
| 556 tlen == 0 ? -1 : tlen, | 559 (tlen == 0 || info->size <= 0) ? -1 : tlen, |
| 557 info->bitrate, info->freq, info->channels); | 560 info->bitrate, info->freq, info->channels); |
| 558 } | 561 } |
| 559 iteration++; | 562 iteration++; |
| 560 | 563 |
| 561 if (mad_frame_decode(&frame, &stream) == -1) { | 564 if (mad_frame_decode(&frame, &stream) == -1) { |
