Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: michael@cadilhac.name (Michaël Cadilhac)
To: alsa-devel@alsa-project.org
Subject: Re: Getting pcm_usb_stream plugin to know its limits.
Date: Wed, 30 Dec 2009 12:58:15 -0500	[thread overview]
Message-ID: <87d41wuyx4.fsf@cadilhac.name> (raw)
In-Reply-To: 87ljgkuzdl.fsf@cadilhac.name

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

michael@cadilhac.name (Michaël Cadilhac) writes:

> --- pcm_usb_stream.c	2008-11-21 18:08:16.000000000 -0500
> +++ pcm_usb_stream.c	2009-12-30 12:36:00.654452577 -0500
> @@ -258,7 +258,7 @@
>  	snd_pcm_us_t *us = io->private_data;
>  	VDBG("%u", us->uus->s->periods_done);
>  
> -	if (io->stream == SND_PCM_STREAM_PLAYBACK)
> +	if (io->stream == SND_PCM_STREAM_PLAYBACK && us->uus->s)
>  		memset(us->uus->write_area, 0, us->uus->s->write_size);
>  
>  	return 0;

Just noticed that it would be better phrased as:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: memset.patch --]
[-- Type: text/x-patch, Size: 476 bytes --]

--- /dd/alsa-plugins/usb_stream/pcm_usb_stream.c	2008-11-21 18:08:16.000000000 -0500
+++ pcm_usb_stream.c	2009-12-30 12:57:13.779349630 -0500
@@ -256,7 +256,10 @@
 static int snd_pcm_us_stop(snd_pcm_ioplug_t *io)
 {
 	snd_pcm_us_t *us = io->private_data;
-	VDBG("%u", us->uus->s->periods_done);
 
+	if (!us->uus->s)
+	  return 0;
+
+	VDBG("%u", us->uus->s->periods_done);
 	if (io->stream == SND_PCM_STREAM_PLAYBACK)
 		memset(us->uus->write_area, 0, us->uus->s->write_size);

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]


-- 
Michaël `Micha' Cadilhac (LITQ, U. de Montréal) -- http://michael.cadilhac.name
	|| Un certain Blaise Pascal
	||   etc... etc...
	|| -- Prévert (Les paris stupides)

[-- Attachment #4: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2009-12-30 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 17:48 Getting pcm_usb_stream plugin to know its limits Michaël Cadilhac
2009-12-30 17:58 ` Michaël Cadilhac [this message]
2009-12-31  4:15 ` Michaël Cadilhac
2009-12-31  4:57   ` Getting pcm_usb_stream plugin to know its limits. [Kind of SOLVED] Michaël Cadilhac
2010-01-05  3:26     ` Michaël Cadilhac
2010-01-11 18:35       ` Michaël Cadilhac
2010-01-12  9:52         ` Takashi Iwai
2010-02-02  5:24           ` Michaël Cadilhac
2010-02-10 22:56             ` Michaël Cadilhac
2010-02-22  9:04               ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d41wuyx4.fsf@cadilhac.name \
    --to=michael@cadilhac.name \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox