[vlc-commits] Hold on to the DeckLink configuration object for the entire session, or it will revert to the defaults in the configuration file. ( This change was made during the 7.9 series SDK, it seems.)
Steinar H. Gunderson
git at videolan.org
Sat Feb 12 18:26:38 CET 2011
vlc | branch: master | Steinar H. Gunderson <steinar+vlc at gunderson.no> | Sat Feb 12 17:48:00 2011 +0100| [a89fd3ec4fc295fdcdff4f6da72caacf836b46c5] | committer: Jean-Baptiste Kempf
Hold on to the DeckLink configuration object for the entire session, or it will revert to the defaults in the configuration file. (This change was made during the 7.9 series SDK, it seems.)
This also fixes an issue where VLC would segfault if it could not
initialize the card.
Patch originally by Ed Groth <ed at boxpopuli.com>.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a89fd3ec4fc295fdcdff4f6da72caacf836b46c5
---
modules/access/decklink.cpp | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp
index 1af30f8..23af285 100644
--- a/modules/access/decklink.cpp
+++ b/modules/access/decklink.cpp
@@ -129,6 +129,10 @@ struct demux_sys_t
IDeckLinkInput *p_input;
DeckLinkCaptureDelegate *p_delegate;
+ /* We need to hold onto the IDeckLinkConfiguration object, or our settings will not apply.
+ See section 2.4.15 of the Blackmagic Decklink SDK documentation. */
+ IDeckLinkConfiguration *p_config;
+
es_out_id_t *p_video_es;
es_out_id_t *p_audio_es;
@@ -340,8 +344,7 @@ static int Open( vlc_object_t *p_this )
}
/* Set up the video and audio sources. */
- IDeckLinkConfiguration *p_config;
- if( p_sys->p_card->QueryInterface( IID_IDeckLinkConfiguration, (void**)&p_config) != S_OK )
+ if( p_sys->p_card->QueryInterface( IID_IDeckLinkConfiguration, (void**)&p_sys->p_config) != S_OK )
{
msg_Err( p_demux, "Failed to get configuration interface" );
goto finish;
@@ -371,7 +374,7 @@ static int Open( vlc_object_t *p_this )
}
msg_Dbg( p_demux, "Setting video input format to 0x%x", conn);
- result = p_config->SetInt( bmdDeckLinkConfigVideoInputConnection, conn );
+ result = p_sys->p_config->SetInt( bmdDeckLinkConfigVideoInputConnection, conn );
if( result != S_OK )
{
msg_Err( p_demux, "Failed to set video input connection" );
@@ -397,7 +400,7 @@ static int Open( vlc_object_t *p_this )
}
msg_Dbg( p_demux, "Setting audio input format to 0x%x", conn);
- result = p_config->SetInt( bmdDeckLinkConfigAudioInputConnection, conn );
+ result = p_sys->p_config->SetInt( bmdDeckLinkConfigAudioInputConnection, conn );
if( result != S_OK )
{
msg_Err( p_demux, "Failed to set audio input connection" );
@@ -582,9 +585,6 @@ finish:
if( decklink_iterator )
decklink_iterator->Release();
- if( p_config )
- p_config->Release();
-
free( psz_video_connection );
free( psz_audio_connection );
free( psz_display_mode );
@@ -603,6 +603,9 @@ static void Close( vlc_object_t *p_this )
demux_t *p_demux = (demux_t *)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
+ if( p_sys->p_config )
+ p_sys->p_config->Release();
+
if( p_sys->p_input )
{
p_sys->p_input->StopStreams();
More information about the vlc-commits
mailing list