Ticket #45: pulseaudio-module-fix.patch

File pulseaudio-module-fix.patch, 3.6 KB (added by avuton, 5 years ago)

Proposed Fix (works for me)

  • src/pulsecore/autoload.c

    diff --git a/src/pulsecore/autoload.c b/src/pulsecore/autoload.c
    index 4486660..3909e81 100644
    a b  
    100100    return 0; 
    101101} 
    102102 
    103 int pa_autoload_remove_by_name(pa_core *c, const char*name, pa_namereg_type_t type) { 
     103int pa_autoload_remove_by_name(pa_core *c, const char*name, const char*module, pa_namereg_type_t type) { 
    104104    pa_autoload_entry *e; 
    105105    assert(c && name && module && (type == PA_NAMEREG_SINK || type == PA_NAMEREG_SOURCE)); 
    106106 
  • src/pulsecore/autoload.h

    diff --git a/src/pulsecore/autoload.h b/src/pulsecore/autoload.h
    index 3cd597b..bf885e2 100644
    a b  
    4646 
    4747/* Free all autoload entries */ 
    4848void pa_autoload_free(pa_core *c); 
    49 int pa_autoload_remove_by_name(pa_core *c, const char*name, pa_namereg_type_t type); 
     49int pa_autoload_remove_by_name(pa_core *c, const char*name, const char*module, pa_namereg_type_t type); 
    5050int pa_autoload_remove_by_index(pa_core *c, uint32_t idx); 
    5151 
    5252/* Request an autoload entry by its name, effectively causing a module to be loaded */ 
  • src/pulsecore/cli-command.c

    diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
    index 069f053..0e50e34 100644
    a b  
    9595static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
    9696static int pa_cli_command_autoload_list(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
    9797static int pa_cli_command_autoload_add(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
    98 static int pa_cli_command_autoload_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
     98static int pa_cli_command_autoload_remove(pa_core *c, pa_tokenizer *t, const char*module, pa_strbuf *buf, int *fail); 
    9999static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
    100100static int pa_cli_command_list_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
    101101static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail); 
     
    728728    return 0; 
    729729} 
    730730 
    731 static int pa_cli_command_autoload_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail) { 
     731static int pa_cli_command_autoload_remove(pa_core *c, pa_tokenizer *t, const char*module, pa_strbuf *buf, int *fail) { 
    732732    const char *name; 
    733733    assert(c && t && buf && fail); 
    734734     
     
    737737        return -1; 
    738738    } 
    739739 
    740     if (pa_autoload_remove_by_name(c, name, strstr(pa_tokenizer_get(t, 0), "sink") ? PA_NAMEREG_SINK : PA_NAMEREG_SOURCE) < 0) { 
     740    if (pa_autoload_remove_by_name(c, name, module, strstr(pa_tokenizer_get(t, 0), "sink") ? PA_NAMEREG_SINK : PA_NAMEREG_SOURCE) < 0) { 
    741741        pa_strbuf_puts(buf, "Failed to remove autload entry\n"); 
    742742        return -1; 
    743743    } 
  • src/pulsecore/protocol-native.c

    diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
    index 87a4b91..a7ffd99 100644
    a b  
    20812081    CHECK_VALIDITY(c->pstream, !name || (*name && pa_utf8_valid(name) && (type == 0 || type == 1)), tag, PA_ERR_INVALID); 
    20822082 
    20832083    if (name)  
    2084         r = pa_autoload_remove_by_name(c->protocol->core, name, type == 0 ? PA_NAMEREG_SINK : PA_NAMEREG_SOURCE); 
     2084        r = pa_autoload_remove_by_name(c->protocol->core, name, c->protocol->module, type == 0 ? PA_NAMEREG_SINK : PA_NAMEREG_SOURCE); 
    20852085    else 
    20862086        r = pa_autoload_remove_by_index(c->protocol->core, idx); 
    20872087