Ticket #2238: mythtv_v4l1-compat_mute_fix.diff

File mythtv_v4l1-compat_mute_fix.diff, 1.1 KB (added by devel@…, 15 years ago)

Patch to fix mute logic for cards using v4l1-compat layer

  • libs/libmythtv/NuppelVideoRecorder.cpp

     
    10541054        perror("VIDIOCGCHAN");
    10551055
    10561056    // if channel has a audio then activate it
    1057     if (!skip_btaudio && (vchan.flags & VIDEO_VC_AUDIO) == VIDEO_VC_AUDIO) {
    1058         if (ioctl(fd, VIDIOCGAUDIO, &va)<0)
    1059             perror("VIDIOCGAUDIO");
     1057    // if (!skip_btaudio && (vchan.flags & VIDEO_VC_AUDIO) == VIDEO_VC_AUDIO) {
     1058    //v4l1 compat does not set VIDEO_VC_AUDIO so above will fail (eg. on saa7134).
     1059    if (!skip_btaudio && ioctl(fd, VIDIOCGAUDIO, &va) >= 0) {
    10601060
    10611061        va.flags &= ~VIDEO_AUDIO_MUTE; // now this really has to work
    10621062
     
    10641064
    10651065        if (ioctl(fd, VIDIOCSAUDIO, &va) < 0)
    10661066            perror("VIDIOCSAUDIO");
     1067
    10671068        //if (ioctl(fd, VIDIOCSCHAN, &vchan) < 0)
    10681069        //    perror("VIDIOCSCHAN");
     1070    } else {
     1071        perror("VIDIOCGAUDIO");
    10691072    }
    10701073
    10711074    if ((vc.type & VID_TYPE_MJPEG_ENCODER) && hardware_encode)