Re: [PATCH] Re: [Flac-dev] Strangeness with OggFlac files

2006-11-06 Thread Ralph Giles
On Mon, Nov 06, 2006 at 08:57:49AM -0800, Josh Coalson wrote:

> thanks Erik, can you confirm that this is happening only because
> the total_samples_estimate is 0?  (so the e_o_s setting in the
> existing code is never triggered).

I can confirm this is the case.

 -r
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [PATCH] Re: [Flac-dev] Strangeness with OggFlac files

2006-11-06 Thread Ralph Giles
On Tue, Nov 07, 2006 at 06:31:04AM +1100, Erik de Castro Lopo wrote:

> I haven't tested it, but I don't think just setting packet.e_o_s
> is sufficient to close the stream. The forced ogg_stream_flush()
> is required.

libogg checks the e_o_s flag (and has always done so, according to svn)
so you shouldn't have to call ogg_stream_flush() except when you want to 
force a page boundary (such as after the header packets).

ogg/src/framing.c line 449

One common mistake it to not loop on ogg_stream_pageout() but it looks 
like ogg_encoder_aspect.c is doing that.

 -r
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [PATCH] Re: [Flac-dev] Strangeness with OggFlac files

2006-11-06 Thread Erik de Castro Lopo
Josh Coalson wrote:

> thanks Erik, can you confirm that this is happening only because
> the total_samples_estimate is 0?  (so the e_o_s setting in the
> existing code is never triggered).

In the Ogg code, I believe that there are two things that must be 
satisfied to correctly write an end of stream:

   - packet.e_o_s must be true
   - Need to call ogg_stream_flush() instead of instead of 
 ogg_stream_pageout()

I haven't tested it, but I don't think just setting packet.e_o_s
is sufficient to close the stream. The forced ogg_stream_flush()
is required.

Maybe these two actions can be carried out in the function
FLAC__ogg_encoder_aspect_finish() which currently only does this:

   void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect)
   {
(void)ogg_stream_clear(&aspect->stream_state);
/*@@@ what about the page? */
   }

I could investigate this further, but I'm really busy over the next 
couple of days. I wouldn't be able to look at this until this weekend
or possibly the next.

Erik
-- 
+---+
  Erik de Castro Lopo
+---+
"Do I do everything in C++ and teach a course in advanced swearing?"
-- David Beazley at IPC8, on choosing a language for teaching
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] amd64 issue with flac-1.1.3 beta2

2006-11-06 Thread Josh Coalson
--- Miroslav Lichvar <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 05, 2006 at 11:17:03AM +1100, David Collett wrote:
> > I think I have tracked it down to "FLAC__bitbuffer_get_buffer" in
> > bitbuffer.c taking an unsigned * for bytes, but "write_bitbuffer_"
> in
> > stream_encoder.c is passing a size_t *. On my system it looks like
> unsigned
> > is 4 bytes, where size_t is 8 bytes.
> > 
> > Changing FLAC__bitbuffer_get_buffer to take a size_t * seems to fix
> it.
> > But as I said, I only have 1 days amd64 experience, so I don't
> really
> > know what I am doing! I also havent checked if anyone else is
> calling
> > get_buffer with an unsigned * so maby this will break elseware now.
> > 
> > Has anyone else tested on amd64?
> 
> Yes, I can confirm it. There is also one missed replacement in
> FLAC__BitbufferReadCallback declaration.

ok, fixed both in CVS.

Josh




 

Sponsored Link

Get a free Motorola Razr! Today Only! 
Choose Cingular, Sprint, Verizon, Alltel, or T-Mobile. 
http://www.letstalk.com/inlink.htm?to=592913
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [PATCH] Re: [Flac-dev] Strangeness with OggFlac files

2006-11-06 Thread Josh Coalson
--- Erik de Castro Lopo <[EMAIL PROTECTED]> wrote:
> Erik de Castro Lopo wrote:
> 
> > Josh et al,
> > 
> > I've been tracking down a problem with generating OggFlac files.
> 
> 
> 
> > I have looked into this and suspect that the
> FLAC__stream_encoder_finish()
> > function needs to finish off the stream using a call to
> ogg_stream_flush()
> > instead of the standard function ogg_stream_pageout().
> 
> I bashed on this a bit further and came up with the following patch:
> 
> http://www.mega-nerd.com/tmp/flac-end_of_stream.diff
> 
> There's probably a more tasteful way of acheiving the same result,
> but
> this version does fix the problem.

thanks Erik, can you confirm that this is happening only because
the total_samples_estimate is 0?  (so the e_o_s setting in the
existing code is never triggered).

Josh




 

Sponsored Link

Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate
Click now to apply http://yahoo.degrees.info
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] better seeking

2006-11-06 Thread Josh Coalson
ok, tried it out... passes test/test_seeking.sh and my
"xmms twitch" test, checked in to CVS.  thanks!

Josh


--- Miroslav Lichvar <[EMAIL PROTECTED]> wrote:

> On Fri, Nov 03, 2006 at 10:01:42AM +0100, Miroslav Lichvar wrote:
> > Thanks. Sending latest version of the patch. Now it can seek in
> files
> > that have large id3 tag (or any random data) at the end and it
> won't loop on
> > streams with shuffled frames.
> 
> One small patch on top of that and it's bug free. ;)
> 
> -- 
> Miroslav Lichvar
> > --- flac/src/libFLAC/stream_decoder.c.orig  2006-11-03
> 18:52:38.104291323 +0100
> +++ flac/src/libFLAC/stream_decoder.c 2006-11-03 18:53:41.350727144
> +0100
> @@ -2995,7 +2995,7 @@
>  
>   while(1) {
>   /* check if the bounds are still ok */
> - if (lower_bound_sample + FLAC__MIN_BLOCK_SIZE > 
> upper_bound_sample
> || lower_bound > upper_bound) {
> + if (lower_bound_sample >= upper_bound_sample || lower_bound >
> upper_bound) {
>   decoder->protected_->state = 
> FLAC__STREAM_DECODER_SEEK_ERROR;
>   return false;
>   }
> 




 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev