Skip to content

Commit

Permalink
Silence warning message and fix obsolete vorbis tag message (#3634)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zonkmachine authored Jun 12, 2017
1 parent ad2c843 commit c53dd31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/audio/AudioFileOgg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c53dd31

Please sign in to comment.