|
|
@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, |
|
|
|
goto next; |
|
|
|
goto next; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!pformat_set) { |
|
|
|
if (!pformat_set) { |
|
|
|
av_log(avctx, AV_LOG_INFO, " min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\n", |
|
|
|
av_log( |
|
|
|
acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency, |
|
|
|
avctx, |
|
|
|
acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency); |
|
|
|
AV_LOG_INFO, |
|
|
|
|
|
|
|
" ch=%2lu, bits=%2lu, rate=%6lu\n", |
|
|
|
|
|
|
|
fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec |
|
|
|
|
|
|
|
); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if (ctx->sample_rate) { |
|
|
|
if ( |
|
|
|
if (ctx->sample_rate > acaps->MaximumSampleFrequency || |
|
|
|
(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) || |
|
|
|
ctx->sample_rate < acaps->MinimumSampleFrequency) |
|
|
|
(ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) || |
|
|
|
|
|
|
|
(ctx->channels && ctx->channels != fx->nChannels ) |
|
|
|
|
|
|
|
) { |
|
|
|
goto next; |
|
|
|
goto next; |
|
|
|
fx->nSamplesPerSec = ctx->sample_rate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->sample_size) { |
|
|
|
|
|
|
|
if (ctx->sample_size > acaps->MaximumBitsPerSample || |
|
|
|
|
|
|
|
ctx->sample_size < acaps->MinimumBitsPerSample) |
|
|
|
|
|
|
|
goto next; |
|
|
|
|
|
|
|
fx->wBitsPerSample = ctx->sample_size; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ctx->channels) { |
|
|
|
|
|
|
|
if (ctx->channels > acaps->MaximumChannels || |
|
|
|
|
|
|
|
ctx->channels < acaps->MinimumChannels) |
|
|
|
|
|
|
|
goto next; |
|
|
|
|
|
|
|
fx->nChannels = ctx->channels; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (IAMStreamConfig_SetFormat(config, type) != S_OK) |
|
|
|
if (IAMStreamConfig_SetFormat(config, type) != S_OK) |
|
|
|