dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,

                    IPin *pin, int *pformat_set)

{

    struct dshow_ctx *ctx = avctx->priv_data;

    IAMStreamConfig *config = NULL;

    AM_MEDIA_TYPE *type = NULL;

    int format_set = 0;

    void *caps = NULL;

    int i, n, size;



    if (IPin_QueryInterface(pin, &IID_IAMStreamConfig, (void **) &config) != S_OK)

        return;

    if (IAMStreamConfig_GetNumberOfCapabilities(config, &n, &size) != S_OK)

        goto end;



    caps = av_malloc(size);

    if (!caps)

        goto end;



    for (i = 0; i < n && !format_set; i++) {

        IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);



#if DSHOWDEBUG

        ff_print_AM_MEDIA_TYPE(type);

#endif



        if (devtype == VideoDevice) {

            VIDEO_STREAM_CONFIG_CAPS *vcaps = caps;

            BITMAPINFOHEADER *bih;

            int64_t *fr;

            const AVCodecTag *const tags[] = { avformat_get_riff_video_tags(), NULL };

#if DSHOWDEBUG

            ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo)) {

                VIDEOINFOHEADER *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo2)) {

                VIDEOINFOHEADER2 *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else {

                goto next;

            }

            if (!pformat_set) {

                enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount);

                if (pix_fmt == AV_PIX_FMT_NONE) {

                    enum AVCodecID codec_id = av_codec_get_id(tags, bih->biCompression);

                    AVCodec *codec = avcodec_find_decoder(codec_id);

                    if (codec_id == AV_CODEC_ID_NONE || !codec) {

                        av_log(avctx, AV_LOG_INFO, "  unknown compression type 0x%X", (int) bih->biCompression);

                    } else {

                        av_log(avctx, AV_LOG_INFO, "  vcodec=%s", codec->name);

                    }

                } else {

                    av_log(avctx, AV_LOG_INFO, "  pixel_format=%s", av_get_pix_fmt_name(pix_fmt));

                }

                av_log(avctx, AV_LOG_INFO, "  min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\n",

                       vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy,

                       1e7 / vcaps->MaxFrameInterval,

                       vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy,

                       1e7 / vcaps->MinFrameInterval);

                continue;

            }

            if (ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO) {

                if (ctx->video_codec_id != av_codec_get_id(tags, bih->biCompression))

                    goto next;

            }

            if (ctx->pixel_format != AV_PIX_FMT_NONE &&

                ctx->pixel_format != dshow_pixfmt(bih->biCompression, bih->biBitCount)) {

                goto next;

            }

            if (ctx->framerate) {

                int64_t framerate = ((int64_t) ctx->requested_framerate.den*10000000)

                                            /  ctx->requested_framerate.num;

                if (framerate > vcaps->MaxFrameInterval ||

                    framerate < vcaps->MinFrameInterval)

                    goto next;

                *fr = framerate;

            }

            if (ctx->requested_width && ctx->requested_height) {

                if (ctx->requested_width  > vcaps->MaxOutputSize.cx ||

                    ctx->requested_width  < vcaps->MinOutputSize.cx ||

                    ctx->requested_height > vcaps->MaxOutputSize.cy ||

                    ctx->requested_height < vcaps->MinOutputSize.cy)

                    goto next;

                bih->biWidth  = ctx->requested_width;

                bih->biHeight = ctx->requested_height;

            }

        } else {

            AUDIO_STREAM_CONFIG_CAPS *acaps = caps;

            WAVEFORMATEX *fx;

#if DSHOWDEBUG

            ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) {

                fx = (void *) type->pbFormat;

            } else {

                goto next;

            }

            if (!pformat_set) {

                av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",

                       acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,

                       acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);

                continue;

            }

            if (ctx->sample_rate) {

                if (ctx->sample_rate > acaps->MaximumSampleFrequency ||

                    ctx->sample_rate < acaps->MinimumSampleFrequency)

                    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)

            goto next;

        format_set = 1;

