From e7f0917665531d016d9b17cec89d8b59d6723def Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Wed, 22 Apr 2020 02:30:06 +0700 Subject: [PATCH] amstream: Store parent as struct audio_stream in audio stream sample. Signed-off-by: Anton Baskanov Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/amstream/audiostream.c | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/dlls/amstream/audiostream.c b/dlls/amstream/audiostream.c index 4e34b2549eb..90c177d177e 100644 --- a/dlls/amstream/audiostream.c +++ b/dlls/amstream/audiostream.c @@ -27,10 +27,31 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); static const WCHAR sink_id[] = L"I{A35FF56B-9FDA-11D0-8FDF-00C04FD9189D}"; +struct audio_stream +{ + IAMMediaStream IAMMediaStream_iface; + IAudioMediaStream IAudioMediaStream_iface; + IMemInputPin IMemInputPin_iface; + IPin IPin_iface; + LONG ref; + + IMultiMediaStream* parent; + MSPID purpose_id; + STREAM_TYPE stream_type; + CRITICAL_SECTION cs; + IMediaStreamFilter *filter; + + IPin *peer; + IMemAllocator *allocator; + AM_MEDIA_TYPE mt; + WAVEFORMATEX format; + FILTER_STATE state; +}; + typedef struct { IAudioStreamSample IAudioStreamSample_iface; LONG ref; - IMediaStream *parent; + struct audio_stream *parent; IAudioData *audio_data; } IAudioStreamSampleImpl; @@ -146,7 +167,7 @@ static const struct IAudioStreamSampleVtbl AudioStreamSample_Vtbl = IAudioStreamSampleImpl_GetAudioData }; -static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample) +static HRESULT audiostreamsample_create(struct audio_stream *parent, IAudioData *audio_data, IAudioStreamSample **audio_stream_sample) { IAudioStreamSampleImpl *object; @@ -158,7 +179,7 @@ static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *a object->IAudioStreamSample_iface.lpVtbl = &AudioStreamSample_Vtbl; object->ref = 1; - object->parent = (IMediaStream*)parent; + object->parent = parent; object->audio_data = audio_data; *audio_stream_sample = &object->IAudioStreamSample_iface; @@ -166,27 +187,6 @@ static HRESULT audiostreamsample_create(IAudioMediaStream *parent, IAudioData *a return S_OK; } -struct audio_stream -{ - IAMMediaStream IAMMediaStream_iface; - IAudioMediaStream IAudioMediaStream_iface; - IMemInputPin IMemInputPin_iface; - IPin IPin_iface; - LONG ref; - - IMultiMediaStream* parent; - MSPID purpose_id; - STREAM_TYPE stream_type; - CRITICAL_SECTION cs; - IMediaStreamFilter *filter; - - IPin *peer; - IMemAllocator *allocator; - AM_MEDIA_TYPE mt; - WAVEFORMATEX format; - FILTER_STATE state; -}; - static inline struct audio_stream *impl_from_IAMMediaStream(IAMMediaStream *iface) { return CONTAINING_RECORD(iface, struct audio_stream, IAMMediaStream_iface); @@ -565,7 +565,7 @@ static HRESULT WINAPI audio_IAudioMediaStream_CreateSample(IAudioMediaStream *if if (!audio_data) return E_POINTER; - return audiostreamsample_create(iface, audio_data, sample); + return audiostreamsample_create(This, audio_data, sample); } static const struct IAudioMediaStreamVtbl audio_IAudioMediaStream_vtbl =