Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285612
b: refs/heads/master
c: 9c9c3d0
h: refs/heads/master
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Jan 4, 2012
1 parent 8c99bc9 commit 2cd9397
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 38e3d7ce41cff58bacebb2bcecf7d386c60b954b
refs/heads/master: 9c9c3d078b0dd81a74e5f531aa1efa30add5b419
20 changes: 14 additions & 6 deletions trunk/drivers/media/video/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ static void cx23885_codec_settings(struct cx23885_dev *dev)
cx23885_api_cmd(dev, CX2341X_ENC_MISC, 2, 0, 4, 1);
}

static int cx23885_initialize_codec(struct cx23885_dev *dev)
static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder)
{
int version;
int retval;
Expand Down Expand Up @@ -1126,9 +1126,11 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev)
mc417_memory_write(dev, 2120, 0x00000080);

/* start capturing to the host interface */
cx23885_api_cmd(dev, CX2341X_ENC_START_CAPTURE, 2, 0,
CX23885_MPEG_CAPTURE, CX23885_RAW_BITS_NONE);
msleep(10);
if (startencoder) {
cx23885_api_cmd(dev, CX2341X_ENC_START_CAPTURE, 2, 0,
CX23885_MPEG_CAPTURE, CX23885_RAW_BITS_NONE);
msleep(10);
}

return 0;
}
Expand Down Expand Up @@ -1346,7 +1348,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,

call_all(dev, tuner, s_frequency, f);

cx23885_initialize_codec(dev);
cx23885_initialize_codec(dev, 0);

return 0;
}
Expand Down Expand Up @@ -1650,7 +1652,7 @@ static ssize_t mpeg_read(struct file *file, char __user *data,
/* Start mpeg encoder on first read. */
if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) {
if (atomic_inc_return(&dev->v4l_reader_count) == 1) {
if (cx23885_initialize_codec(dev) < 0)
if (cx23885_initialize_codec(dev, 1) < 0)
return -EINVAL;
}
}
Expand Down Expand Up @@ -1805,5 +1807,11 @@ int cx23885_417_register(struct cx23885_dev *dev)
printk(KERN_INFO "%s: registered device %s [mpeg]\n",
dev->name, video_device_node_name(dev->v4l_device));

/* ST: Configure the encoder paramaters, but don't begin
* encoding, this resolves an issue where the first time the
* encoder is started video can be choppy.
*/
cx23885_initialize_codec(dev, 0);

return 0;
}

0 comments on commit 2cd9397

Please sign in to comment.