[PATCH 2/2] dmime: Record DMUS_IO_TRACK_EXTRAS_HEADER information with track

Michael Stefaniuc mstefani at winehq.org
Wed Mar 25 16:54:40 CDT 2020


On 3/25/20 10:44 PM, Michael Stefaniuc wrote:
> Hello AListair,
> 
> do you have more in this series?
> I had looked into this and it didn't seem that simple so I have settled
> to just do commit 4ccdf3e58a8.
> 
> Most likely the flags should be set with
> IDirectMusicSegment8::SetTrackConfig() as the documentation of
> DMUS_IO_TRACK_EXTRAS_HEADER alludes too.
> Also while that stuff is for a track it needs to be duplicated to a
> SegmentState; see the Remarks in
> http://doc.51windows.net/Directx9_SDK/htm/idirectmusicsegment8settrackconfig.htm
> And there's
> http://doc.51windows.net/directx9_sdk/htm/idirectmusicsegmentstate8settrackconfig.htm
> 
> And no clue what the dwPriority is for. The only priority stuff I can
> find is for the channels.
> 
> 
> So most likely we will need a helper for InsertTrack() that either
> returns the index in the corresponding group or a
> LPDMUS_PRIVATE_SEGMENT_TRACK.
Scratch that, just to a list_tail(&This->Tracks). Less ugly and more
correct then the alternatives if you need the LPDMUS_PRIVATE_SEGMENT_TRACK.

> But I wouldn't bother to store the info if we don't know how to use it.
This still remains valid.

bye
	michael



> On 3/25/20 12:17 PM, Alistair Leslie-Hughes wrote:
>> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
>> ---
>>  dlls/dmime/dmime_private.h |  2 ++
>>  dlls/dmime/segment.c       | 11 +++++++++--
>>  2 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h
>> index 576ebc1ae8..020c1660cb 100644
>> --- a/dlls/dmime/dmime_private.h
>> +++ b/dlls/dmime/dmime_private.h
>> @@ -77,6 +77,8 @@ extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSo
>>  typedef struct _DMUS_PRIVATE_SEGMENT_TRACK {
>>    struct list entry; /* for listing elements */
>>    DWORD dwGroupBits;
>> +  DWORD flags;
>> +  DWORD priority;
>>    IDirectMusicTrack* pTrack;
>>  } DMUS_PRIVATE_SEGMENT_TRACK, *LPDMUS_PRIVATE_SEGMENT_TRACK;
>>  
>> diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
>> index cfc67a7757..0fdfb2a10a 100644
>> --- a/dlls/dmime/segment.c
>> +++ b/dlls/dmime/segment.c
>> @@ -630,7 +630,8 @@ static HRESULT parse_track_form(IDirectMusicSegment8Impl *This, IStream *stream,
>>      IPersistStream *ps = NULL;
>>      IStream *clone;
>>      DMUS_IO_TRACK_HEADER thdr;
>> -    DMUS_IO_TRACK_EXTRAS_HEADER txhdr;
>> +    DMUS_IO_TRACK_EXTRAS_HEADER txhdr = {0};
>> +    LPDMUS_PRIVATE_SEGMENT_TRACK item;
>>      HRESULT hr;
>>  
>>      TRACE("Parsing track form in %p: %s\n", stream, debugstr_chunk(riff));
>> @@ -663,7 +664,6 @@ static HRESULT parse_track_form(IDirectMusicSegment8Impl *This, IStream *stream,
>>  
>>          if (chunk.id == DMUS_FOURCC_TRACK_EXTRAS_CHUNK &&
>>                  SUCCEEDED(stream_chunk_get_data(stream, &chunk, &txhdr, sizeof(txhdr)))) {
>> -            FIXME("DMUS_IO_TRACK_EXTRAS_HEADER chunk not handled\n");
>>              TRACE("dwFlags: %#x, dwPriority: %u\n", txhdr.dwFlags, txhdr.dwPriority);
>>          }
>>      }
>> @@ -688,7 +688,14 @@ static HRESULT parse_track_form(IDirectMusicSegment8Impl *This, IStream *stream,
>>          goto done;
>>  
>>      hr = IDirectMusicSegment8_InsertTrack(&This->IDirectMusicSegment8_iface, track, thdr.dwGroup);
>> +    if (FAILED(hr))
>> +        goto done;
>>  
>> +    item = get_track_entry(This, &thdr.guidClassID, thdr.dwGroup, 0);
>> +    if (item) {
>> +        item->flags = txhdr.dwFlags;
>> +        item->priority = txhdr.dwPriority;
>> +    }
>>  done:
>>      if (ps)
>>          IPersistStream_Release(ps);
>>
> 
> 




More information about the wine-devel mailing list