[PATCH v4 3/6] qasf: Implement ASF Reader filter init_stream and cleanup_stream.

Zebediah Figura zfigura at codeweavers.com
Mon Jul 4 15:26:31 CDT 2022


On 6/15/22 01:58, Rémi Bernon wrote:
> +static HRESULT asf_reader_init_stream(struct strmbase_filter *iface)
> +{
> +    struct asf_reader *filter = impl_from_strmbase_filter(iface);
> +    HRESULT hr;
> +    int i;
> +
> +    TRACE("iface %p\n", iface);
> +
> +    for (i = 0; i < filter->stream_count; ++i)
> +    {
> +        struct asf_stream *stream = filter->streams + i;
> +
> +        if (!stream->source.pin.peer)
> +            continue;
> +
> +        hr = IMemAllocator_Commit(stream->source.pAllocator);
> +        if (FAILED(hr))
> +        {
> +            WARN("Failed to commit stream %u allocator, hr %#lx\n", i, hr);
> +            continue;
> +        }
> +
> +        hr = IPin_NewSegment(stream->source.pin.peer, 0, 0, 1);
> +        if (FAILED(hr))
> +        {
> +            WARN("Failed to start stream %u new segment, hr %#lx\n", i, hr);
> +            continue;
> +        }
> +    }
> +
> +    return IWMReader_Start(filter->reader, 0, 0, 1, NULL);
> +}
> +
> +static HRESULT asf_reader_cleanup_stream(struct strmbase_filter *iface)
> +{
> +    struct asf_reader *filter = impl_from_strmbase_filter(iface);
> +    int i;
> +
> +    TRACE("iface %p\n", iface);

Shouldn't the reader be stopped here?

> +
> +    for (i = 0; i < filter->stream_count; ++i)
> +    {
> +        struct asf_stream *stream = filter->streams + i;
> +
> +        if (!stream->source.pin.peer)
> +            continue;
> +
> +        IMemAllocator_Decommit(stream->source.pAllocator);
> +    }
> +
> +    return S_OK;
> +}
> +



More information about the wine-devel mailing list