Skip to content

Commit

Permalink
fix tracklength - caused segfaults if specified far too small (iTrack…
Browse files Browse the repository at this point in the history
…Length is in seconds)
  • Loading branch information
Jonathan Marshall committed May 24, 2014
1 parent d047296 commit 71ffcf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EncoderFlac.cpp
Expand Up @@ -151,7 +151,7 @@ bool Init(int iInChannels, int iInRate, int iInBits,
ok &= FLAC__stream_encoder_set_channels(m_encoder, 2);
ok &= FLAC__stream_encoder_set_bits_per_sample(m_encoder, 16);
ok &= FLAC__stream_encoder_set_sample_rate(m_encoder, 44100);
ok &= FLAC__stream_encoder_set_total_samples_estimate(m_encoder, iTrackLength / 4);
ok &= FLAC__stream_encoder_set_total_samples_estimate(m_encoder, (FLAC__uint64)iTrackLength * 44100);
ok &= FLAC__stream_encoder_set_compression_level(m_encoder, level);

// now add some metadata
Expand Down

0 comments on commit 71ffcf7

Please sign in to comment.