next:

        if (type->pbFormat)

            CoTaskMemFree(type->pbFormat);

        CoTaskMemFree(type);

    }

end:

    IAMStreamConfig_Release(config);

    if (caps)

        av_free(caps);

    if (pformat_set)

        *pformat_set = format_set;

}

dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,

                    IPin *pin, int *pformat_set)

{

    struct dshow_ctx *ctx = avctx->priv_data;

    IAMStreamConfig *config = NULL;

    AM_MEDIA_TYPE *type = NULL;

    int format_set = 0;

    void *caps = NULL;

    int i, n, size;



    if (IPin_QueryInterface(pin, &IID_IAMStreamConfig, (void **) &config) != S_OK)

        return;

    if (IAMStreamConfig_GetNumberOfCapabilities(config, &n, &size) != S_OK)

        goto end;



    caps = av_malloc(size);

    if (!caps)

        goto end;



    for (i = 0; i < n && !format_set; i++) {

        IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);



#if DSHOWDEBUG

        ff_print_AM_MEDIA_TYPE(type);

#endif



        if (devtype == VideoDevice) {

            VIDEO_STREAM_CONFIG_CAPS *vcaps = caps;

            BITMAPINFOHEADER *bih;

            int64_t *fr;

            const AVCodecTag *const tags[] = { avformat_get_riff_video_tags(), NULL };

#if DSHOWDEBUG

            ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo)) {

                VIDEOINFOHEADER *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo2)) {

                VIDEOINFOHEADER2 *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else {

                goto next;

            }

            if (!pformat_set) {

                enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount);

                if (pix_fmt == AV_PIX_FMT_NONE) {

                    enum AVCodecID codec_id = av_codec_get_id(tags, bih->biCompression);

                    AVCodec *codec = avcodec_find_decoder(codec_id);

                    if (codec_id == AV_CODEC_ID_NONE || !codec) {

                        av_log(avctx, AV_LOG_INFO, "  unknown compression type 0x%X", (int) bih->biCompression);

                    } else {

                        av_log(avctx, AV_LOG_INFO, "  vcodec=%s", codec->name);

                    }

                } else {

                    av_log(avctx, AV_LOG_INFO, "  pixel_format=%s", av_get_pix_fmt_name(pix_fmt));

                }

                av_log(avctx, AV_LOG_INFO, "  min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\n",

                       vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy,

                       1e7 / vcaps->MaxFrameInterval,

                       vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy,

                       1e7 / vcaps->MinFrameInterval);

                continue;

            }

            if (ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO) {

                if (ctx->video_codec_id != av_codec_get_id(tags, bih->biCompression))

                    goto next;

            }

            if (ctx->pixel_format != AV_PIX_FMT_NONE &&

                ctx->pixel_format != dshow_pixfmt(bih->biCompression, bih->biBitCount)) {

                goto next;

            }

            if (ctx->framerate) {

                int64_t framerate = ((int64_t) ctx->requested_framerate.den*10000000)

                                            /  ctx->requested_framerate.num;

                if (framerate > vcaps->MaxFrameInterval ||

                    framerate < vcaps->MinFrameInterval)

                    goto next;

                *fr = framerate;

            }

            if (ctx->requested_width && ctx->requested_height) {

                if (ctx->requested_width  > vcaps->MaxOutputSize.cx ||

                    ctx->requested_width  < vcaps->MinOutputSize.cx ||

                    ctx->requested_height > vcaps->MaxOutputSize.cy ||

                    ctx->requested_height < vcaps->MinOutputSize.cy)

                    goto next;

                bih->biWidth  = ctx->requested_width;

                bih->biHeight = ctx->requested_height;

            }

        } else {

            AUDIO_STREAM_CONFIG_CAPS *acaps = caps;

            WAVEFORMATEX *fx;

#if DSHOWDEBUG

            ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) {

                fx = (void *) type->pbFormat;

            } else {

                goto next;

            }

            if (!pformat_set) {

                av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",

                       acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,

                       acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);

                continue;

            }

            if (ctx->sample_rate) {

                if (ctx->sample_rate > acaps->MaximumSampleFrequency ||

                    ctx->sample_rate < acaps->MinimumSampleFrequency)

                    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)

            goto next;

        format_set = 1;

