static int mls_disable_stream(void* data, int streamIndex) { MultipleMediaSources* multSource = (MultipleMediaSources*)data; MediaSourceElement* ele = &multSource->sources; int maxIndex = 0; int minIndex = 0; while (ele != NULL && ele->source != NULL) { maxIndex += ele->numStreams; if (streamIndex < maxIndex) { if (!msc_disable_stream(ele->source, streamIndex - minIndex)) { return 0; } ele->disabledStreamCount++; return 1; } minIndex = maxIndex; ele = ele->next; } return 0; }
static void udp_set_frame_rate_or_disable(void* data, const Rational* frameRate) { UDPSource* source = (UDPSource*)data; int i; /* disable this source if the frame rate differs */ if (memcmp(frameRate, &source->frameRate, sizeof(*frameRate)) != 0) { for (i = 0; i < source->numTracks; i++) { msc_disable_stream(&source->mediaSource, i); } } }
static void bks_set_frame_rate_or_disable(void* data, const Rational* frameRate) { BlankSource* source = (BlankSource*)data; if (source->streamInfo.isHardFrameRate && memcmp(frameRate, &source->streamInfo.frameRate, sizeof(*frameRate)) != 0) { msc_disable_stream(&source->mediaSource, 0); return; } source->length = convert_length(source->length, &source->streamInfo.frameRate, frameRate); source->position = convert_length(source->position, &source->streamInfo.frameRate, frameRate); source->streamInfo.frameRate = *frameRate; }
static void sts_set_frame_rate_or_disable(void* data, const Rational* frameRate) { SystemTimecodeSource* source = (SystemTimecodeSource*)data; if (source->streamInfo.isHardFrameRate && memcmp(frameRate, &source->streamInfo.frameRate, sizeof(*frameRate)) != 0) { msc_disable_stream(&source->mediaSource, 0); return; } source->startTimecode = convert_non_drop_timecode(source->startTimecode, &source->streamInfo.frameRate, frameRate); source->length = convert_length(source->length, &source->streamInfo.frameRate, frameRate); source->position = convert_length(source->position, &source->streamInfo.frameRate, frameRate); source->streamInfo.frameRate = *frameRate; }
static int cps_disable_stream(void* data, int streamIndex) { ClipSource* clipSource = (ClipSource*)data; return msc_disable_stream(clipSource->targetSource, streamIndex); }