[mythtv-commits] Ticket #3125: DVD player hangs if xvmc and UseXvMCForHDOnly is 1

MythTV mythtv at cvs.mythtv.org
Thu Feb 22 17:04:02 UTC 2007


#3125: DVD player hangs if xvmc and UseXvMCForHDOnly is 1
---------------------------+------------------------------------------------
 Reporter:  foom at fuhm.net  |       Owner:  ijr    
     Type:  defect         |      Status:  new    
 Priority:  minor          |   Milestone:  unknown
Component:  mythtv         |     Version:  head   
 Severity:  medium         |  
---------------------------+------------------------------------------------
 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.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3125>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list