next:

        if (type->pbFormat)

            CoTaskMemFree(type->pbFormat);

        CoTaskMemFree(type);

    }

end:

    IAMStreamConfig_Release(config);

    if (caps)

        av_free(caps);

    if (pformat_set)

        *pformat_set = format_set;

}

FUNC_0(AVFormatContext *VAR_0, enum dshowDeviceType VAR_1,

                    IPin *VAR_2, int *VAR_3)

{

    struct dshow_ctx *VAR_4 = VAR_0->priv_data;

    IAMStreamConfig *config = NULL;

    AM_MEDIA_TYPE *type = NULL;

    int VAR_5 = 0;

    void *VAR_6 = NULL;

    int VAR_7, VAR_8, VAR_9;



    if (IPin_QueryInterface(VAR_2, &IID_IAMStreamConfig, (void **) &config) != S_OK)

        return;

    if (IAMStreamConfig_GetNumberOfCapabilities(config, &VAR_8, &VAR_9) != S_OK)

        goto end;



    VAR_6 = av_malloc(VAR_9);

    if (!VAR_6)

        goto end;



    for (VAR_7 = 0; VAR_7 < VAR_8 && !VAR_5; VAR_7++) {

        IAMStreamConfig_GetStreamCaps(config, VAR_7, &type, (void *) VAR_6);



#if DSHOWDEBUG

        ff_print_AM_MEDIA_TYPE(type);

#endif



        if (VAR_1 == VideoDevice) {

            VIDEO_STREAM_CONFIG_CAPS *vcaps = VAR_6;

            BITMAPINFOHEADER *bih;

            int64_t *fr;

            const AVCodecTag *const VAR_10[] = { avformat_get_riff_video_tags(), NULL };

#if DSHOWDEBUG

            ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo)) {

                VIDEOINFOHEADER *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo2)) {

                VIDEOINFOHEADER2 *v = (void *) type->pbFormat;

                fr = &v->AvgTimePerFrame;

                bih = &v->bmiHeader;

            } else {

                goto next;

            }

            if (!VAR_3) {

                enum AVPixelFormat VAR_11 = dshow_pixfmt(bih->biCompression, bih->biBitCount);

                if (VAR_11 == AV_PIX_FMT_NONE) {

                    enum AVCodecID VAR_12 = av_codec_get_id(VAR_10, bih->biCompression);

                    AVCodec *codec = avcodec_find_decoder(VAR_12);

                    if (VAR_12 == AV_CODEC_ID_NONE || !codec) {

                        av_log(VAR_0, AV_LOG_INFO, "  unknown compression type 0x%X", (int) bih->biCompression);

                    } else {

                        av_log(VAR_0, AV_LOG_INFO, "  vcodec=%s", codec->name);

                    }

                } else {

                    av_log(VAR_0, AV_LOG_INFO, "  pixel_format=%s", av_get_pix_fmt_name(VAR_11));

                }

                av_log(VAR_0, AV_LOG_INFO, "  min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\VAR_8",

                       vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy,

                       1e7 / vcaps->MaxFrameInterval,

                       vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy,

                       1e7 / vcaps->MinFrameInterval);

                continue;

            }

            if (VAR_4->video_codec_id != AV_CODEC_ID_RAWVIDEO) {

                if (VAR_4->video_codec_id != av_codec_get_id(VAR_10, bih->biCompression))

                    goto next;

            }

            if (VAR_4->pixel_format != AV_PIX_FMT_NONE &&

                VAR_4->pixel_format != dshow_pixfmt(bih->biCompression, bih->biBitCount)) {

                goto next;

            }

            if (VAR_4->framerate) {

                int64_t framerate = ((int64_t) VAR_4->requested_framerate.den*10000000)

                                            /  VAR_4->requested_framerate.num;

                if (framerate > vcaps->MaxFrameInterval ||

                    framerate < vcaps->MinFrameInterval)

                    goto next;

                *fr = framerate;

            }

            if (VAR_4->requested_width && VAR_4->requested_height) {

                if (VAR_4->requested_width  > vcaps->MaxOutputSize.cx ||

                    VAR_4->requested_width  < vcaps->MinOutputSize.cx ||

                    VAR_4->requested_height > vcaps->MaxOutputSize.cy ||

                    VAR_4->requested_height < vcaps->MinOutputSize.cy)

                    goto next;

                bih->biWidth  = VAR_4->requested_width;

                bih->biHeight = VAR_4->requested_height;

            }

        } else {

            AUDIO_STREAM_CONFIG_CAPS *acaps = VAR_6;

            WAVEFORMATEX *fx;

#if DSHOWDEBUG

            ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);

