Ticket #788: pa_nonflat_vol_restore.patch

File pa_nonflat_vol_restore.patch, 1.5 KB (added by samr7, 2 years ago)

Potential fix

  • src/pulsecore/sink-input.c

    old new  
    12221222    if (pa_sink_input_get_state(i) == PA_SINK_INPUT_CORKED) 
    12231223        pa_assert_se(i->sink->n_corked-- >= 1); 
    12241224 
    1225     if (i->sink->flags & PA_SINK_FLAT_VOLUME) 
     1225    if (i->sink->flags & PA_SINK_FLAT_VOLUME) { 
    12261226        /* We might need to update the sink's volume if we are in flat 
    12271227         * volume mode. */ 
    12281228        pa_sink_set_volume(i->sink, NULL, FALSE, FALSE); 
     1229    } else { 
     1230    /* Copy the current volume to the reference ratio, which 
     1231       might be used if the move target is FLAT_VOLUME */ 
     1232    i->reference_ratio = i->volume;  
     1233    } 
    12291234 
    12301235    pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_START_MOVE, i, 0, NULL) == 0); 
    12311236 
     
    13211326 
    13221327        /* We might need to update the sink's volume if we are in flat volume mode. */ 
    13231328        pa_sink_set_volume(i->sink, NULL, FALSE, i->save_volume); 
     1329    } else { 
     1330        set_real_ratio(i, &i->volume); 
     1331 
     1332        /* Copy the new soft_volume to the thread_info struct */ 
     1333        pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME, NULL, 0, NULL) == 0); 
    13241334    } 
    13251335 
    13261336    pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_FINISH_MOVE, i, 0, NULL) == 0);