X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Fdecklink%2Fconsumer_decklink.cpp;h=e6d20e09998373ac179cb0251c4a345aacf30f4c;hb=307a2ef3af84a5dba60a5026a1a24f430a0e0bf2;hp=9df9a2612290243a8dfa5dac0c7e9fdad053a7c3;hpb=ddca533bc456f52aa052ee772590df8d46e5b818;p=mlt diff --git a/src/modules/decklink/consumer_decklink.cpp b/src/modules/decklink/consumer_decklink.cpp index 9df9a261..e6d20e09 100644 --- a/src/modules/decklink/consumer_decklink.cpp +++ b/src/modules/decklink/consumer_decklink.cpp @@ -75,7 +75,7 @@ private: mlt_log_verbose( getConsumer(), "BMD mode %dx%d %.3f fps prog %d\n", m_width, m_height, m_fps, p ); if ( m_width == profile->width && p == profile->progressive - && m_fps == mlt_profile_fps( profile ) + && (int) m_fps == (int) mlt_profile_fps( profile ) && ( m_height == profile->height || ( m_height == 486 && profile->height == 480 ) ) ) result = mode; else @@ -100,7 +100,7 @@ public: m_decklinkFrame = NULL; } - ~DeckLinkConsumer() + virtual ~DeckLinkConsumer() { SAFE_RELEASE( m_displayMode ); SAFE_RELEASE( m_deckLinkKeyer ); @@ -315,15 +315,17 @@ public: if ( !mlt_frame_get_audio( frame, (void**) &pcm, &format, &frequency, &m_channels, &samples ) ) { #ifdef WIN32 +#define DECKLINK_UNSIGNED_FORMAT "%lu" unsigned long written = 0; #else +#define DECKLINK_UNSIGNED_FORMAT "%u" uint32_t written = 0; #endif BMDTimeValue streamTime = m_count * frequency * m_duration / m_timescale; m_deckLinkOutput->GetBufferedAudioSampleFrameCount( &written ); if ( written > (m_preroll + 1) * samples ) { - mlt_log_verbose( getConsumer(), "renderAudio: will flush %lu audiosamples\n", written ); + mlt_log_verbose( getConsumer(), "renderAudio: will flush " DECKLINK_UNSIGNED_FORMAT " audiosamples\n", written ); m_deckLinkOutput->FlushBufferedAudioSamples(); }; #ifdef WIN32 @@ -333,7 +335,7 @@ public: #endif if ( written != (uint32_t) samples ) - mlt_log_verbose( getConsumer(), "renderAudio: samples=%d, written=%lu\n", samples, written ); + mlt_log_verbose( getConsumer(), "renderAudio: samples=%d, written=" DECKLINK_UNSIGNED_FORMAT "\n", samples, written ); } } @@ -414,9 +416,9 @@ public: // Normal non-keyer playout - needs byte swapping if ( !progressive && m_displayMode->GetFieldDominance() == bmdUpperFieldFirst ) // convert lower field first to top field first - swab( (char*) image, (char*) buffer + stride, stride * ( height - 1 ) ); + swab2( (char*) image, (char*) buffer + stride, stride * ( height - 1 ) ); else - swab( (char*) image, (char*) buffer, stride * height ); + swab2( (char*) image, (char*) buffer, stride * height ); } else if ( !mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "test_image" ) ) { @@ -534,8 +536,8 @@ public: if ( cnt != m_acnt ) { mlt_log_debug( getConsumer(), - "ScheduledFrameCompleted: GetBufferedAudioSampleFrameCount %u -> %lu, m_count=%"PRIu64"\n", - m_acnt, cnt, m_count ); + "ScheduledFrameCompleted: GetBufferedAudioSampleFrameCount %u -> " DECKLINK_UNSIGNED_FORMAT + ", m_count=%"PRIu64"\n", m_acnt, cnt, m_count ); m_acnt = cnt; }