Skip to content

Commit

Permalink
request proper surroundParams to get correct surround mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Apr 16, 2024
1 parent 2cad8b3 commit 8392a1a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/libgamestream/libgamestream/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void gs_set_timeout(GS_CLIENT hnd, int timeout_secs);
int gs_get_status(GS_CLIENT hnd, PSERVER_DATA server, const char *address, uint16_t port, bool unsupported);

int gs_start_app(GS_CLIENT hnd, PSERVER_DATA server, PSTREAM_CONFIGURATION config, int appId, bool is_gfe, bool sops,
bool localaudio, int gamepad_mask);
bool localaudio, int gamepad_mask, const char *surround_params);

int gs_applist(GS_CLIENT hnd, const SERVER_DATA *server, PAPP_LIST *app_list);

Expand Down
5 changes: 4 additions & 1 deletion core/libgamestream/src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ int gs_applist(GS_CLIENT hnd, const SERVER_DATA *server, PAPP_LIST *list) {
}

int gs_start_app(GS_CLIENT hnd, PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, bool is_gfe, bool sops,
bool localaudio, int gamepad_mask) {
bool localaudio, int gamepad_mask, const char* surround_params) {
int ret = GS_OK;
char *result = NULL;
HTTP_DATA *data = NULL;
Expand Down Expand Up @@ -553,6 +553,9 @@ int gs_start_app(GS_CLIENT hnd, PSERVER_DATA server, STREAM_CONFIGURATION *confi
append_param(url, sizeof(url), "rikey", "%s", rikey_hex);
append_param(url, sizeof(url), "rikeyid", "%d", rikeyid);
append_param(url, sizeof(url), "surroundAudioInfo", "%d", surround_info);
if (surround_params) {
append_param(url, sizeof(url), "surroundParams", surround_params);
}
if (!resume || !is_gfe) {
if (config->supportedVideoFormats & VIDEO_FORMAT_MASK_10BIT) {
append_param(url, sizeof(url), "hdrMode", "1");
Expand Down
9 changes: 8 additions & 1 deletion src/app/stream/session_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ int session_worker(session_t *session) {
commons_log_info("Session", "Launch app %d...", appId);
GS_CLIENT client = app_gs_client_new(app);
gs_set_timeout(client, 30);
const char *surround_params = NULL;
#if TARGET_WEBOS
if (session->config.stream.audioConfiguration == AUDIO_CONFIGURATION_51_SURROUND) {
// 6 channels, 4 streams, 2 coupled streams, FL, FR, SL, SR, FC, LFE
surround_params = "642014523";
}
#endif
int ret = gs_start_app(client, server, &session->config.stream, appId, server->isGfe, session->config.sops,
session->config.local_audio, app_input_gamepads_mask(&app->input));
session->config.local_audio, app_input_gamepads_mask(&app->input), surround_params);
if (ret != GS_OK) {
session_set_state(session, STREAMING_ERROR);
const char *gs_error = NULL;
Expand Down
2 changes: 1 addition & 1 deletion third_party/ss4s

0 comments on commit 8392a1a

Please sign in to comment.