#endif

            if (IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) {

                fx = (void *) type->pbFormat;

            } else {

                goto next;

            }

            if (!VAR_3) {

                av_log(VAR_0, AV_LOG_INFO, "  min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\VAR_8",

                       acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,

                       acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);

                continue;

            }

            if (VAR_4->sample_rate) {

                if (VAR_4->sample_rate > acaps->MaximumSampleFrequency ||

                    VAR_4->sample_rate < acaps->MinimumSampleFrequency)

                    goto next;

                fx->nSamplesPerSec = VAR_4->sample_rate;

            }

            if (VAR_4->sample_size) {

                if (VAR_4->sample_size > acaps->MaximumBitsPerSample ||

                    VAR_4->sample_size < acaps->MinimumBitsPerSample)

                    goto next;

                fx->wBitsPerSample = VAR_4->sample_size;

            }

            if (VAR_4->channels) {

                if (VAR_4->channels > acaps->MaximumChannels ||

                    VAR_4->channels < acaps->MinimumChannels)

                    goto next;

                fx->nChannels = VAR_4->channels;

            }

        }

        if (IAMStreamConfig_SetFormat(config, type) != S_OK)

            goto next;

        VAR_5 = 1;

next:

        if (type->pbFormat)

            CoTaskMemFree(type->pbFormat);

        CoTaskMemFree(type);

    }

end:

    IAMStreamConfig_Release(config);

    if (VAR_6)

        av_free(VAR_6);

    if (VAR_3)

        *VAR_3 = VAR_5;

}

