Skip to content

Commit 6ea7278

Browse files
committed
minor formatting preference
1 parent 5541238 commit 6ea7278

File tree

2 files changed

+71
-65
lines changed

2 files changed

+71
-65
lines changed

src/msw/AX-MediaPlayerMSWImpl.cxx

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -344,84 +344,84 @@ namespace AX::Video
344344
return S_OK;
345345
}
346346

347-
void MediaPlayer::Impl::ProcessEvent( DWORD evt, DWORD_PTR param1, DWORD param2 )
347+
void MediaPlayer::Impl::ProcessEvent ( DWORD evt, DWORD_PTR param1, DWORD param2 )
348348
{
349-
switch( evt )
349+
switch ( evt )
350350
{
351-
case MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE:
352-
{
353-
_duration = static_cast< float > ( _mediaEngine->GetDuration() );
354-
break;
355-
}
356-
357-
case MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA:
358-
{
359-
_duration = static_cast< float > ( _mediaEngine->GetDuration() );
360-
361-
DWORD w, h;
362-
if( SUCCEEDED( _mediaEngine->GetNativeVideoSize( &w, &h ) ) )
351+
case MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE:
363352
{
364-
_size = ivec2( w, h );
365-
_renderPath->InitializeRenderTarget( _size );
353+
_duration = static_cast< float > ( _mediaEngine->GetDuration() );
354+
break;
366355
}
367356

368-
_hasMetadata = true;
369-
_owner.OnReady.emit();
357+
case MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA:
358+
{
359+
_duration = static_cast< float > ( _mediaEngine->GetDuration() );
370360

371-
break;
372-
}
361+
DWORD w, h;
362+
if( SUCCEEDED( _mediaEngine->GetNativeVideoSize( &w, &h ) ) )
363+
{
364+
_size = ivec2( w, h );
365+
_renderPath->InitializeRenderTarget( _size );
366+
}
373367

374-
case MF_MEDIA_ENGINE_EVENT_PLAY:
375-
{
376-
_owner.OnPlay.emit();
377-
break;
378-
}
368+
_hasMetadata = true;
369+
_owner.OnReady.emit();
379370

380-
case MF_MEDIA_ENGINE_EVENT_PAUSE:
381-
{
382-
_owner.OnPause.emit();
383-
break;
384-
}
385-
case MF_MEDIA_ENGINE_EVENT_ENDED:
386-
{
387-
_owner.OnComplete.emit();
388-
break;
389-
}
371+
break;
372+
}
390373

391-
case MF_MEDIA_ENGINE_EVENT_SEEKING:
392-
{
393-
_owner.OnSeekStart.emit();
394-
break;
395-
}
374+
case MF_MEDIA_ENGINE_EVENT_PLAY:
375+
{
376+
_owner.OnPlay.emit();
377+
break;
378+
}
396379

397-
case MF_MEDIA_ENGINE_EVENT_SEEKED:
398-
{
399-
_owner.OnSeekEnd.emit();
400-
break;
401-
}
380+
case MF_MEDIA_ENGINE_EVENT_PAUSE:
381+
{
382+
_owner.OnPause.emit();
383+
break;
384+
}
385+
case MF_MEDIA_ENGINE_EVENT_ENDED:
386+
{
387+
_owner.OnComplete.emit();
388+
break;
389+
}
402390

403-
case MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED:
404-
{
405-
_owner.OnBufferingStart.emit();
406-
break;
407-
}
391+
case MF_MEDIA_ENGINE_EVENT_SEEKING:
392+
{
393+
_owner.OnSeekStart.emit();
394+
break;
395+
}
408396

409-
case MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED:
410-
{
411-
_owner.OnBufferingEnd.emit();
412-
break;
413-
}
397+
case MF_MEDIA_ENGINE_EVENT_SEEKED:
398+
{
399+
_owner.OnSeekEnd.emit();
400+
break;
401+
}
414402

415-
case MF_MEDIA_ENGINE_EVENT_ERROR:
416-
{
417-
MF_MEDIA_ENGINE_ERR error = static_cast< MF_MEDIA_ENGINE_ERR > ( param1 );
418-
_owner.OnError.emit( AXErrorFromMFError( error ) );
419-
break;
420-
}
403+
case MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED:
404+
{
405+
_owner.OnBufferingStart.emit();
406+
break;
407+
}
408+
409+
case MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED:
410+
{
411+
_owner.OnBufferingEnd.emit();
412+
break;
413+
}
414+
415+
case MF_MEDIA_ENGINE_EVENT_ERROR:
416+
{
417+
MF_MEDIA_ENGINE_ERR error = static_cast< MF_MEDIA_ENGINE_ERR > ( param1 );
418+
_owner.OnError.emit( AXErrorFromMFError( error ) );
419+
break;
420+
}
421421
}
422422
}
423423

424-
void MediaPlayer::Impl::UpdateEvents()
424+
void MediaPlayer::Impl::UpdateEvents ( )
425425
{
426426
Event evt;
427427
bool hasEvent = false;
@@ -683,7 +683,7 @@ namespace AX::Video
683683
}
684684
}
685685

686-
UpdateEvents();
686+
UpdateEvents ( );
687687

688688
return false;
689689
}

src/osx/AX-MediaPlayerOSXImpl.mm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,14 @@
364364
{
365365
_hasNewFrame.store ( false );
366366
auto player = std::static_pointer_cast<qtime::MovieSurface>( _player );
367-
auto texture = gl::Texture::create ( *player->getSurface(), gl::Texture::Format ( ).loadTopDown ( ) );
368-
return std::make_unique<StaticFrameLease>( texture );
367+
if ( player && player->getSurface() )
368+
{
369+
auto texture = gl::Texture::create ( *player->getSurface(), gl::Texture::Format ( ).loadTopDown ( ) );
370+
return std::make_unique<StaticFrameLease>( texture );
371+
}else
372+
{
373+
return nullptr;
374+
}
369375
}
370376
}
371377

0 commit comments

Comments
 (0)