diff options
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index b03c7ae5f4e3..dfc28542a007 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -1784,14 +1784,16 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, | |||
1784 | { | 1784 | { |
1785 | struct snd_pcm_hw_params *params = arg; | 1785 | struct snd_pcm_hw_params *params = arg; |
1786 | snd_pcm_format_t format; | 1786 | snd_pcm_format_t format; |
1787 | int channels, width; | 1787 | int channels; |
1788 | ssize_t frame_size; | ||
1788 | 1789 | ||
1789 | params->fifo_size = substream->runtime->hw.fifo_size; | 1790 | params->fifo_size = substream->runtime->hw.fifo_size; |
1790 | if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { | 1791 | if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { |
1791 | format = params_format(params); | 1792 | format = params_format(params); |
1792 | channels = params_channels(params); | 1793 | channels = params_channels(params); |
1793 | width = snd_pcm_format_physical_width(format); | 1794 | frame_size = snd_pcm_format_size(format, channels); |
1794 | params->fifo_size /= width * channels; | 1795 | if (frame_size > 0) |
1796 | params->fifo_size /= (unsigned)frame_size; | ||
1795 | } | 1797 | } |
1796 | return 0; | 1798 | return 0; |
1797 | } | 1799 | } |