Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28074

Modified Files:
        usbaudio.c 
Log Message:
allow specification of rate_table in AUDIO_FIXED_ENDPOINT quirks

Index: usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- usbaudio.c  29 Mar 2004 12:33:37 -0000      1.95
+++ usbaudio.c  6 Apr 2004 14:20:21 -0000       1.96
@@ -2640,6 +2640,7 @@
        struct audioformat *fp;
        struct usb_host_interface *alts;
        int stream, err;
+       int *rate_table = NULL;
 
        fp = kmalloc(sizeof(*fp), GFP_KERNEL);
        if (! fp) {
@@ -2647,16 +2648,30 @@
                return -ENOMEM;
        }
        memcpy(fp, quirk->data, sizeof(*fp));
+       if (fp->nr_rates > 0) {
+               rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL);
+               if (!rate_table) {
+                       kfree(fp);
+                       return -ENOMEM;
+               }
+               memcpy(rate_table, fp->rate_table, sizeof(int) * fp->nr_rates);
+               fp->rate_table = rate_table;
+       }
+
        stream = (fp->endpoint & USB_DIR_IN)
                ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
        err = add_audio_endpoint(chip, stream, fp);
        if (err < 0) {
                kfree(fp);
+               if (rate_table)
+                       kfree(rate_table);
                return err;
        }
        if (fp->iface != get_iface_desc(&iface->altsetting[0])->bInterfaceNumber ||
            fp->altset_idx >= iface->num_altsetting) {
                kfree(fp);
+               if (rate_table)
+                       kfree(rate_table);
                return -EINVAL;
        }
        alts = &iface->altsetting[fp->altset_idx];



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to