<TT>--serial-number=#</TT>
</TD>
<TD>
- When used with --ogg, specifies the serial number to use the for the FLAC stream. When encoding and no serial number is given, flac uses '0'. When decoding and no number is given, flac uses the serial number of the first page.<P>
+ When used with --ogg, specifies the serial number to use for the first Ogg FLAC stream, which is then incremented for each additional stream. When encoding and no serial number is given, <TT><B>flac</B></TT> uses a random number for the first stream, then increments it for each additional stream. When decoding and no number is given, <TT><B>flac</B></TT> uses the serial number of the first page.<P>
</TD>
</TR>
</TABLE>
<term><option>--serial-number</option>=<replaceable>#</replaceable></term>
<listitem>
- <para>When used with --ogg, specifies the serial
- number to use for the FLAC stream. When encoding and
- no serial number is given, flac uses '0'. When
- decoding and no number is given, flac uses the serial
- number of the first page.</para>
+ <para>When used with --ogg, specifies the serial number to
+ use for the first Ogg FLAC stream, which is then
+ incremented for each additional stream. When encoding and
+ no serial number is given, flac uses a random number for
+ the first stream, then increments it for each additional
+ stream. When decoding and no number is given, flac uses
+ the serial number of the first page.</para>
</listitem>
</varlistentry>
#include <stdio.h> /* for FILE etc. */
#include <stdlib.h> /* for malloc */
#include <string.h> /* for strcmp() */
-#include <time.h>
#include "FLAC/all.h"
#include "share/grabbag.h"
#include "encode.h"
e->blocksize = options.blocksize;
e->stats_mask = (options.do_exhaustive_model_search || options.do_qlp_coeff_prec_search)? 0x0f : 0x3f;
- /* set a random serial number if one has not yet been specified */
- if(!options.has_serial_number) {
- srand(time(0));
- options.serial_number = rand();
- options.has_serial_number = true;
- }
-
#ifdef FLAC__HAS_OGG
if(e->use_ogg) {
if(e->is_stdout) {
- if(options.has_serial_number)
- OggFLAC__stream_encoder_set_serial_number(e->encoder.ogg.stream, options.serial_number);
+ OggFLAC__stream_encoder_set_serial_number(e->encoder.ogg.stream, options.serial_number);
OggFLAC__stream_encoder_set_verify(e->encoder.ogg.stream, options.verify);
OggFLAC__stream_encoder_set_streamable_subset(e->encoder.ogg.stream, !options.lax);
OggFLAC__stream_encoder_set_do_mid_side_stereo(e->encoder.ogg.stream, options.do_mid_side);
}
}
else {
- if(options.has_serial_number)
- OggFLAC__file_encoder_set_serial_number(e->encoder.ogg.file, options.serial_number);
+ OggFLAC__file_encoder_set_serial_number(e->encoder.ogg.file, options.serial_number);
OggFLAC__file_encoder_set_filename(e->encoder.ogg.file, e->outfilename);
OggFLAC__file_encoder_set_verify(e->encoder.ogg.file, options.verify);
OggFLAC__file_encoder_set_streamable_subset(e->encoder.ogg.file, !options.lax);
FLAC__bool verify;
#ifdef FLAC__HAS_OGG
FLAC__bool use_ogg;
- FLAC__bool has_serial_number;
long serial_number;
#endif
FLAC__bool lax;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
common_options.verify = option_values.verify;
#ifdef FLAC__HAS_OGG
common_options.use_ogg = option_values.use_ogg;
- common_options.has_serial_number = option_values.has_serial_number;
- common_options.serial_number = option_values.serial_number;
+ /* set a random serial number if one has not yet been specified */
+ if(!option_values.has_serial_number) {
+ srand(time(0));
+ option_values.serial_number = rand();
+ option_values.has_serial_number = true;
+ }
+ common_options.serial_number = option_values.serial_number++;
#endif
common_options.lax = option_values.lax;
common_options.do_mid_side = option_values.do_mid_side;