Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353474
b: refs/heads/master
c: 17ac8e5
h: refs/heads/master
v: v3
  • Loading branch information
Richard Fitzgerald authored and Takashi Iwai committed Feb 11, 2013
1 parent c349739 commit 1bbfef2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f664417e23192087bb9bdafdff80e04104994cc0
refs/heads/master: 17ac8e5c6d3478dcfeb75ed5716ca7e5cee612f0
18 changes: 12 additions & 6 deletions trunk/sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,27 @@ static int snd_compr_free(struct inode *inode, struct file *f)
return 0;
}

static void snd_compr_update_tstamp(struct snd_compr_stream *stream,
static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp)
{
if (!stream->ops->pointer)
return;
return -ENOTSUPP;
stream->ops->pointer(stream, tstamp);
pr_debug("dsp consumed till %d total %d bytes\n",
tstamp->byte_offset, tstamp->copied_total);
stream->runtime->hw_pointer = tstamp->byte_offset;
stream->runtime->total_bytes_transferred = tstamp->copied_total;
return 0;
}

static size_t snd_compr_calc_avail(struct snd_compr_stream *stream,
struct snd_compr_avail *avail)
{
long avail_calc; /*this needs to be signed variable */

memset(avail, 0, sizeof(*avail));
snd_compr_update_tstamp(stream, &avail->tstamp);
/* Still need to return avail even if tstamp can't be filled in */

/* FIXME: This needs to be different for capture stream,
available is # of compressed data, for playback it's
Expand Down Expand Up @@ -517,11 +520,14 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg)
static inline int
snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg)
{
struct snd_compr_tstamp tstamp;
struct snd_compr_tstamp tstamp = {0};
int ret;

snd_compr_update_tstamp(stream, &tstamp);
return copy_to_user((struct snd_compr_tstamp __user *)arg,
&tstamp, sizeof(tstamp)) ? -EFAULT : 0;
ret = snd_compr_update_tstamp(stream, &tstamp);
if (ret == 0)
ret = copy_to_user((struct snd_compr_tstamp __user *)arg,
&tstamp, sizeof(tstamp)) ? -EFAULT : 0;
return ret;
}

static int snd_compr_pause(struct snd_compr_stream *stream)
Expand Down

0 comments on commit 1bbfef2

Please sign in to comment.