Skip to content

Commit

Permalink
Removed use of StreamPlayerCbEnded()
Browse files Browse the repository at this point in the history
  • Loading branch information
bear101 committed Oct 7, 2019
1 parent dfce6fc commit 2bced8f
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 45 deletions.
3 changes: 0 additions & 3 deletions Library/TeamTalkLib/avstream/MediaPlayback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,3 @@ bool MediaPlayback::StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
return true;
}

void MediaPlayback::StreamPlayerCbEnded()
{
}
1 change: 0 additions & 1 deletion Library/TeamTalkLib/avstream/MediaPlayback.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class MediaPlayback : public MediaStreamListener
// StreamPlayer
bool StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
short* buffer, int samples);
void StreamPlayerCbEnded();

private:
media_streamer_t m_streamer;
Expand Down
1 change: 0 additions & 1 deletion Library/TeamTalkLib/avstream/OpenSLESWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context)

if(!more)
{
streamer->player->StreamPlayerCbEnded();
SLPlayItf playerPlay = streamer->playerPlay;

// set the player's state to stopped
Expand Down
16 changes: 0 additions & 16 deletions Library/TeamTalkLib/avstream/PortAudioWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,6 @@ int OutputStreamCallback(const void *inputBuffer, void *outputBuffer,
return paComplete;
}

void OutputStreamCallbackEnded(void* userData)
{
assert(userData);
PaOutputStreamer* streamer = static_cast<PaOutputStreamer*> (userData);
streamer->player->StreamPlayerCbEnded();
}


outputstreamer_t PortAudio::NewStream(StreamPlayer* player, int outputdeviceid,
int sndgrpid, int samplerate, int channels,
int framesize)
Expand Down Expand Up @@ -436,14 +428,6 @@ outputstreamer_t PortAudio::NewStream(StreamPlayer* player, int outputdeviceid,
return outputstreamer_t();
}

err = Pa_SetStreamFinishedCallback(streamer->stream, OutputStreamCallbackEnded);
assert(err == paNoError);

if(err != paNoError)
{
return outputstreamer_t();
}

//set master volume so it's relative to master volume
SetVolume(player, VOLUME_DEFAULT);

Expand Down
5 changes: 0 additions & 5 deletions Library/TeamTalkLib/avstream/SoundLoopback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ bool SoundLoopback::StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
return true;
}

void SoundLoopback::StreamPlayerCbEnded()
{
}


void SoundLoopback::StreamDuplexEchoCb(const soundsystem::DuplexStreamer& streamer,
const short* input_buffer,
const short* prev_output_buffer, int samples)
Expand Down
1 change: 0 additions & 1 deletion Library/TeamTalkLib/avstream/SoundLoopback.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class SoundLoopback
const short* buffer, int samples);
bool StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
short* buffer, int samples);
void StreamPlayerCbEnded();

void StreamDuplexEchoCb(const soundsystem::DuplexStreamer& streamer,
const short* input_buffer,
Expand Down
1 change: 0 additions & 1 deletion Library/TeamTalkLib/avstream/SoundSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ namespace soundsystem {
virtual ~StreamPlayer() {}
virtual bool StreamPlayerCb(const OutputStreamer& streamer,
short* buffer, int samples) = 0;
virtual void StreamPlayerCbEnded() = 0;
};

class StreamDuplex
Expand Down
1 change: 0 additions & 1 deletion Library/TeamTalkLib/avstream/SoundSystemBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void DuplexEnded(SoundSystem* sndsys, DuplexStreamer& dpxStream)
while(i--)
{
player = dpxStream.players[i]->player;
player->StreamPlayerCbEnded();
sndsys->RemoveDuplexOutputStream(dpxStream.duplex, player);
}
}
Expand Down
4 changes: 0 additions & 4 deletions Library/TeamTalkLib/avstream/SoundSystemBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ namespace soundsystem {

virtual ~StreamPlayerCallback()
{
m_streamer->player->StreamPlayerCbEnded();
Stop();
}

Expand Down Expand Up @@ -1108,9 +1107,6 @@ namespace soundsystem {
}
g2.release();

//simulate to player that this was the last callback
player->StreamPlayerCbEnded();

wguard_t g(players_lock());
m_output_streamers.erase(player);
return true;
Expand Down
13 changes: 2 additions & 11 deletions Library/TeamTalkLib/teamtalk/client/StreamPlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ bool AudioPlayer::StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
m_talking = false;

//store in muxer (if enabled)
m_audiomuxer.QueueUserAudio(m_userid, NULL, m_samples_played,
false, m_codec);
m_audiomuxer.QueueUserAudio(m_userid, nullptr, m_samples_played,
true, m_codec);
//reset packet numbers
Reset();
}
Expand Down Expand Up @@ -232,15 +232,6 @@ bool AudioPlayer::StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
return true;
}

void AudioPlayer::StreamPlayerCbEnded()
{
m_audiomuxer.QueueUserAudio(m_userid, NULL,
m_samples_played, true,
m_codec);
//MYTRACE(ACE_TEXT("Stream callback ended for #%d. Played: %u. Cur pkt: %d, max pkt: %d\n"),
// m_userid, m_samples_played, m_play_pkt_no, m_max_packet);
}

int AudioPlayer::GetNumAudioBlocks(bool reset)
{
int n = m_new_audio_blocks;
Expand Down
1 change: 0 additions & 1 deletion Library/TeamTalkLib/teamtalk/client/StreamPlayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ namespace teamtalk {

virtual bool StreamPlayerCb(const soundsystem::OutputStreamer& streamer,
short* output_buffer, int n_samples);
virtual void StreamPlayerCbEnded();

bool PlayBuffer(short* output_buffer, int n_samples);
virtual bool DecodeFrame(const encframe& enc_frame,
Expand Down

0 comments on commit 2bced8f

Please sign in to comment.