[Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Matt Zimmerman
severity 200435 normal
thanks

I received this bug report from a Debian user.  I can't think of any reason
offhand why the command line tool would work while the xmms plugin would
fail.

- Forwarded message from Stephan Niemz <[EMAIL PROTECTED]> -

Date: Tue, 8 Jul 2003 10:24:57 +0200
From: Stephan Niemz <[EMAIL PROTECTED]>
Resent-From: Stephan Niemz <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: Bug#200435: xmms-flac: doesn't properly support long files

Package: xmms-flac
Version: 1.1.0-4
Severity: important

Xmms-flac has problems with files longer than 55 minutes and 54 seconds.
It shows the files (and length) correctly in the playlist, but as soon as I
start playing such a file, the length kind of switches to 55:54.  I can still
play these files completely, but the remaining time is obviously not correct
and I can't seek or jump to a position after this 55:54 barrier, which is
really bad (hence the severity important).  The files decode fine with the
command line tool.

What's happening here?

Thanks,

- Stephan.


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux gauss.dali.inka.de 2.4.20 #4 Wed Jun 25 16:30:40 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages xmms-flac depends on:
ii  libc6  2.3.1-17  GNU C Library: Shared libraries an
ii  libflac4   1.1.0-4   Free Lossless Audio Codec - runtim
ii  libglib1.2 1.2.10-9  The GLib library of C routines
ii  libgtk1.2  1.2.10-16 The GIMP Toolkit set of widgets fo
ii  libid3-3.8.3   3.8.3-2   Library for manipulating ID3v1 and
ii  libstdc++5 1:3.3.1-0pre0 The GNU Standard C++ Library v3
ii  xlibs  4.2.1-9   X Window System client libraries
ii  xmms   1.2.7-3   Versatile X audio player that look
ii  zlib1g 1:1.1.4-13compression library - runtime



- End forwarded message -

-- 
 - mdz


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Miroslav Lichvar
On Tue, Jul 08, 2003 at 11:07:09AM -0400, Matt Zimmerman wrote:
> severity 200435 normal
> thanks
> 
> I received this bug report from a Debian user.  I can't think of any reason
> offhand why the command line tool would work while the xmms plugin would
> fail.
...

It's an overflow, this patch will fix it. 

--- plugin.c.orig   2003-05-20 21:57:04.0 +0200
+++ plugin.c2003-07-08 22:03:37.0 +0200
@@ -537,7 +537,7 @@
file_info->bits_per_sample = 
metadata->data.stream_info.bits_per_sample;
file_info->channels = metadata->data.stream_info.channels;
file_info->sample_rate = metadata->data.stream_info.sample_rate;
-   file_info->length_in_msec = file_info->total_samples * 10 / 
(file_info->sample_rate / 100);
+   file_info->length_in_msec = (FLAC__uint64)file_info->total_samples * 
10 / (file_info->sample_rate / 100);
}
else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
double gain, peak;

-- 
Miroslav Lichvar


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Matt Zimmerman
On Tue, Jul 08, 2003 at 10:11:49PM +0200, Miroslav Lichvar wrote:

> On Tue, Jul 08, 2003 at 11:07:09AM -0400, Matt Zimmerman wrote:
> > severity 200435 normal
> > thanks
> > 
> > I received this bug report from a Debian user.  I can't think of any reason
> > offhand why the command line tool would work while the xmms plugin would
> > fail.
> ...
> 
> It's an overflow, this patch will fix it. 
> 
> --- plugin.c.orig 2003-05-20 21:57:04.0 +0200
> +++ plugin.c  2003-07-08 22:03:37.0 +0200
> @@ -537,7 +537,7 @@
>   file_info->bits_per_sample = 
> metadata->data.stream_info.bits_per_sample;
>   file_info->channels = metadata->data.stream_info.channels;
>   file_info->sample_rate = metadata->data.stream_info.sample_rate;
> - file_info->length_in_msec = file_info->total_samples * 10 / 
> (file_info->sample_rate / 100);
> + file_info->length_in_msec = (FLAC__uint64)file_info->total_samples * 
> 10 / (file_info->sample_rate / 100);
>   }
>   else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
>   double gain, peak;

It seems like would be simpler to do something like:

(file_info->total_samples / file_info->sample_rate) * 1000;

-- 
 - mdz


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


[Flac-dev] Storing FLAC in Matroska

2003-07-08 Thread Jory
Hello,
I'm looking into storing FLAC audio in Matroska and I have a few
questions.

1. Can I use libflac to extract the compressed frames?
Or will I need to write up a simple file parser?

2. What is required to decode the frames?
>From the docs I understand that you need the FRAME and you may need the
METADATA_BLOCK.


