Revision 72cf2d4f audio/audio.c

b/audio/audio.c
766 766
            sw->rate = NULL;
767 767
        }
768 768

  
769
        LIST_REMOVE (sw, entries);
770
        LIST_REMOVE (sc, entries);
769
        QLIST_REMOVE (sw, entries);
770
        QLIST_REMOVE (sc, entries);
771 771
        qemu_free (sc);
772 772
        if (was_active) {
773 773
            /* We have removed soft voice from the capture:
......
811 811
            qemu_free (sw);
812 812
            return -1;
813 813
        }
814
        LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
815
        LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
814
        QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
815
        QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
816 816
#ifdef DEBUG_CAPTURE
817 817
        asprintf (&sw->name, "for %p %d,%d,%d",
818 818
                  hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
......
1803 1803
        return;
1804 1804
    }
1805 1805

  
1806
    LIST_INIT (&s->hw_head_out);
1807
    LIST_INIT (&s->hw_head_in);
1808
    LIST_INIT (&s->cap_head);
1806
    QLIST_INIT (&s->hw_head_out);
1807
    QLIST_INIT (&s->hw_head_in);
1808
    QLIST_INIT (&s->cap_head);
1809 1809
    atexit (audio_atexit);
1810 1810

  
1811 1811
    s->ts = qemu_new_timer (vm_clock, audio_timer, s);
......
1887 1887
               "(Audio can continue looping even after stopping the VM)\n");
1888 1888
    }
1889 1889

  
1890
    LIST_INIT (&s->card_head);
1890
    QLIST_INIT (&s->card_head);
1891 1891
    register_savevm ("audio", 0, 1, audio_save, audio_load, s);
1892 1892
}
1893 1893

  
......
1896 1896
    audio_init ();
1897 1897
    card->name = qemu_strdup (name);
1898 1898
    memset (&card->entries, 0, sizeof (card->entries));
1899
    LIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
1899
    QLIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
1900 1900
}
1901 1901

  
1902 1902
void AUD_remove_card (QEMUSoundCard *card)
1903 1903
{
1904
    LIST_REMOVE (card, entries);
1904
    QLIST_REMOVE (card, entries);
1905 1905
    qemu_free (card->name);
1906 1906
}
1907 1907

  
......
1933 1933

  
1934 1934
    cap = audio_pcm_capture_find_specific (as);
1935 1935
    if (cap) {
1936
        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
1936
        QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
1937 1937
        return cap;
1938 1938
    }
1939 1939
    else {
......
1948 1948
        }
1949 1949

  
1950 1950
        hw = &cap->hw;
1951
        LIST_INIT (&hw->sw_head);
1952
        LIST_INIT (&cap->cb_head);
1951
        QLIST_INIT (&hw->sw_head);
1952
        QLIST_INIT (&cap->cb_head);
1953 1953

  
1954 1954
        /* XXX find a more elegant way */
1955 1955
        hw->samples = 4096 * 4;
......
1977 1977
            [hw->info.swap_endianness]
1978 1978
            [audio_bits_to_index (hw->info.bits)];
1979 1979

  
1980
        LIST_INSERT_HEAD (&s->cap_head, cap, entries);
1981
        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
1980
        QLIST_INSERT_HEAD (&s->cap_head, cap, entries);
1981
        QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
1982 1982

  
1983 1983
        hw = NULL;
1984 1984
        while ((hw = audio_pcm_hw_find_any_out (hw))) {
......
2004 2004
    for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
2005 2005
        if (cb->opaque == cb_opaque) {
2006 2006
            cb->ops.destroy (cb_opaque);
2007
            LIST_REMOVE (cb, entries);
2007
            QLIST_REMOVE (cb, entries);
2008 2008
            qemu_free (cb);
2009 2009

  
2010 2010
            if (!cap->cb_head.lh_first) {
......
2021 2021
                        st_rate_stop (sw->rate);
2022 2022
                        sw->rate = NULL;
2023 2023
                    }
2024
                    LIST_REMOVE (sw, entries);
2025
                    LIST_REMOVE (sc, entries);
2024
                    QLIST_REMOVE (sw, entries);
2025
                    QLIST_REMOVE (sc, entries);
2026 2026
                    qemu_free (sc);
2027 2027
                    sw = sw1;
2028 2028
                }
2029
                LIST_REMOVE (cap, entries);
2029
                QLIST_REMOVE (cap, entries);
2030 2030
                qemu_free (cap);
2031 2031
            }
2032 2032
            return;

Also available in: Unified diff