1
0
Эх сурвалжийг харах

decklink: Fix bug with old channel formats

There were cases where the channel format could be set to 7, which used
to be a valid format but now no longer is.  If that format is set, just
use SPEAKERS_7POINT1 instead.
jp9000 7 жил өмнө
parent
commit
ed5ee5aae2

+ 9 - 2
plugins/decklink/plugin-main.cpp

@@ -74,8 +74,15 @@ static void decklink_update(void *data, obs_data_t *settings)
 			COLOR_SPACE);
 	video_range_type colorRange = (video_range_type)obs_data_get_int(settings,
 			COLOR_RANGE);
-	speaker_layout channelFormat = (speaker_layout)obs_data_get_int(settings,
-			CHANNEL_FORMAT);
+	int chFmtInt = (int)obs_data_get_int(settings, CHANNEL_FORMAT);
+
+	if (chFmtInt == 7) {
+		chFmtInt = SPEAKERS_7POINT1;
+	} else if (chFmtInt < SPEAKERS_UNKNOWN || chFmtInt > SPEAKERS_7POINT1) {
+		chFmtInt = 2;
+	}
+
+	speaker_layout channelFormat = (speaker_layout)chFmtInt;
 
 	decklink_enable_buffering(decklink,
 			obs_data_get_bool(settings, BUFFERING));