From 4bf163ecfac27c3dd86dff96df6f4647f9afe021 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 9 Oct 2020 14:19:40 +0300 Subject: Cleanup Moved buffers out of player.c. Include MIME type with the data so the correct decoder can be chosen. Added stb_vorbis: https://github.com/nothings/stb --- src/media.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/media.c') diff --git a/src/media.c b/src/media.c index c447704b..c0d6d3de 100644 --- a/src/media.c +++ b/src/media.c @@ -182,13 +182,13 @@ void setData_Media(iMedia *d, iGmLinkId linkId, const iString *mime, const iBloc else { audio = at_PtrArray(&d->audio, existing - 1); iAssert(equal_String(&audio->props.mime, mime)); /* MIME cannot change */ - updateSourceData_Player(audio->player, data, append_PlayerUpdate); + updateSourceData_Player(audio->player, mime, data, append_PlayerUpdate); if (!isStarted_Player(audio->player)) { /* Maybe the previous updates didn't have enough data. */ start_Player(audio->player); } if (!isPartial) { - updateSourceData_Player(audio->player, NULL, complete_PlayerUpdate); + updateSourceData_Player(audio->player, NULL, NULL, complete_PlayerUpdate); } } } @@ -209,9 +209,9 @@ void setData_Media(iMedia *d, iGmLinkId linkId, const iString *mime, const iBloc audio->props.linkId = linkId; /* TODO: use a hash? */ audio->props.isPermanent = !allowHide; set_String(&audio->props.mime, mime); - updateSourceData_Player(audio->player, data, replace_PlayerUpdate); + updateSourceData_Player(audio->player, mime, data, replace_PlayerUpdate); if (!isPartial) { - updateSourceData_Player(audio->player, NULL, complete_PlayerUpdate); + updateSourceData_Player(audio->player, NULL, NULL, complete_PlayerUpdate); } pushBack_PtrArray(&d->audio, audio); /* TEST: Start playing right away. */ -- cgit v1.2.3