<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="post-text" itemprop="description">
      <p>Hey, <br>
      </p>
      <p>I am decoding an OGG video (theora & vorbis as codecs) and
        want to show it on the screen (using Ogre 3D) while playing its
        sound. I can decode the image stream just fine and the video
        plays perfectly with the correct frame rate, etc.</p>
      <p>However, I cannot get the sound to play at all with OpenAL. </p>
      <p>Here is how I decode audio packets (in a background thread, the
        equivalent works just fine for the image stream of the video
        file):</p>
      <pre style="" class="lang-cpp prettyprint prettyprinted"><code><span class="com">//------------------------------------------------------------------------------</span><span class="pln">
</span><span class="typ">int</span><span class="pln"> decodeAudioPacket</span><span class="pun">(</span><span class="pln">  </span><span class="typ">AVPacket</span><span class="pun">&</span><span class="pln"> p_packet</span><span class="pun">,</span><span class="pln"> </span><span class="typ">AVCodecContext</span><span class="pun">*</span><span class="pln"> p_audioCodecContext</span><span class="pun">,</span><span class="pln"> </span><span class="typ">AVFrame</span><span class="pun">*</span><span class="pln"> p_frame</span><span class="pun">,</span><span class="pln">
                        </span><span class="typ">FFmpegVideoPlayer</span><span class="pun">*</span><span class="pln"> p_player</span><span class="pun">,</span><span class="pln"> </span><span class="typ">VideoInfo</span><span class="pun">&</span><span class="pln"> p_videoInfo</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="com">// Decode audio frame</span><span class="pln">
    </span><span class="typ">int</span><span class="pln"> got_frame </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
    </span><span class="typ">int</span><span class="pln"> decoded </span><span class="pun">=</span><span class="pln"> avcodec_decode_audio4</span><span class="pun">(</span><span class="pln">p_audioCodecContext</span><span class="pun">,</span><span class="pln"> p_frame</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">got_frame</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">p_packet</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">decoded </span><span class="pun"><</span><span class="pln"> </span><span class="lit">0</span><span class="pun">)</span><span class="pln"> 
    </span><span class="pun">{</span><span class="pln">
        p_videoInfo</span><span class="pun">.</span><span class="pln">error </span><span class="pun">=</span><span class="pln"> </span><span class="str">"Error decoding audio frame."</span><span class="pun">;</span><span class="pln">
        </span><span class="kwd">return</span><span class="pln"> decoded</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">

    </span><span class="com">// Frame is complete, store it in audio frame queue</span><span class="pln">
    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">got_frame</span><span class="pun">)</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="typ">int</span><span class="pln"> bufferSize </span><span class="pun">=</span><span class="pln"> av_samples_get_buffer_size</span><span class="pun">(</span><span class="pln">NULL</span><span class="pun">,</span><span class="pln"> p_audioCodecContext</span><span class="pun">-></span><span class="pln">channels</span><span class="pun">,</span><span class="pln"> p_frame</span><span class="pun">-></span><span class="pln">nb_samples</span><span class="pun">,</span><span class="pln"> 
                                                    p_audioCodecContext</span><span class="pun">-></span><span class="pln">sample_fmt</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">);</span><span class="pln">

        </span><span class="typ">int64_t</span><span class="pln"> duration </span><span class="pun">=</span><span class="pln"> p_frame</span><span class="pun">-></span><span class="pln">pkt_duration</span><span class="pun">;</span><span class="pln">
        </span><span class="typ">int64_t</span><span class="pln"> dts </span><span class="pun">=</span><span class="pln"> p_frame</span><span class="pun">-></span><span class="pln">pkt_dts</span><span class="pun">;</span><span class="pln">

        </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">staticOgreLog</span><span class="pun">)</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            staticOgreLog</span><span class="pun">-></span><span class="pln">logMessage</span><span class="pun">(</span><span class="str">"Audio frame bufferSize / duration / dts: "</span><span class="pln"> 
                    </span><span class="pun">+</span><span class="pln"> boost</span><span class="pun">::</span><span class="pln">lexical_cast</span><span class="pun"><</span><span class="pln">std</span><span class="pun">::</span><span class="pln">string</span><span class="pun">>(</span><span class="pln">bufferSize</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">" / "</span><span class="pln">
                    </span><span class="pun">+</span><span class="pln"> boost</span><span class="pun">::</span><span class="pln">lexical_cast</span><span class="pun"><</span><span class="pln">std</span><span class="pun">::</span><span class="pln">string</span><span class="pun">>(</span><span class="pln">duration</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">" / "</span><span class="pln">
                    </span><span class="pun">+</span><span class="pln"> boost</span><span class="pun">::</span><span class="pln">lexical_cast</span><span class="pun"><</span><span class="pln">std</span><span class="pun">::</span><span class="pln">string</span><span class="pun">>(</span><span class="pln">dts</span><span class="pun">),</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="pln">LML_NORMAL</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">

        </span><span class="com">// Create the audio frame</span><span class="pln">
        </span><span class="typ">AudioFrame</span><span class="pun">*</span><span class="pln"> frame </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">AudioFrame</span><span class="pun">();</span><span class="pln">
        frame</span><span class="pun">-></span><span class="pln">dataSize </span><span class="pun">=</span><span class="pln"> bufferSize</span><span class="pun">;</span><span class="pln">
        frame</span><span class="pun">-></span><span class="pln">data </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pun">[</span><span class="pln">bufferSize</span><span class="pun">];</span><span class="pln">
        memcpy</span><span class="pun">(</span><span class="pln">frame</span><span class="pun">-></span><span class="pln">data</span><span class="pun">,</span><span class="pln"> p_frame</span><span class="pun">-></span><span class="pln">data</span><span class="pun">,</span><span class="pln"> bufferSize</span><span class="pun">);</span><span class="pln">
        </span><span class="kwd">double</span><span class="pln"> timeBase </span><span class="pun">=</span><span class="pln"> </span><span class="pun">((</span><span class="kwd">double</span><span class="pun">)</span><span class="pln">p_audioCodecContext</span><span class="pun">-></span><span class="pln">time_base</span><span class="pun">.</span><span class="pln">num</span><span class="pun">)</span><span class="pln"> </span><span class="pun">/</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">double</span><span class="pun">)</span><span class="pln">p_audioCodecContext</span><span class="pun">-></span><span class="pln">time_base</span><span class="pun">.</span><span class="pln">den</span><span class="pun">;</span><span class="pln">
        frame</span><span class="pun">-></span><span class="pln">lifeTime </span><span class="pun">=</span><span class="pln"> duration </span><span class="pun">*</span><span class="pln"> timeBase</span><span class="pun">;</span><span class="pln">

        p_player</span><span class="pun">-></span><span class="pln">addAudioFrame</span><span class="pun">(</span><span class="pln">frame</span><span class="pun">);</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">

    </span><span class="kwd">return</span><span class="pln"> decoded</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}

</span></code></pre>
      <p>So, as you can see, I decode the frame, memcpy it to my own
        struct, AudioFrame. Now, when the sound is played, I use these
        audio frame like this: </p>
      <pre style="" class="lang-cpp prettyprint prettyprinted"><code><span class="com">//------------------------------------------------------------------------------</span></code><code><span class="typ">
int</span><span class="pln"> numBuffers </span><span class="pun">=</span><span class="pln"> </span><span class="lit">4</span><span class="pun">;</span><span class="pln">
</span><span class="typ">ALuint</span><span class="pln"> buffers</span><span class="pun">[</span><span class="lit">4</span><span class="pun">];</span><span class="pln">
alGenBuffers</span><span class="pun">(</span><span class="pln">numBuffers</span><span class="pun">,</span><span class="pln"> buffers</span><span class="pun">);</span><span class="pln">
</span><span class="typ">ALenum</span><span class="pln"> success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error on alGenBuffers : "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> alGetString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">));</span><span class="pln">
    </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="com">// Fill a number of data buffers with audio from the stream</span><span class="pln">
std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun"><</span><span class="typ">AudioFrame</span><span class="pun">*></span><span class="pln"> audioBuffers</span><span class="pun">;</span><span class="pln">
std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun"><</span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pun">></span><span class="pln"> audioBufferSizes</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pln"> numReturned </span><span class="pun">=</span><span class="pln"> FFMPEG_PLAYER</span><span class="pun">-></span><span class="pln">getDecodedAudioFrames</span><span class="pun">(</span><span class="pln">numBuffers</span><span class="pun">,</span><span class="pln"> audioBuffers</span><span class="pun">,</span><span class="pln"> audioBufferSizes</span><span class="pun">);</span><span class="pln">

</span><span class="com">// Assign the data buffers to the OpenAL buffers</span><span class="pln">
</span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> i </span><span class="pun"><</span><span class="pln"> numReturned</span><span class="pun">;</span><span class="pln"> </span><span class="pun">++</span><span class="pln">i</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    alBufferData</span><span class="pun">(</span><span class="pln">buffers</span><span class="pun">[</span><span class="pln">i</span><span class="pun">],</span><span class="pln"> _streamingFormat</span><span class="pun">,</span><span class="pln"> audioBuffers</span><span class="pun">[</span><span class="pln">i</span><span class="pun">]->data,</span><span class="pln"> audioBufferSizes</span><span class="pun">[</span><span class="pln">i</span><span class="pun">],</span><span class="pln"> _streamingFrequency</span><span class="pun">);</span><span class="pln">

    success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
    </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error on alBufferData : "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> alGetString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">)</span><span class="pln">
                        </span><span class="pun">+</span><span class="pln"> </span><span class="str">" size: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">audioBufferSizes</span><span class="pun">[</span><span class="pln">i</span><span class="pun">]));</span><span class="pln">
        </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="com">// Queue the buffers into OpenAL</span><span class="pln">
