From: Steinar Gunderson Date: Thu, 23 Sep 2010 23:42:17 +0000 (+0200) Subject: Adjustments to better match VLC coding style. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=99b4edcb0aa0a0ce36d10ad2a48375995a2c32ca;p=vlc Adjustments to better match VLC coding style. --- diff --git a/modules/access/sdi.cpp b/modules/access/sdi.cpp index 51937e2ec9..ce593f0b36 100644 --- a/modules/access/sdi.cpp +++ b/modules/access/sdi.cpp @@ -85,8 +85,10 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame { demux_sys_t *p_sys = p_demux_->p_sys; - if (videoFrame) { - if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) { + if(videoFrame) + { + if(videoFrame->GetFlags() & bmdFrameHasNoInputSource) + { msg_Warn( p_demux_, "No input signal detected" ); return S_OK; } @@ -94,11 +96,12 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame msg_Dbg( p_demux_, "Received a frame" ); block_t *p_frame; - p_frame = block_New( p_demux_, 720 * 576 * 3 ); - if ( !p_frame ) { + p_frame = block_New( p_demux_, 720 * 576 * 3 ); + if( !p_frame ) + { msg_Err( p_demux_, "Could not allocate memory for frame" ); return S_OK; - } + } void *frame_bytes; videoFrame->GetBytes( &frame_bytes ); @@ -109,7 +112,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame p_frame->i_pts = stream_time; vlc_mutex_lock( &p_sys->lock ); - p_sys->p_frame = p_frame; // FIXME: leak + p_sys->p_frame = p_frame; // FIXME: leak vlc_mutex_unlock( &p_sys->lock ); } @@ -139,7 +142,8 @@ static int Open( vlc_object_t *p_this ) p_sys->p_frame = NULL; IDeckLinkIterator *decklink_iterator = CreateDeckLinkIteratorInstance(); - if ( !decklink_iterator ) { + if( !decklink_iterator ) + { msg_Err( p_demux, "DeckLink drivers not found." ); // FIXME: Leak here and several other error paths. return VLC_EGENERIC; @@ -148,12 +152,14 @@ static int Open( vlc_object_t *p_this ) HRESULT result; result = decklink_iterator->Next( &p_sys->p_card ); - if ( result != S_OK ) { + if( result != S_OK ) + { msg_Err( p_demux, "No DeckLink PCI cards found" ); return VLC_EGENERIC; } - if ( p_sys->p_card->QueryInterface(IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK ) { + if( p_sys->p_card->QueryInterface(IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK ) + { msg_Err( p_demux, "Card has no inputs" ); return VLC_EGENERIC; } @@ -162,14 +168,16 @@ static int Open( vlc_object_t *p_this ) p_sys->p_input->SetCallback( p_sys->p_delegate ); result = p_sys->p_input->EnableVideoInput(bmdModePAL, bmdFormat8BitYUV, 0); - if ( result != S_OK ) { + if( result != S_OK ) + { msg_Err( p_demux, "Failed to enable video input" ); return VLC_EGENERIC; } // FIXME: add audio result = p_sys->p_input->StartStreams(); - if ( result != S_OK ) { + if( result != S_OK ) + { msg_Err( p_demux, "Failed to start streams" ); return VLC_EGENERIC; } @@ -242,11 +250,14 @@ static int Demux( demux_t *p_demux ) p_sys->p_frame = NULL; vlc_mutex_unlock( &p_sys->lock ); - if ( p_block ) { + if( p_block ) + { msg_Dbg( p_demux, "Sending frame" ); es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts ); - es_out_Send( p_demux->out, p_sys->p_es, p_block ); - } else { + es_out_Send( p_demux->out, p_sys->p_es, p_block ); + } + else + { usleep(50000); // FIXME }