Silence warning message and fix obsolete vorbis tag message (#3634)

We give the stream a unique serial number and make sure it
isn't '0' or 'UINT_32_MAX'.
Change obsolete 'Linux MultiMedia Studio' to 'LMMS' in
ogg file comment.
This commit is contained in:
Oskar Wallgren
2017-06-12 07:53:32 +02:00
committed by GitHub
parent ad2c843e20
commit c53dd31064

View File

@@ -70,8 +70,7 @@ inline int AudioFileOgg::writePage()
bool AudioFileOgg::startEncoding()
{
vorbis_comment vc;
const char * comments = "Cool=This song has been made using Linux "
"MultiMedia Studio";
const char * comments = "Cool=This song has been made using LMMS";
int comment_length = strlen( comments );
char * user_comments = new char[comment_length + 1];
strcpy( user_comments, comments );
@@ -100,7 +99,7 @@ bool AudioFileOgg::startEncoding()
m_rate = 48000;
setSampleRate( 48000 );
}
m_serialNo = 0; // track-num?
m_comments = &vc; // comments for ogg-file
// Have vorbisenc choose a mode for us
@@ -135,6 +134,10 @@ bool AudioFileOgg::startEncoding()
vorbis_analysis_init( &m_vd, &m_vi );
vorbis_block_init( &m_vd, &m_vb );
// We give our ogg file a random serial number and avoid
// 0 and UINT32_MAX which can get you into trouble.
qsrand( time( 0 ) );
m_serialNo = 0xD0000000 + qrand() % 0x0FFFFFFF;
ogg_stream_init( &m_os, m_serialNo );
// Now, build the three header packets and send through to the stream