alSourceQueueBuffers</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">,</span><span class="pln"> numReturned</span><span class="pun">,</span><span class="pln"> buffers</span><span class="pun">);</span><span class="pln">
success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error queuing streaming buffers: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> alGetString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">));</span><span class="pln">
    </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

alSourcePlay</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">);</span></code>

</pre>
      <p>The format and frequency I give to OpenAL are
        AL_FORMAT_STEREO16 (it is a stereo sound stream) and 48000
        (which is the sample rate of the AVCodecContext of the audio
        stream).</p>
      <p>And during playback, I do the following to refill OpenAL's
        buffers: </p>
      <pre style="" class="lang-cpp prettyprint prettyprinted"><code><span class="com">//------------------------------------------------------------------------------</span></code><code><span class="typ"></span></code><code><span class="typ">
ALint</span><span class="pln"> numBuffersProcessed</span><span class="pun">;</span><span class="pln">

        </span><span class="com">// Check if OpenAL is done with any of the queued buffers</span><span class="pln">
        alGetSourcei</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">,</span><span class="pln"> AL_BUFFERS_PROCESSED</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">numBuffersProcessed</span><span class="pun">);</span><span class="pln">
        </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">numBuffersProcessed </span><span class="pun"><=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">)</span><span class="pln">
            </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">

        </span><span class="com">// Fill a number of data buffers with audio from the stream</span><span class="pln">
        std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun"><</span><span class="typ">AudiFrame</span><span class="pun">*></span><span class="pln"> audioBuffers</span><span class="pun">;</span><span class="pln">
        std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun"><</span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pun">></span><span class="pln"> audioBufferSizes</span><span class="pun">;</span><span class="pln">
        </span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pln"> numFilled </span><span class="pun">=</span><span class="pln"> FFMPEG_PLAYER</span><span class="pun">-></span><span class="pln">getDecodedAudioFrames</span><span class="pun">(</span><span class="pln">numBuffersProcessed</span><span class="pun">,</span><span class="pln"> audioBuffers</span><span class="pun">,</span><span class="pln"> audioBufferSizes</span><span class="pun">);</span><span class="pln">

        </span><span class="com">// Assign the data buffers to the OpenAL buffers</span><span class="pln">
        </span><span class="typ">ALuint</span><span class="pln"> buffer</span><span class="pun">;</span><span class="pln">
        </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">int</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> i </span><span class="pun"><</span><span class="pln"> numFilled</span><span class="pun">;</span><span class="pln"> </span><span class="pun">++</span><span class="pln">i</span><span class="pun">)</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            </span><span class="com">// Pop the oldest queued buffer from the source, </span><span class="pln">
            </span><span class="com">// fill it with the new data, then re-queue it</span><span class="pln">
            alSourceUnqueueBuffers</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">buffer</span><span class="pun">);</span><span class="pln">

            </span><span class="typ">ALenum</span><span class="pln"> success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
            </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
            </span><span class="pun">{</span><span class="pln">
                CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error Unqueuing streaming buffers: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">));</span><span class="pln">
                </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">

            alBufferData</span><span class="pun">(</span><span class="pln">buffer</span><span class="pun">,</span><span class="pln"> _streamingFormat</span><span class="pun">,</span><span class="pln"> audioBuffers</span><span class="pun">[</span><span class="pln">i</span><span class="pun">]->data,</span><span class="pln"> audioBufferSizes</span><span class="pun">[</span><span class="pln">i</span><span class="pun">],</span><span class="pln"> _streamingFrequency</span><span class="pun">);</span><span class="pln">

            success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
            </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
            </span><span class="pun">{</span><span class="pln">
                CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error on re- alBufferData: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">));</span><span class="pln">
                </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">

            alSourceQueueBuffers</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">buffer</span><span class="pun">);</span><span class="pln">

            success </span><span class="pun">=</span><span class="pln"> alGetError</span><span class="pun">();</span><span class="pln">
            </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">success </span><span class="pun">!=</span><span class="pln"> AL_NO_ERROR</span><span class="pun">)</span><span class="pln">
            </span><span class="pun">{</span><span class="pln">
                CONSOLE_LOG</span><span class="pun">(</span><span class="str">"Error re-queuing streaming buffers: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="typ">Ogre</span><span class="pun">::</span><span class="typ">StringConverter</span><span class="pun">::</span><span class="pln">toString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">" "</span><span class="pln">
                            </span><span class="pun">+</span><span class="pln"> alGetString</span><span class="pun">(</span><span class="pln">success</span><span class="pun">));</span><span class="pln">
                </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">

        </span><span class="com">// Make sure the source is still playing, </span><span class="pln">
        </span><span class="com">// and restart it if needed.</span><span class="pln">
        </span><span class="typ">ALint</span><span class="pln"> playStatus</span><span class="pun">;</span><span class="pln">
        alGetSourcei</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">,</span><span class="pln"> AL_SOURCE_STATE</span><span class="pun">,</span><span class="pln"> </span><span class="pun">&</span><span class="pln">playStatus</span><span class="pun">);</span><span class="pln">
        </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">playStatus </span><span class="pun">!=</span><span class="pln"> AL_PLAYING</span><span class="pun">)</span><span class="pln">
            alSourcePlay</span><span class="pun">(</span><span class="pln">_source</span><span class="pun">);</span></code>

</pre>
      <p>As you can see, I do quite heavy error checking. But I do not
        get any errors.<br>
        What I hear somewhat resembles the actual audio from the video,
        but VERY high pitched and stuttering VERY much. Also, it seems
        to be playing on top of TV noise. Very strange. Plus, it is
        playing much slower than the correct audio would. But it is very
        hard to hear anything specific in that mess.<br>
      </p>
      <p>The video itself is not broken, it can be played fine on any
        player. OpenAL can also play *.way files just fine in the same
        application, so it is also working.</p>
      <p>Any ideas what could be wrong here or how to do this correctly?</p>
      <p>My only guess is that somehow, FFmpeg's decode function does
        not produce data OpenGL can read. But this is as far as the
        FFmpeg decode example goes, so I don't know what's missing. As I
        understand it, the decode_audio4 function decodes the frame to
        raw data. And OpenAL should be able to work with RAW data (or
        rather, doesn't work with anything else).</p>
    </div>
    <br>
    P.S: You can also find this question on StackOverflow, figured it
    wouldn't hurt to ask on multiple places:<br>
    <a class="moz-txt-link-freetext"
href="http://stackoverflow.com/questions/21386135/ffmpeg-openal-playback-streaming-sound-from-video-wont-work">http://stackoverflow.com/questions/21386135/ffmpeg-openal-playback-streaming-sound-from-video-wont-work</a><br>
  </body>
</html>