Commit 1138520d authored by Josh Coalson's avatar Josh Coalson
Browse files

when encoding to Ogg FLAC, set a random serial number (instead of 0) if one is...

when encoding to Ogg FLAC, set a random serial number (instead of 0) if one is not provided on the command-line
parent cd5b1a63
......@@ -28,6 +28,11 @@
#include <stdio.h> /* for FILE etc. */
#include <stdlib.h> /* for malloc */
#include <string.h> /* for strcmp() */
#if defined _MSC_VER || defined __MINGW32__
#include <time.h>
#else
#include <sys/time.h>
#endif
#include "FLAC/all.h"
#include "share/grabbag.h"
#include "encode.h"
......@@ -1459,6 +1464,13 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio
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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment