From 1d937c0dbc64a25f7aa8b221c24d24953a59d002 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Fri, 13 Apr 2001 23:03:02 +0000 Subject: [PATCH] fix bug where seek point was hit during metadata write_callback time --- src/flac/encode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index 678faaba..3420bf02 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -788,8 +788,8 @@ FLAC__EncoderWriteStatus write_callback(const FLAC__Encoder *encoder, const byte encoder_wrapper_struct *encoder_wrapper = (encoder_wrapper_struct *)client_data; unsigned mask = (encoder->do_exhaustive_model_search || encoder->do_qlp_coeff_prec_search)? 0x07 : 0x1f; - /* mark the current seek point if hit */ - if(encoder_wrapper->seek_table.num_points > 0) { + /* mark the current seek point if hit (if stream_offset == 0 that means we're still writing metadata and haven't hit the first frame yet) */ + if(encoder_wrapper->stream_offset > 0 && encoder_wrapper->seek_table.num_points > 0) { uint64 current_sample = (uint64)current_frame * (uint64)encoder->blocksize, test_sample; unsigned i; for(i = encoder_wrapper->first_seek_point_to_check; i < encoder_wrapper->seek_table.num_points; i++) {