diff options
| author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2008-12-11 01:37:12 (GMT) |
|---|---|---|
| committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2008-12-11 01:37:12 (GMT) |
| commit | 54e39512d743caf5afe2f587536135c450ea4fcf (patch) | |
| tree | 22e7ba4ba242782064d36d7a3828b01800436d38 /abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch | |
| parent | 8417e5e3b118ed9e12563a3d4fceeb38b9e73d4f (diff) | |
| parent | 42129857874c470c65d3b1dcb4bf42945a98dcfa (diff) | |
| download | linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.zip linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.tar.gz linhes_pkgbuild-54e39512d743caf5afe2f587536135c450ea4fcf.tar.bz2 | |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Conflicts:
abs/core-testing/LinHES-config/LinHES-release
Diffstat (limited to 'abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch')
| -rw-r--r-- | abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch new file mode 100644 index 0000000..3535310 --- /dev/null +++ b/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch @@ -0,0 +1,139 @@ +Index: libs/libmythtv/v4lchannel.h +=================================================================== +--- libs/libmythtv/v4lchannel.h (revision 18874) ++++ libs/libmythtv/v4lchannel.h (working copy) +@@ -103,6 +103,8 @@ + VidModV4L2 videomode_v4l2; ///< Current video mode if 'usingv4l2' is true + + int defaultFreqTable; ++ int prev_inputNumV4L; ++ v4l2_std_id prev_vid_mode; + }; + + #endif +Index: libs/libmythtv/v4lchannel.cpp +=================================================================== +--- libs/libmythtv/v4lchannel.cpp (revision 18874) ++++ libs/libmythtv/v4lchannel.cpp (working copy) +@@ -40,7 +40,8 @@ + device_name(QString::null), driver_name(QString::null), + curList(NULL), totalChannels(0), + currentFormat(""), is_dtv(false), +- usingv4l2(false), defaultFreqTable(1) ++ usingv4l2(false), defaultFreqTable(1), ++ prev_inputNumV4L(-1), prev_vid_mode(-1) + { + } + +@@ -795,62 +796,75 @@ + { + VERBOSE(VB_CHANNEL, LOC + msg + "(v4l v2)"); + +- int ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L); ++ int ioctlval; ++ bool streamingDisabled = false; ++ int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE; + +- // ConvertX (wis-go7007) requires streaming to be disabled +- // before an input switch, do this if initial switch failed. +- bool streamingDisabled = false; +- int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE; +- if ((ioctlval < 0) && (errno == EBUSY)) ++ if (prev_inputNumV4L != inputNumV4L) + { +- ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType); ++ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L); ++ ++ // ConvertX (wis-go7007) requires streaming to be disabled ++ // before an input switch, do this if initial switch failed. ++ if ((ioctlval < 0) && (errno == EBUSY)) ++ { ++ ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType); ++ if (ioctlval < 0) ++ { ++ VERBOSE(VB_IMPORTANT, LOC_ERR + msg + ++ "\n\t\t\twhile disabling streaming (v4l v2)" + ENO); ++ ++ ok = false; ++ ioctlval = 0; ++ } ++ else ++ { ++ streamingDisabled = true; ++ ++ // Resend the input switch ioctl. ++ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L); ++ } ++ } ++ + if (ioctlval < 0) + { + VERBOSE(VB_IMPORTANT, LOC_ERR + msg + +- "\n\t\t\twhile disabling streaming (v4l v2)" + ENO); ++ "\n\t\t\twhile setting input (v4l v2)" + ENO); + + ok = false; +- ioctlval = 0; + } +- else +- { +- streamingDisabled = true; + +- // Resend the input switch ioctl. +- ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L); +- } ++ prev_inputNumV4L = inputNumV4L; + } + +- if (ioctlval < 0) +- { +- VERBOSE(VB_IMPORTANT, LOC_ERR + msg + +- "\n\t\t\twhile setting input (v4l v2)" + ENO); +- +- ok = false; +- } +- + v4l2_std_id vid_mode = format_to_mode(newFmt, 2); +- ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode); +- if (ioctlval < 0) +- { +- VERBOSE(VB_IMPORTANT, LOC_ERR + msg + +- "\n\t\t\twhile setting format (v4l v2)" + ENO); + +- ok = false; +- } +- +- // ConvertX (wis-go7007) requires streaming to be disabled +- // before an input switch, here we try to re-enable streaming. +- if (streamingDisabled) ++ if (prev_vid_mode != vid_mode) + { +- ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType); ++ ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode); + if (ioctlval < 0) + { + VERBOSE(VB_IMPORTANT, LOC_ERR + msg + +- "\n\t\t\twhile reenabling streaming (v4l v2)" + ENO); ++ "\n\t\t\twhile setting format (v4l v2)" + ENO); + + ok = false; + } ++ ++ // ConvertX (wis-go7007) requires streaming to be disabled ++ // before an input switch, here we try to re-enable streaming. ++ if (streamingDisabled) ++ { ++ ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType); ++ if (ioctlval < 0) ++ { ++ VERBOSE(VB_IMPORTANT, LOC_ERR + msg + ++ "\n\t\t\twhile reenabling streaming (v4l v2)" + ++ ENO); ++ ++ ok = false; ++ } ++ } ++ prev_vid_mode = vid_mode; + } + } + |
