comparison libmpdemux/tvi_v4l2.c @ 17626:5627625b0cdb

Don't test the v4l2_input audioset field for audio capabilities but still try changing the mute setting (patch by Jesse Allen < the3dfxdude _at_ gmail.com >)
author aurel
date Tue, 14 Feb 2006 20:13:55 +0000
parents 9164ef9a1834
children 7bf483eaa99a
comparison
equal deleted inserted replaced
17625:c5f33a8021c7 17626:5627625b0cdb
685 } 685 }
686 *(int *)arg = frequency.frequency; 686 *(int *)arg = frequency.frequency;
687 return TVI_CONTROL_TRUE; 687 return TVI_CONTROL_TRUE;
688 case TVI_CONTROL_TUN_SET_FREQ: 688 case TVI_CONTROL_TUN_SET_FREQ:
689 #if 0 689 #if 0
690 if (priv->input.audioset) { 690 set_mute(priv, 1);
691 set_mute(priv, 1); 691 usleep(100000); // wait to supress noise during switching
692 usleep(100000); // wait to supress noise during switching
693 }
694 #endif 692 #endif
695 frequency.tuner = 0; 693 frequency.tuner = 0;
696 frequency.type = V4L2_TUNER_ANALOG_TV; 694 frequency.type = V4L2_TUNER_ANALOG_TV;
697 frequency.frequency = *(int *)arg; 695 frequency.frequency = *(int *)arg;
698 if (ioctl(priv->video_fd, VIDIOC_S_FREQUENCY, &frequency) < 0) { 696 if (ioctl(priv->video_fd, VIDIOC_S_FREQUENCY, &frequency) < 0) {
699 mp_msg(MSGT_TV,MSGL_ERR,"%s: ioctl set frequency failed: %s\n", 697 mp_msg(MSGT_TV,MSGL_ERR,"%s: ioctl set frequency failed: %s\n",
700 info.short_name, strerror(errno)); 698 info.short_name, strerror(errno));
701 return TVI_CONTROL_FALSE; 699 return TVI_CONTROL_FALSE;
702 } 700 }
703 #if 0 701 #if 0
704 if (priv->input.audioset) { 702 usleep(100000); // wait to supress noise during switching
705 usleep(100000); // wait to supress noise during switching 703 set_mute(priv, 0);
706 set_mute(priv, 0);
707 }
708 #endif 704 #endif
709 return TVI_CONTROL_TRUE; 705 return TVI_CONTROL_TRUE;
710 case TVI_CONTROL_TUN_GET_TUNER: 706 case TVI_CONTROL_TUN_GET_TUNER:
711 mp_msg(MSGT_TV, MSGL_V, "%s: get tuner\n",info.short_name); 707 mp_msg(MSGT_TV, MSGL_V, "%s: get tuner\n",info.short_name);
712 if (ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) { 708 if (ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) {
899 pthread_join(priv->audio_grabber_thread, NULL); 895 pthread_join(priv->audio_grabber_thread, NULL);
900 pthread_mutex_destroy(&priv->skew_mutex); 896 pthread_mutex_destroy(&priv->skew_mutex);
901 pthread_mutex_destroy(&priv->audio_mutex); 897 pthread_mutex_destroy(&priv->audio_mutex);
902 } 898 }
903 899
904 if (priv->input.audioset) { 900 set_mute(priv, 1);
905 set_mute(priv, 1);
906 }
907 901
908 /* free memory and close device */ 902 /* free memory and close device */
909 free(priv->map); priv->map = NULL; 903 free(priv->map); priv->map = NULL;
910 priv->mapcount = 0; 904 priv->mapcount = 0;
911 if(priv->video_fd!=-1)close(priv->video_fd); priv->video_fd = -1; 905 if(priv->video_fd!=-1)close(priv->video_fd); priv->video_fd = -1;
1310 priv->audio_skew_measure_time = 0; 1304 priv->audio_skew_measure_time = 0;
1311 priv->first_frame = 0; 1305 priv->first_frame = 0;
1312 priv->audio_skew = 0; 1306 priv->audio_skew = 0;
1313 priv->first = 1; 1307 priv->first = 1;
1314 1308
1315 if (priv->input.audioset) { 1309 set_mute(priv, 0);
1316 set_mute(priv, 0);
1317 }
1318 1310
1319 return 1; 1311 return 1;
1320 } 1312 }
1321 1313
1322 1314