Thanks,
Jory Stone
[EMAIL PROTECTED]

Matroska, the new, extensible open standard A/V container format
http://www.matroska.org/




---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properlysupport long files]

2003-07-08 Thread Steven Richman
> > -   file_info->length_in_msec = file_info->total_samples * 10 / 
> > (file_info->sample_rate / 100);
> > +   file_info->length_in_msec = (FLAC__uint64)file_info->total_samples * 
> > 10 / (file_info->sample_rate / 100);
...
> It seems like would be simpler to do something like:
> 
> (file_info->total_samples / file_info->sample_rate) * 1000;

Without a float cast, this truncates the length so it's always a multiple
of 1000ms. That's cool now, but it wouldn't be if the xmms gui changed to
display track lengths with, say, tenth-of-a-second precision.

,steven.



---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Matt Zimmerman
On Tue, Jul 08, 2003 at 05:17:50PM -0400, Steven Richman wrote:

> > > - file_info->length_in_msec = file_info->total_samples * 10 / 
> > > (file_info->sample_rate / 100);
> > > + file_info->length_in_msec = (FLAC__uint64)file_info->total_samples * 
> > > 10 / (file_info->sample_rate / 100);
> ...
> > It seems like would be simpler to do something like:
> > 
> > (file_info->total_samples / file_info->sample_rate) * 1000;
> 
> Without a float cast, this truncates the length so it's always a multiple
> of 1000ms. That's cool now, but it wouldn't be if the xmms gui changed to
> display track lengths with, say, tenth-of-a-second precision.

This seems no worse than the fact that the sampling rate ends up being
rounded to the nearest multiple of 100, but I see your point.

-- 
 - mdz


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


[Flac-dev] Re: [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Christian Weisgerber
Matt Zimmerman <[EMAIL PROTECTED]> wrote:

> I received this bug report from a Debian user.

> Xmms-flac has problems with files longer than 55 minutes and 54 seconds.
> It shows the files (and length) correctly in the playlist, but as soon as I
> start playing such a file, the length kind of switches to 55:54.  I can still
> play these files completely, but the remaining time is obviously not correct
> and I can't seek or jump to a position after this 55:54 barrier,

I cannot reproduce this (on OpenBSD/i386).  I ripped, encoded,
played, and seeked through "Made in Japan" (76:44).  Works fine.

-- 
Christian "naddy" Weisgerber  [EMAIL PROTECTED]


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] mpd has support for flac!

2003-07-08 Thread Josh Coalson
--- starz <[EMAIL PROTECTED]> wrote:
> http://musicpd.sf.net just came out today, with (amongst many other
> things)
> support for flac. MPD is a very stable, lean Music Playing Daemon
> written
> in C, that can be interfaced several different ways, through php,
> plain old
> telnet, there is a CLI on the way, and a GTK2 client on the way also.
> Please give it a try and tell us what you think @ irc.oftc.net #mpd.

cool, added a link on the S/W section (main page).

Josh


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] Storing FLAC in Matroska

2003-07-08 Thread Josh Coalson
--- Jory <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm looking into storing FLAC audio in Matroska and I have a few
> questions.
> 
> 1. Can I use libflac to extract the compressed frames?
> Or will I need to write up a simple file parser?

I'm not sure I understand your question, but one unfortunate
fact about native FLAC is that you cannot discover the frame
boundaries without decoding.  But you can decode a file, and
after each frame get the current stream position from the
decoder, which will tell you where to chop the original stream.
See the source for metaflac for an example, where it uses this
method to add seekpoints to a seektable.

> 2. What is required to decode the frames?
> From the docs I understand that you need the FRAME and you may need
> the
> METADATA_BLOCK.

If it is in the streamable subset, you need only what's in the
frames.  If not, you may need some numbers from the STREAMINFO
metadata block.  Search for 'subset' on
http://flac.sourceforge.net/format.html

Josh


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Josh Coalson
--- Miroslav Lichvar <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 08, 2003 at 11:07:09AM -0400, Matt Zimmerman wrote:
> > severity 200435 normal
> > thanks
> > 
> > I received this bug report from a Debian user.  I can't think of
> any reason
> > offhand why the command line tool would work while the xmms plugin
> would
> > fail.
> ...
> 
> It's an overflow, this patch will fix it. 
> [...]

thanks, checked it in to CVS...

Josh


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] Re: [st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]

