Ticket #1842: cn400-mythtv-vid.patch
File cn400-mythtv-vid.patch, 4.2 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/util-opengl.cpp
67 67 { 68 68 int ret, errbase, eventbase, gl_major, gl_minor; 69 69 70 // this crashes my Unichrome-based system if it is run more than once. 71 static bool has_run = false; 72 static int static_major = 0; 73 static int static_minor = 0; 74 static int static_ret = false; 75 76 if( has_run ) 77 { 78 major = static_major; 79 minor = static_minor; 80 return static_ret; 81 } 82 70 83 major = minor = 0; 84 has_run = true; 71 85 72 86 X11S(ret = glXQueryExtension(XJ_disp, &errbase, &eventbase)); 73 87 if (!ret) … … 86 100 if (!ret) 87 101 return false; 88 102 89 major = gl_major; 90 minor = gl_minor; 103 static_major = major = gl_major; 104 static_minor = minor = gl_minor; 105 static_ret = true; 91 106 92 107 return true; 93 108 } -
libs/libmythtv/videoout_xv.cpp
1756 1756 if (!xvmc_ctx) 1757 1757 return false; 1758 1758 1759 bool createBlocks = !(XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD)); 1760 xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), createBlocks); 1759 bool surface_has_vld = (XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD)); 1760 xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), 1761 surface_has_vld); 1761 1762 if (xvmc_surfs.size() < xvmc_buf_attr->GetMinSurf()) 1762 1763 { 1763 1764 VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to create XvMC Surfaces"); … … 1787 1788 } 1788 1789 xvmc_osd_lock.unlock(); 1789 1790 1790 1791 1791 X11S(XSync(XJ_disp, False)); 1792 1792 1793 1793 return true; … … 1796 1796 #endif // USING_XVMC 1797 1797 } 1798 1798 1799 vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool create_xvmc_blocks)1799 vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool surface_has_vld) 1800 1800 { 1801 1801 (void)num; 1802 (void) create_xvmc_blocks;1802 (void)surface_has_vld; 1803 1803 1804 1804 vector<void*> surfaces; 1805 1805 #ifdef USING_XVMC … … 1808 1808 ((video_dim.height() + 15) / 16)); 1809 1809 uint num_data_blocks = num_mv_blocks * blocks_per_macroblock; 1810 1810 1811 // need the equivalent of 5 extra surfaces for VLD decoding 1812 if( surface_has_vld ) 1813 num += 5; 1814 1811 1815 // create needed XvMC stuff 1812 1816 bool ok = true; 1813 1817 for (uint i = 0; i < num; i++) … … 1820 1824 int ret = XvMCCreateSurface(XJ_disp, xvmc_ctx, &(surf->surface)); 1821 1825 ok &= (Success == ret); 1822 1826 1823 if ( create_xvmc_blocks && ok)1827 if (ok && !surface_has_vld) 1824 1828 { 1825 1829 ret = XvMCCreateBlocks(XJ_disp, xvmc_ctx, num_data_blocks, 1826 1830 &(surf->blocks)); … … 1831 1835 } 1832 1836 } 1833 1837 1834 if ( create_xvmc_blocks && ok)1838 if (ok && !surface_has_vld) 1835 1839 { 1836 1840 ret = XvMCCreateMacroBlocks(XJ_disp, xvmc_ctx, num_mv_blocks, 1837 1841 &(surf->macro_blocks)); … … 1852 1856 } 1853 1857 surfaces.push_back(surf); 1854 1858 } 1859 1860 // for VLD decoding: the last 5 surfaces were allocated just to make 1861 // sure we had enough space. now, deallocate/destroy them. 1862 1863 if( surface_has_vld ) 1864 { 1865 VERBOSE(VB_PLAYBACK, 1866 LOC + QString("VLD - Allocated %1 surfaces, now destroying 5 of them.").arg(surfaces.size())); 1867 1868 for( uint i = 0; i < 5; i++ ) 1869 { 1870 xvmc_vo_surf_t *surf = (xvmc_vo_surf_t*)surfaces.back(); 1871 surfaces.pop_back(); 1872 XvMCDestroySurface(XJ_disp, &(surf->surface)); 1873 delete surf; 1874 } 1875 } 1876 1855 1877 #endif // USING_XVMC 1856 1878 return surfaces; 1857 1879 } … … 4192 4214 break; 4193 4215 4194 4216 case kCodec_MPEG1_VLD: 4195 vld = true;4217 mc = vld = true; 4196 4218 ret = CODEC_ID_MPEG2VIDEO_XVMC_VLD; 4197 4219 break; 4198 4220 case kCodec_MPEG2_VLD: 4199 vld = true;4221 mc = vld = true; 4200 4222 ret = CODEC_ID_MPEG2VIDEO_XVMC_VLD; 4201 4223 break; 4202 4224 case kCodec_H263_VLD: