mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
Merge branch 'fix-NULL-check' into 'master'
alsa-pcm: Guard fflush/fclose on state->log_file with NULL check See merge request pipewire/pipewire!2810
This commit is contained in:
commit
d6cf88e6cb
1 changed files with 7 additions and 4 deletions
|
|
@ -1094,7 +1094,7 @@ int spa_alsa_clear(struct state *state)
|
||||||
|
|
||||||
if ((err = snd_output_close(state->output)) < 0)
|
if ((err = snd_output_close(state->output)) < 0)
|
||||||
spa_log_warn(state->log, "output close failed: %s", snd_strerror(err));
|
spa_log_warn(state->log, "output close failed: %s", snd_strerror(err));
|
||||||
fclose(state->log_file);
|
spa_clear_ptr(state->log_file, fclose);
|
||||||
|
|
||||||
free(state->tag[0]);
|
free(state->tag[0]);
|
||||||
free(state->tag[1]);
|
free(state->tag[1]);
|
||||||
|
|
@ -1189,7 +1189,8 @@ static int do_link(struct state *driver, struct state *state)
|
||||||
snd_pcm_status_dump(status, state->output);
|
snd_pcm_status_dump(status, state->output);
|
||||||
snd_pcm_status(state->hndl, status);
|
snd_pcm_status(state->hndl, status);
|
||||||
snd_pcm_status_dump(status, state->output);
|
snd_pcm_status_dump(status, state->output);
|
||||||
fflush(state->log_file);
|
if (state->log_file)
|
||||||
|
fflush(state->log_file);
|
||||||
|
|
||||||
res = snd_pcm_link(driver->hndl, state->hndl);
|
res = snd_pcm_link(driver->hndl, state->hndl);
|
||||||
if (res >= 0 || res == -EALREADY)
|
if (res >= 0 || res == -EALREADY)
|
||||||
|
|
@ -1734,7 +1735,8 @@ static void debug_hw_params(struct state *state, const char *prefix, snd_pcm_hw_
|
||||||
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
||||||
spa_log_debug(state->log, "%s:", prefix);
|
spa_log_debug(state->log, "%s:", prefix);
|
||||||
snd_pcm_hw_params_dump(params, state->output);
|
snd_pcm_hw_params_dump(params, state->output);
|
||||||
fflush(state->log_file);
|
if (state->log_file)
|
||||||
|
fflush(state->log_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int enum_pcm_formats(struct state *state, uint32_t index, uint32_t *next,
|
static int enum_pcm_formats(struct state *state, uint32_t index, uint32_t *next,
|
||||||
|
|
@ -2625,7 +2627,8 @@ static int set_swparams(struct state *state)
|
||||||
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
||||||
spa_log_debug(state->log, "state after sw_params:");
|
spa_log_debug(state->log, "state after sw_params:");
|
||||||
snd_pcm_dump(hndl, state->output);
|
snd_pcm_dump(hndl, state->output);
|
||||||
fflush(state->log_file);
|
if (state->log_file)
|
||||||
|
fflush(state->log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue