<commit_before>
#include "FFmpegAudioStream.hpp"

#include <OpenThreads/ScopedLock>
#include <osg/Notify>

#include "FFmpegDecoder.hpp"
#include "MessageQueue.hpp"

#include <memory>



namespace osgFFmpeg {



FFmpegAudioStream::FFmpegAudioStream(FFmpegDecoder* decoder):
    m_decoder(decoder)
{
}



FFmpegAudioStream::FFmpegAudioStream(const FFmpegAudioStream & audio, const osg::CopyOp & copyop) :
    osg::AudioStream(audio, copyop)
{
}

FFmpegAudioStream::~FFmpegAudioStream()
{
}

void FFmpegAudioStream::setAudioSink(osg::AudioSink* audio_sink)
{ 
    osg::notify(osg::NOTICE)<<"FFmpegAudioStream::setAudioSink( "<<audio_sink<<")"<<std::endl;
    m_decoder->audio_decoder().setAudioSink(audio_sink); <commit_msg>Improved the clean up ordering<commit_after>
#include "FFmpegAudioStream.hpp"

#include <OpenThreads/ScopedLock>
#include <osg/Notify>

#include "FFmpegDecoder.hpp"
#include "MessageQueue.hpp"

#include <memory>



namespace osgFFmpeg {



FFmpegAudioStream::FFmpegAudioStream(FFmpegDecoder* decoder):
    m_decoder(decoder)
{
}



FFmpegAudioStream::FFmpegAudioStream(const FFmpegAudioStream & audio, const osg::CopyOp & copyop) :
    osg::AudioStream(audio, copyop)
{
}

FFmpegAudioStream::~FFmpegAudioStream()
{
    // detact the audio sink first to avoid destrction order issues.
    setAudioSink(0);
}

void FFmpegAudioStream::setAudioSink(osg::AudioSink* audio_sink)
{ 
    osg::notify(osg::NOTICE)<<"FFmpegAudioStream::setAudioSink( "<<audio_sink<<")"<<std::endl;
    m_decoder->audio_decoder().setAudioSink(audio_sink); 
{'fraction_non_alphanumeric': 0.1355713363460297, 'fraction_numerical': 0.0006455777921239509, 'mean_word_length': 7.072916666666667, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '359665', 'n_tokens_mistral': 591, 'n_tokens_neox': 572, 'n_words': 81}