2003-07-08 Thread Miroslav Lichvar
On Tue, Jul 08, 2003 at 08:59:13PM +, Christian Weisgerber wrote:
> Matt Zimmerman <[EMAIL PROTECTED]> wrote:
> 
> > I received this bug report from a Debian user.
> 
> > Xmms-flac has problems with files longer than 55 minutes and 54 seconds.
> > It shows the files (and length) correctly in the playlist, but as soon as I
> > start playing such a file, the length kind of switches to 55:54.  I can still
> > play these files completely, but the remaining time is obviously not correct
> > and I can't seek or jump to a position after this 55:54 barrier,
> 
> I cannot reproduce this (on OpenBSD/i386).  I ripped, encoded,
> played, and seeked through "Made in Japan" (76:44).  Works fine.

That's too short :).

2^32 / 10 / 44100 / 60 = 162.3 minutes.

-- 
Miroslav Lichvar


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev


Re: [Flac-dev] Storing FLAC in Matroska

2003-07-08 Thread Jory
First, Thank you for your answers.

I using the following code to try simply decode a flac file and write the
decoded data raw PCM file. The resulting file is just noise and pops, so is
the decoded data in a different format than PCM?

struct flacData {
 FILE *inputFile;
 FILE *outputFile;
 char *filename;
};

FLAC__StreamDecoderReadStatus flac_DecoderReadCallback(const
FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void
*client_data)
{
 flacData *ourData = (flacData *)client_data;

 *bytes = fread((void *)buffer, 1, *bytes, ourData->inputFile);

 return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
};

FLAC__StreamDecoderWriteStatus flac_DecoderWriteCallback(const
FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32
*const buffer[], void *client_data)
{
 flacData *ourData = (flacData *)client_data;

 for(int current_sample = 0; current_sample < frame->header.blocksize;
current_sample++)
 {
  for(int channel = 0; channel < frame->header.channels; channel++)
  {
   fwrite((void *)&buffer[channel][current_sample], 1, 1,
ourData->outputFile);
  }
 }

 return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
};

void flac_DecoderMetaDataCallback(const FLAC__StreamDecoder *decoder, const
FLAC__StreamMetadata *metadata, void *client_data)
{
 flacData *ourData = (flacData *)client_data;

};

void flac_DecoderErrorCallback(const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status, void *client_data)
{
 flacData *ourData = (flacData *)client_data;

};

int main(int argc, char* argv[])
{
 //Create the FLAC stream decoder
 FLAC__StreamDecoder *flac_file = FLAC__stream_decoder_new();

 //Setup the callbacks
 FLAC__stream_decoder_set_read_callback(flac_file,
(FLAC__StreamDecoderReadCallback)flac_DecoderReadCallback);
 FLAC__stream_decoder_set_write_callback(flac_file,
(FLAC__StreamDecoderWriteCallback)flac_DecoderWriteCallback);
 FLAC__stream_decoder_set_metadata_callback(flac_file,
(FLAC__StreamDecoderMetadataCallback)flac_DecoderMetaDataCallback);
 FLAC__stream_decoder_set_error_callback(flac_file,
(FLAC__StreamDecoderErrorCallback)flac_DecoderErrorCallback);

 //Set our data up
 flacData *flacObjData = new flacData;
 flacObjData->filename = "C:\\My Music\\44.1Hz Stereo PCM_5.flac";
 flacObjData->inputFile = fopen(flacObjData->filename, "rb");
 flacObjData->outputFile = fopen("test.raw", "wb");
 FLAC__stream_decoder_set_client_data(flac_file, (void *)flacObjData);

 //Init the decoder
 FLAC__stream_decoder_init(flac_file);
 //Start decoding, the callbacks do all the work from here
 FLAC__stream_decoder_process_until_end_of_stream(flac_file);
 return 0;
}

- Original Message -
From: "Josh Coalson" <[EMAIL PROTECTED]>
To: "Jory" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 5:02 PM
Subject: Re: [Flac-dev] Storing FLAC in Matroska


> --- Jory <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I'm looking into storing FLAC audio in Matroska and I have a few
> > questions.
> >
> > 1. Can I use libflac to extract the compressed frames?
> > Or will I need to write up a simple file parser?
>
> I'm not sure I understand your question, but one unfortunate
> fact about native FLAC is that you cannot discover the frame
> boundaries without decoding.  But you can decode a file, and
> after each frame get the current stream position from the
> decoder, which will tell you where to chop the original stream.
> See the source for metaflac for an example, where it uses this
> method to add seekpoints to a seektable.
>
> > 2. What is required to decode the frames?
> > From the docs I understand that you need the FRAME and you may need
> > the
> > METADATA_BLOCK.
>
> If it is in the streamable subset, you need only what's in the
> frames.  If not, you may need some numbers from the STREAMINFO
> metadata block.  Search for 'subset' on
> http://flac.sourceforge.net/format.html
>
> Josh
>
>
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com




---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
Flac-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/flac-dev