From 8ab209b51d1255d305659af4ffa281c2c68a8b48 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 2 Oct 2010 02:05:59 +0200 Subject: [PATCH] Simplify error handling by making VLC_EGENERIC the default. --- modules/access/decklink.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp index aca08d5c92..e99bc20cf0 100644 --- a/modules/access/decklink.cpp +++ b/modules/access/decklink.cpp @@ -210,11 +210,6 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame BMDTimeValue stream_time, frame_duration; videoFrame->GetStreamTime( &stream_time, &frame_duration, CLOCK_FREQ ); p_video_frame->i_flags = BLOCK_FLAG_TYPE_I | p_sys->i_dominance_flags; - if( p_sys->b_first_frame ) - { - p_video_frame->i_flags |= BLOCK_FLAG_DISCONTINUITY; - p_sys->b_first_frame = false; - } p_video_frame->i_pts = p_video_frame->i_dts = VLC_TS_0 + stream_time; } @@ -266,7 +261,7 @@ static int Open( vlc_object_t *p_this ) { demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; - int ret = VLC_SUCCESS; + int ret = VLC_EGENERIC; char *psz_aspect; char *psz_display_mode = NULL; char *psz_video_connection = NULL; @@ -298,7 +293,6 @@ static int Open( vlc_object_t *p_this ) if( !decklink_iterator ) { msg_Err( p_demux, "DeckLink drivers not found." ); - ret = VLC_EGENERIC; goto finish; } @@ -317,7 +311,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "DeckLink PCI card %d not found", i_card_index ); - ret = VLC_EGENERIC; goto finish; } @@ -327,7 +320,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Could not get model name" ); - ret = VLC_EGENERIC; goto finish; } @@ -336,7 +328,6 @@ static int Open( vlc_object_t *p_this ) if( p_sys->p_card->QueryInterface( IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK ) { msg_Err( p_demux, "Card has no inputs" ); - ret = VLC_EGENERIC; goto finish; } @@ -345,7 +336,6 @@ static int Open( vlc_object_t *p_this ) if( p_sys->p_card->QueryInterface( IID_IDeckLinkConfiguration, (void**)&p_config) != S_OK ) { msg_Err( p_demux, "Failed to get configuration interface" ); - ret = VLC_EGENERIC; goto finish; } @@ -369,7 +359,6 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_demux, "Invalid --decklink-video-connection specified; choose one of " \ "sdi, hdmi, opticalsdi, component, composite, or svideo." ); - ret = VLC_EGENERIC; goto finish; } @@ -378,7 +367,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Failed to set video input connection" ); - ret = VLC_EGENERIC; goto finish; } } @@ -397,7 +385,6 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_demux, "Invalid --decklink-audio-connection specified; choose one of " \ "embedded, aesebu, or analog." ); - ret = VLC_EGENERIC; goto finish; } @@ -406,7 +393,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Failed to set audio input connection" ); - ret = VLC_EGENERIC; goto finish; } } @@ -417,14 +403,12 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Failed to enumerate display modes" ); - ret = VLC_EGENERIC; goto finish; } psz_display_mode = var_InheritString( p_demux, "decklink-mode" ); if( !psz_display_mode || strlen( psz_display_mode ) == 0 || strlen( psz_display_mode ) > 4 ) { msg_Err( p_demux, "Missing or invalid --decklink-mode string" ); - ret = VLC_EGENERIC; goto finish; } @@ -459,7 +443,6 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_demux, "Failed to get display mode name" ); p_display_mode->Release(); - ret = VLC_EGENERIC; goto finish; } @@ -469,7 +452,6 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_demux, "Failed to get frame rate" ); p_display_mode->Release(); - ret = VLC_EGENERIC; goto finish; } @@ -520,7 +502,6 @@ static int Open( vlc_object_t *p_this ) msg_Err( p_demux, "Unknown video mode specified. " \ "Run VLC with -v --verbose-objects=-all,+decklink " \ "to get a list of supported modes." ); - ret = VLC_EGENERIC; goto finish; } @@ -528,7 +509,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Failed to enable video input" ); - ret = VLC_EGENERIC; goto finish; } @@ -541,7 +521,6 @@ static int Open( vlc_object_t *p_this ) if( result != S_OK ) { msg_Err( p_demux, "Failed to enable audio input" ); - ret = VLC_EGENERIC; goto finish; } } @@ -554,7 +533,6 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_demux, "Could not start streaming from SDI card. This could be caused " "by invalid video mode or flags, access denied, or card already in use." ); - ret = VLC_EGENERIC; goto finish; } @@ -601,6 +579,8 @@ static int Open( vlc_object_t *p_this ) /* Update default_pts to a suitable value for access */ var_Create( p_demux, "decklink-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); + ret = VLC_SUCCESS; + finish: if( decklink_iterator ) decklink_iterator->Release(); -- 2.39.2