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

View File

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

View File

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