FUNC_0(AVFormatContext *VAR_0, enum dshowDeviceType VAR_1,
IPin *VAR_2, int *VAR_3)
{ struct dshow_ctx *VAR_4 = VAR_0->priv_data; IAMStreamConfig *config = NULL; AM_MEDIA_TYPE *type = NULL; int VAR_5 = 0; void *VAR_6 = NULL; int VAR_7, VAR_8, VAR_9; if (IPin_QueryInterface(VAR_2, &IID_IAMStreamConfig, (void **) &config) != S_OK)
return; if (IAMStreamConfig_GetNumberOfCapabilities(config, &VAR_8, &VAR_9) != S_OK)
goto end; VAR_6 = av_malloc(VAR_9); if (!VAR_6)
goto end; for (VAR_7 = 0; VAR_7 < VAR_8 && !VAR_5; VAR_7++) { IAMStreamConfig_GetStreamCaps(config, VAR_7, &type, (void *) VAR_6); #if DSHOWDEBUG
ff_print_AM_MEDIA_TYPE(type); #endif
if (VAR_1 == VideoDevice) { VIDEO_STREAM_CONFIG_CAPS *vcaps = VAR_6; BITMAPINFOHEADER *bih; int64_t *fr; const AVCodecTag *const VAR_10[] = { avformat_get_riff_video_tags(), NULL }; #if DSHOWDEBUG
ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps); #endif
if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo)) { VIDEOINFOHEADER *v = (void *) type->pbFormat; fr = &v->AvgTimePerFrame; bih = &v->bmiHeader; } else if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo2)) { VIDEOINFOHEADER2 *v = (void *) type->pbFormat; fr = &v->AvgTimePerFrame; bih = &v->bmiHeader; } else { goto next; } if (!VAR_3) { enum AVPixelFormat VAR_11 = dshow_pixfmt(bih->biCompression, bih->biBitCount); if (VAR_11 == AV_PIX_FMT_NONE) { enum AVCodecID VAR_12 = av_codec_get_id(VAR_10, bih->biCompression); AVCodec *codec = avcodec_find_decoder(VAR_12); if (VAR_12 == AV_CODEC_ID_NONE || !codec) { av_log(VAR_0, AV_LOG_INFO, "  unknown compression type 0x%X", (int) bih->biCompression); } else { av_log(VAR_0, AV_LOG_INFO, "  vcodec=%s", codec->name); } } else { av_log(VAR_0, AV_LOG_INFO, "  pixel_format=%s", av_get_pix_fmt_name(VAR_11)); } av_log(VAR_0, AV_LOG_INFO, "  min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\VAR_8",
vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy,
1e7 / vcaps->MaxFrameInterval,
vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy,
1e7 / vcaps->MinFrameInterval); continue; } if (VAR_4->video_codec_id != AV_CODEC_ID_RAWVIDEO) { if (VAR_4->video_codec_id != av_codec_get_id(VAR_10, bih->biCompression))
goto next; } if (VAR_4->pixel_format != AV_PIX_FMT_NONE &&
VAR_4->pixel_format != dshow_pixfmt(bih->biCompression, bih->biBitCount)) { goto next; } if (VAR_4->framerate) { int64_t framerate = ((int64_t) VAR_4->requested_framerate.den*10000000)
/  VAR_4->requested_framerate.num; if (framerate > vcaps->MaxFrameInterval ||
framerate < vcaps->MinFrameInterval)
goto next; *fr = framerate; } if (VAR_4->requested_width && VAR_4->requested_height) { if (VAR_4->requested_width  > vcaps->MaxOutputSize.cx ||
VAR_4->requested_width  < vcaps->MinOutputSize.cx ||
VAR_4->requested_height > vcaps->MaxOutputSize.cy ||
VAR_4->requested_height < vcaps->MinOutputSize.cy)
goto next; bih->biWidth  = VAR_4->requested_width; bih->biHeight = VAR_4->requested_height; } } else { AUDIO_STREAM_CONFIG_CAPS *acaps = VAR_6; WAVEFORMATEX *fx; #if DSHOWDEBUG
ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps); #endif
if (IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) { fx = (void *) type->pbFormat; } else { goto next; } if (!VAR_3) { av_log(VAR_0, AV_LOG_INFO, "  min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\VAR_8",
acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,
acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency); continue; } if (VAR_4->sample_rate) { if (VAR_4->sample_rate > acaps->MaximumSampleFrequency ||
VAR_4->sample_rate < acaps->MinimumSampleFrequency)
goto next; fx->nSamplesPerSec = VAR_4->sample_rate; } if (VAR_4->sample_size) { if (VAR_4->sample_size > acaps->MaximumBitsPerSample ||
VAR_4->sample_size < acaps->MinimumBitsPerSample)
goto next; fx->wBitsPerSample = VAR_4->sample_size; } if (VAR_4->channels) { if (VAR_4->channels > acaps->MaximumChannels ||
VAR_4->channels < acaps->MinimumChannels)
goto next; fx->nChannels = VAR_4->channels; } } if (IAMStreamConfig_SetFormat(config, type) != S_OK)
goto next; VAR_5 = 1; next:
if (type->pbFormat)
CoTaskMemFree(type->pbFormat); CoTaskMemFree(type); } end:
IAMStreamConfig_Release(config); if (VAR_6)
av_free(VAR_6); if (VAR_3)
*VAR_3 = VAR_5; }