aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-22 07:46:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:32 -0400
commitac4251445d7302697814351f1d9f548f5aa49342 (patch)
tree27f38b0759298cc23e301dada0f25ea9215f6b6b /drivers/media
parentbc147135bc410bdd9da684646af75a188d882d56 (diff)
V4L/DVB (5916): ivtv: fix pause/continue/play handling
Pausing a decoder followed by a Play command would do nothing. Fixed. Pausing a decoder running at non-standard speed following by a Continue would reset the speed to 100%. Fixed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h1
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c1
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c11
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 91b588d261ae..8abb34a35816 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -417,6 +417,7 @@ struct ivtv_mailbox_data {
417#define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */ 417#define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */
418#define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */ 418#define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */
419#define IVTV_F_I_PIO 19 /* PIO in progress */ 419#define IVTV_F_I_PIO 19 /* PIO in progress */
420#define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */
420 421
421/* Event notifications */ 422/* Event notifications */
422#define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ 423#define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 8e97a938398f..baa17cbee5e1 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -757,6 +757,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
757 itv->output_mode = OUT_NONE; 757 itv->output_mode = OUT_NONE;
758 758
759 itv->speed = 0; 759 itv->speed = 0;
760 clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags);
760 ivtv_release_stream(s); 761 ivtv_release_stream(s);
761} 762}
762 763
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 4773453e8dab..047624b9e271 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -285,6 +285,10 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id,
285 285
286 if (ivtv_set_output_mode(itv, OUT_MPG) != OUT_MPG) 286 if (ivtv_set_output_mode(itv, OUT_MPG) != OUT_MPG)
287 return -EBUSY; 287 return -EBUSY;
288 if (test_and_clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags)) {
289 /* forces ivtv_set_speed to be called */
290 itv->speed = 0;
291 }
288 return ivtv_start_decoding(id, vc->play.speed); 292 return ivtv_start_decoding(id, vc->play.speed);
289 } 293 }
290 294
@@ -309,6 +313,7 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id,
309 if (atomic_read(&itv->decoding) > 0) { 313 if (atomic_read(&itv->decoding) > 0) {
310 ivtv_vapi(itv, CX2341X_DEC_PAUSE_PLAYBACK, 1, 314 ivtv_vapi(itv, CX2341X_DEC_PAUSE_PLAYBACK, 1,
311 (vc->flags & VIDEO_CMD_FREEZE_TO_BLACK) ? 1 : 0); 315 (vc->flags & VIDEO_CMD_FREEZE_TO_BLACK) ? 1 : 0);
316 set_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags);
312 } 317 }
313 break; 318 break;
314 319
@@ -317,8 +322,10 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id,
317 if (try) break; 322 if (try) break;
318 if (itv->output_mode != OUT_MPG) 323 if (itv->output_mode != OUT_MPG)
319 return -EBUSY; 324 return -EBUSY;
320 if (atomic_read(&itv->decoding) > 0) { 325 if (test_and_clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags)) {
321 ivtv_vapi(itv, CX2341X_DEC_START_PLAYBACK, 2, 0, 0); 326 int speed = itv->speed;
327 itv->speed = 0;
328 return ivtv_start_decoding(id, speed);
322 } 329 }
323 break; 330 break;
324 331