From c53dd3106405a3d615ceeaf9072a980028957b66 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Mon, 12 Jun 2017 07:53:32 +0200 Subject: [PATCH] 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. --- src/core/audio/AudioFileOgg.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/audio/AudioFileOgg.cpp b/src/core/audio/AudioFileOgg.cpp index 526776a73ef..170f411d20b 100644 --- a/src/core/audio/AudioFileOgg.cpp +++ b/src/core/audio/AudioFileOgg.cpp @@ -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