General MediaClient cleanup

* Avoid setting fRunning in different places.
* Fix SimpleMediaOutput kind mismatch.
* Other minor fixes.
This commit is contained in:
Dario Casalinuovo 2017-01-15 19:25:00 +01:00
parent 550e05af20
commit fdfd8a502e
3 changed files with 5 additions and 6 deletions

View File

@ -99,7 +99,6 @@ BMediaClientNode::Start(bigtime_t performanceTime)
CALLED(); CALLED();
BMediaEventLooper::Start(performanceTime); BMediaEventLooper::Start(performanceTime);
fOwner->fRunning = true;
} }
@ -109,7 +108,6 @@ BMediaClientNode::Stop(bigtime_t performanceTime, bool immediate)
CALLED(); CALLED();
BMediaEventLooper::Stop(performanceTime, immediate); BMediaEventLooper::Stop(performanceTime, immediate);
fOwner->fRunning = false;
} }
@ -538,6 +536,8 @@ BMediaClientNode::HandleEvent(const media_timed_event* event,
if (RunState() != B_STARTED) if (RunState() != B_STARTED)
fOwner->HandleStart(event->event_time); fOwner->HandleStart(event->event_time);
fStartTime = event->event_time;
_ScheduleConnections(event->event_time); _ScheduleConnections(event->event_time);
break; break;
} }
@ -579,7 +579,6 @@ BMediaClientNode::_ScheduleConnections(bigtime_t eventTime)
if (output->HasBinding()) if (output->HasBinding())
continue; continue;
fStartTime = eventTime;
media_timed_event firstBufferEvent(eventTime, media_timed_event firstBufferEvent(eventTime,
B_NEW_BUFFER); B_NEW_BUFFER);

View File

@ -196,7 +196,7 @@ BSimpleMediaInput::BufferReceived(BBuffer* buffer)
BSimpleMediaOutput::BSimpleMediaOutput() BSimpleMediaOutput::BSimpleMediaOutput()
: :
BMediaConnection(B_MEDIA_INPUT), BMediaConnection(B_MEDIA_OUTPUT),
BSimpleMediaConnection(B_MEDIA_OUTPUT), BSimpleMediaConnection(B_MEDIA_OUTPUT),
BMediaOutput() BMediaOutput()
{ {

View File

@ -57,8 +57,8 @@ void _ConsumerProducerTest()
{ {
_InitClients(false); _InitClients(false);
BMediaOutput* output = sProducer->BeginOutput(); BSimpleMediaOutput* output = sProducer->BeginOutput();
BMediaInput* input = sConsumer->BeginInput(); BSimpleMediaInput* input = sConsumer->BeginInput();
output->SetAcceptedFormat(_BuildRawAudioFormat()); output->SetAcceptedFormat(_BuildRawAudioFormat());
input->SetAcceptedFormat(_BuildRawAudioFormat()); input->SetAcceptedFormat(_BuildRawAudioFormat());