annotate libdha/sysdep/pci_alpha.c @ 18708:9e2b300db17b

Change free_sh_audio() to take demuxer and stream id as parameters (same as new_sh_audio()) instead of sh_audio_t *, use those to remove the pointer from demuxer->a_streams[] before freeing it. Some demuxers use free_sh_audio() to undo the creation of an already-allocated audio stream in case of error. These uses were unsafe since free_sh_audio() freed the data structure but left the pointer in demuxer->a_streams[], leading to double free later in free_demuxer() (and perhaps use of the freed stream before that, I didn't check).
author uau
date Wed, 14 Jun 2006 14:05:59 +0000
parents 567de708ab3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
1 /*
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
2 This file is based on:
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
3 $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
4 Modified for readability by Nick Kurshev
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
5 */
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
6
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
7 static int pci_config_type( void ) { return 1; }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
8
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
9 static int pci_get_vendor(
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
10 unsigned char bus,
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
11 unsigned char dev,
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
12 int func)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
13 {
5702
567de708ab3a sync with mplayerxp
nick
parents: 4164
diff changeset
14 unsigned long retval;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
15 pciconfig_read(bus, dev<<3, PCI_ID_REG, 4, &retval);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
16 return retval;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
17 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
18
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
19 static long pci_config_read_long(
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
20 unsigned char bus,
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
21 unsigned char dev,
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
22 int func,
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
23 unsigned cmd)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
24 {
5702
567de708ab3a sync with mplayerxp
nick
parents: 4164
diff changeset
25 unsigned long retval;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
26 pciconfig_read(bus, dev<<3, cmd, 4, &retval);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
27 return retval;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
28 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
29