Opened 17 years ago
Closed 17 years ago
#3125 closed defect (fixed)
DVD player hangs if xvmc and UseXvMCForHDOnly is 1
Reported by: | Owned by: | skamithi | |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
In avformatdecoder.cpp, if dvd_xvmc_enabled is true, but GetBestSupportedCodec? returns a non-xvmc codec, the dvd code will continuously think that the codec should be changed to enable xvmc, which will never happen.
This is because of this code (summarized) on line 2805:
if (dvd_xvmc_enabled) if ((indvdmenu && dvd_xvmc_active) || ((!indvdmenu && !dvd_xvmc_active))) { dvd_video_codec_changed = true;
Thus, it tries to reinitialize the codec every time it tries to get a new frame, and gets stuck on a blank screen. The attached patch appears to fix it, by turning off dvd_xvmc_enabled when xvmc doesn't actually manage to get turned on. (it also removes the redundant force_xv check from the first if clause: GetBestVideoCodec? won't return one of those codecs if force_xv).
Index: avformatdecoder.cpp =================================================================== --- avformatdecoder.cpp (revision 12786) +++ avformatdecoder.cpp (working copy) @@ -1338,11 +1338,13 @@ bool vcd, idct, mc; enc->codec_id = myth2av_codecid(mcid, vcd, idct, mc); video_codec_id = mcid; - if (!force_xv && kCodec_NORMAL_END < mcid && kCodec_STD_XVMC_END > mcid) + if (kCodec_NORMAL_END < mcid && kCodec_STD_XVMC_END > mcid) { enc->pix_fmt = (idct) ? PIX_FMT_XVMC_MPEG2_IDCT : PIX_FMT_XVMC_MPEG2_MC; - } + } else if(!force_xv) + // if we wanted an xvmc codec but didn't get one, don't try to get one again. + dvd_xvmc_enabled = false; } else {
BTW, the name "dvd_xvmc_enabled" is quite misleading. My first attempt to fix the problem was to simply set it to false always, but that also disabled xvmc in normal playback.
Attachments (3)
Change History (11)
comment:1 Changed 17 years ago by
Owner: | changed from Isaac Richards to skamithi |
---|
Changed 17 years ago by
Attachment: | fix_for_ticket_3125.diff added |
---|
comment:2 Changed 17 years ago by
Status: | new → assigned |
---|
comment:3 Changed 17 years ago by
Seems like that would work, but I thought it would be better to address it on the other side, just in case there are other possible reasons why GetBestVideoCodec? might not return an XVMC codec, even when one was requested.
comment:4 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 Changed 17 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Changed 17 years ago by
Attachment: | disable_dvd_xvmc_if_codec_change_fails.diff added |
---|
disable xvmc for dvd if codec check fails, like the ticket submitter stated. i have a pc with intel graphics card. xvmc compiles but it doesn't support it. so it was a good pc to test out this code.
Changed 17 years ago by
Attachment: | disable_dvd_xvmc_if_codec_change_fails_svn.diff added |
---|
patch against svn trunk. previous patch against mythtv-vid.
comment:6 Changed 17 years ago by
comment:8 Changed 17 years ago by
Milestone: | unknown → 0.21 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
disable attempt to try and activate xvmc if UseXvmcForHDOnly is enabled. in the mythtv-vid branch, this type of fix is not needed cause video profiles better addresses this issue. So this is a workaround til mythtv-vid branch is merged back to svn.