# HG changeset patch # User yaz # Date 1178048967 25200 # Node ID e46b98155d5d08bccba5e9fcdbe7c28aa27fcffe # Parent 34da98fd7d266c5fc82e1a84a88ce5d0f2346d51 [svn] - fix a bug which counts number of frames twice in handling xing header. - now fileinfo dialog calculates play length even though TLEN tag exists so that it can overwrite wrong TLEN tag. diff -r 34da98fd7d26 -r e46b98155d5d ChangeLog --- a/ChangeLog Tue May 01 10:38:27 2007 -0700 +++ b/ChangeLog Tue May 01 12:49:27 2007 -0700 @@ -1,3 +1,12 @@ +2007-05-01 17:38:27 +0000 Ralf Ertzinger + revision [2132] + + - Fix alternative code path in flac_write + + trunk/src/filewriter/flac.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + + 2007-05-01 15:54:31 +0000 William Pitcock revision [2130] - add tuple handling, but i don't think i'm doing it right... diff -r 34da98fd7d26 -r e46b98155d5d src/madplug/decoder.c --- a/src/madplug/decoder.c Tue May 01 10:38:27 2007 -0700 +++ b/src/madplug/decoder.c Tue May 01 12:49:27 2007 -0700 @@ -191,6 +191,11 @@ info->pos = mad_timer_zero; info->duration = mad_timer_zero; // should be cleared before loop, if we use it as break condition. + if(info->fileinfo_request == TRUE) { + info->tuple->length = -1; + info->fileinfo_request = FALSE; + } + #ifdef DEBUG g_message("f: scan_file"); g_message("scan_file frames = %d", info->frames); @@ -294,9 +299,10 @@ #endif /* DEBUG */ has_xing = TRUE; info->vbr = TRUE; /* otherwise xing header would have been 'Info' */ - info->frames = info->xing.frames; - if(info->tuple->length == -1) - mad_timer_multiply(&info->duration, info->frames); + if(info->tuple->length == -1) { + info->duration = mad_timer_zero; + mad_timer_multiply(&info->duration, info->xing.frames); + } else { info->duration.seconds = info->tuple->length / 1000; info->duration.fraction = info->tuple->length % 1000; @@ -378,6 +384,9 @@ break; } + if (info->xing.frames) + info->frames = info->xing.frames; + if (info->vbr && xing_bitrate != 0) { info->bitrate = xing_bitrate; } diff -r 34da98fd7d26 -r e46b98155d5d src/madplug/fileinfo.c --- a/src/madplug/fileinfo.c Tue May 01 10:38:27 2007 -0700 +++ b/src/madplug/fileinfo.c Tue May 01 12:49:27 2007 -0700 @@ -586,6 +586,7 @@ utf_filename = str_to_utf8(filename); create_window(); + info.fileinfo_request = TRUE; input_get_info(&info, info.remote ? TRUE : FALSE); title = g_strdup_printf("File Info - %s", g_basename(utf_filename)); diff -r 34da98fd7d26 -r e46b98155d5d src/madplug/input.c --- a/src/madplug/input.c Tue May 01 10:38:27 2007 -0700 +++ b/src/madplug/input.c Tue May 01 12:49:27 2007 -0700 @@ -122,6 +122,8 @@ if(audmad_is_remote((gchar *)url)) info->remote = TRUE; + info->fileinfo_request = FALSE; + #ifdef DEBUG g_message("i: info->size = %lu", (long unsigned int)info->size); g_message("e: input_init"); diff -r 34da98fd7d26 -r e46b98155d5d src/madplug/plugin.h --- a/src/madplug/plugin.h Tue May 01 10:38:27 2007 -0700 +++ b/src/madplug/plugin.h Tue May 01 12:49:27 2007 -0700 @@ -52,7 +52,7 @@ /* InputPlayback */ InputPlayback *playback; - /* flags */ + /* seek time */ gulong seek; /**< seek time in milliseconds */ /* state */ @@ -98,7 +98,9 @@ VFSFile *infile; gint offset; + /* flags */ gboolean remote; + gboolean fileinfo_request; }; diff -r 34da98fd7d26 -r e46b98155d5d src/madplug/xing.c --- a/src/madplug/xing.c Tue May 01 10:38:27 2007 -0700 +++ b/src/madplug/xing.c Tue May 01 12:49:27 2007 -0700 @@ -32,6 +32,10 @@ void xing_init(struct xing *xing) { xing->flags = 0; + xing->frames = 0; + xing->bytes = 0; + xing->toc[0] = '\0'; + xing->scale = 0; } /*