aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-10-14 16:19:37 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-22 10:01:48 -0400
commit254d6eb1159f7398273fe35e7499f905a903f38d (patch)
treef6e360743df13cffc3498524eb26657e2b90bf65
parent195b1252517d504391d29f71b789d4c1c9f605e0 (diff)
V4L/DVB (6347): ivtv: fix video mute when radio is used
When the radio is active the video should be muted when a capture starts. However, this was done at the wrong time and the mute settings were overwritten when cx2341x_update was called. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index 6c954b36ee88..aa03e61ef310 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -441,6 +441,7 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
441{ 441{
442 u32 data[CX2341X_MBOX_MAX_DATA]; 442 u32 data[CX2341X_MBOX_MAX_DATA];
443 struct ivtv *itv = s->itv; 443 struct ivtv *itv = s->itv;
444 struct cx2341x_mpeg_params *p = &itv->params;
444 int captype = 0, subtype = 0; 445 int captype = 0, subtype = 0;
445 int enable_passthrough = 0; 446 int enable_passthrough = 0;
446 447
@@ -461,7 +462,7 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
461 } 462 }
462 itv->mpg_data_received = itv->vbi_data_inserted = 0; 463 itv->mpg_data_received = itv->vbi_data_inserted = 0;
463 itv->dualwatch_jiffies = jiffies; 464 itv->dualwatch_jiffies = jiffies;
464 itv->dualwatch_stereo_mode = itv->params.audio_properties & 0x0300; 465 itv->dualwatch_stereo_mode = p->audio_properties & 0x0300;
465 itv->search_pack_header = 0; 466 itv->search_pack_header = 0;
466 break; 467 break;
467 468
@@ -493,10 +494,6 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
493 s->subtype = subtype; 494 s->subtype = subtype;
494 s->buffers_stolen = 0; 495 s->buffers_stolen = 0;
495 496
496 /* mute/unmute video */
497 ivtv_vapi(itv, CX2341X_ENC_MUTE_VIDEO, 1,
498 test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ? 0x00808001 : 0);
499
500 /* Clear Streamoff flags in case left from last capture */ 497 /* Clear Streamoff flags in case left from last capture */
501 clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags); 498 clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
502 499
@@ -553,7 +550,12 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
553 itv->pgm_info_offset, itv->pgm_info_num); 550 itv->pgm_info_offset, itv->pgm_info_num);
554 551
555 /* Setup API for Stream */ 552 /* Setup API for Stream */
556 cx2341x_update(itv, ivtv_api_func, NULL, &itv->params); 553 cx2341x_update(itv, ivtv_api_func, NULL, p);
554
555 /* mute if capturing radio */
556 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags))
557 ivtv_vapi(itv, CX2341X_ENC_MUTE_VIDEO, 1,
558 1 | (p->video_mute_yuv << 8));
557 } 559 }
558 560
559 /* Vsync Setup */ 561 /* Vsync Setup */
@@ -602,6 +604,7 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s)
602{ 604{
603 u32 data[CX2341X_MBOX_MAX_DATA]; 605 u32 data[CX2341X_MBOX_MAX_DATA];
604 struct ivtv *itv = s->itv; 606 struct ivtv *itv = s->itv;
607 struct cx2341x_mpeg_params *p = &itv->params;
605 int datatype; 608 int datatype;
606 609
607 if (s->v4l2dev == NULL) 610 if (s->v4l2dev == NULL)
@@ -640,7 +643,7 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s)
640 break; 643 break;
641 } 644 }
642 if (ivtv_vapi(itv, CX2341X_DEC_SET_DECODER_SOURCE, 4, datatype, 645 if (ivtv_vapi(itv, CX2341X_DEC_SET_DECODER_SOURCE, 4, datatype,
643 itv->params.width, itv->params.height, itv->params.audio_properties)) { 646 p->width, p->height, p->audio_properties)) {
644 IVTV_DEBUG_WARN("Couldn't initialize decoder source\n"); 647 IVTV_DEBUG_WARN("Couldn't initialize decoder source\n");
645 } 648 }
646 return 0; 649 return 0;