Permalink
Browse files

rework mlt frame initialization to avoid mlt_frame_close for some err…

…or cases
  • Loading branch information...
1 parent 9c6ae2b commit cc20b9a4c185dac0f8d7e5429365f66916f5d073 @max-verem max-verem committed with ddennedy Jun 24, 2014
Showing with 3 additions and 6 deletions.
  1. +3 −6 src/modules/decklink/producer_decklink.cpp
@@ -358,6 +358,8 @@ class DeckLinkProducer
IDeckLinkVideoInputFrame* video,
IDeckLinkAudioInputPacket* audio )
{
+ mlt_frame frame = NULL;
+
if( !m_reprio )
{
mlt_properties properties = MLT_PRODUCER_PROPERTIES( getProducer() );
@@ -402,8 +404,6 @@ class DeckLinkProducer
return S_OK;
}
- // Create mlt_frame
- mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( getProducer() ) );
// Copy video
if ( video )
@@ -446,6 +446,7 @@ class DeckLinkProducer
{
size = video->GetRowBytes() * video->GetHeight();
swab2( (char*) buffer, (char*) image + m_vancLines * video->GetRowBytes(), size );
+ frame = mlt_frame_init( MLT_PRODUCER_SERVICE( getProducer() ) );
mlt_frame_set_image( frame, (uint8_t*) image, size, mlt_pool_release );
}
else if ( image )
@@ -457,8 +458,6 @@ class DeckLinkProducer
else
{
mlt_log_verbose( getProducer(), "no signal\n" );
- mlt_frame_close( frame );
- frame = 0;
}
// Get timecode
@@ -481,8 +480,6 @@ class DeckLinkProducer
else
{
mlt_log_verbose( getProducer(), "no video\n" );
- mlt_frame_close( frame );
- frame = 0;
}
// Copy audio

0 comments on commit cc20b9a

Please sign in to comment.