Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

smplayer2-enable-vdpau-support.patch

By: a guest on Nov 11th, 2011  |  syntax: Diff  |  size: 6.28 KB  |  views: 50  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -Naur old/smplayer2/src/core.cpp new/smplayer2/src/core.cpp
  2. --- old/smplayer2/src/core.cpp  2011-11-11 02:44:55.000000000 +0200
  3. +++ new/smplayer2/src/core.cpp  2011-11-11 15:01:54.179798609 +0200
  4. @@ -1270,6 +1270,19 @@
  5.                 proc->addArgument("-vc");
  6.                 proc->addArgument(mset.forced_video_codec);
  7.         }
  8. +#ifndef Q_OS_WIN
  9. +       else {
  10. +               if (pref->vo.startsWith("vdpau")) {
  11. +                       proc->addArgument("-vc");
  12. +                       if (pref->disable_vdpau_divx_decoder)
  13. +                               proc->addArgument("ffh264vdpau,ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,");
  14. +                       else
  15. +                               proc->addArgument("ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,");
  16. +               }
  17. +#endif
  18. +#ifndef Q_OS_WIN
  19. +       }
  20. +#endif
  21.  
  22.         if (pref->use_hwac3) {
  23.                 proc->addArgument("-afm");
  24. diff -Naur old/smplayer2/src/preferences.cpp new/smplayer2/src/preferences.cpp
  25. --- old/smplayer2/src/preferences.cpp   2011-11-11 02:44:55.000000000 +0200
  26. +++ new/smplayer2/src/preferences.cpp   2011-11-11 15:04:36.199805637 +0200
  27. @@ -97,6 +97,7 @@
  28.  
  29.  #ifndef Q_OS_WIN
  30.         disable_video_filters_with_vdpau = true;
  31. +       disable_vdpau_divx_decoder = true;
  32.  #endif
  33.  
  34.         use_soft_vol = true;
  35. @@ -469,6 +470,7 @@
  36.  
  37.  #ifndef Q_OS_WIN
  38.         set->setValue("disable_video_filters_with_vdpau", disable_video_filters_with_vdpau);
  39. +       set->setValue("disable_vdpau_divx_decoder", disable_vdpau_divx_decoder);
  40.  #endif
  41.  
  42.         set->setValue("use_soft_vol", use_soft_vol);
  43. @@ -853,6 +855,7 @@
  44.  
  45.  #ifndef Q_OS_WIN
  46.         disable_video_filters_with_vdpau = set->value("disable_video_filters_with_vdpau", disable_video_filters_with_vdpau).toBool();
  47. +       disable_vdpau_divx_decoder = set->value("disable_vdpau_divx_decoder", disable_vdpau_divx_decoder).toBool();
  48.  #endif
  49.  
  50.         use_soft_vol = set->value("use_soft_vol", use_soft_vol).toBool();
  51. diff -Naur old/smplayer2/src/preferences.h new/smplayer2/src/preferences.h
  52. --- old/smplayer2/src/preferences.h     2011-11-11 02:44:55.000000000 +0200
  53. +++ new/smplayer2/src/preferences.h     2011-11-11 15:05:13.516473922 +0200
  54. @@ -98,6 +98,7 @@
  55.  
  56.  #ifndef Q_OS_WIN
  57.         bool disable_video_filters_with_vdpau;
  58. +       bool disable_vdpau_divx_decoder;
  59.  #endif
  60.  
  61.         // Audio
  62. diff -Naur old/smplayer2/src/prefgeneral.cpp new/smplayer2/src/prefgeneral.cpp
  63. --- old/smplayer2/src/prefgeneral.cpp   2011-11-11 02:44:55.000000000 +0200
  64. +++ new/smplayer2/src/prefgeneral.cpp   2011-11-11 15:10:10.099820120 +0200
  65. @@ -198,6 +198,7 @@
  66.  
  67.  #ifndef Q_OS_WIN
  68.         setDisableFiltersWithVdpau( pref->disable_video_filters_with_vdpau );
  69. +       setDisableVdpauForDivx( pref->disable_vdpau_divx_decoder );
  70.  #endif
  71.  
  72.         setAudioChannels( pref->initial_audio_channels );
  73. @@ -281,6 +282,7 @@
  74.  
  75.  #ifndef Q_OS_WIN
  76.         TEST_AND_SET(pref->disable_video_filters_with_vdpau, disableFiltersWithVdpau());
  77. +       TEST_AND_SET(pref->disable_vdpau_divx_decoder, disableVdpauForDivx());
  78.  #endif
  79.  
  80.         pref->initial_audio_channels = audioChannels();
  81. @@ -740,6 +742,14 @@
  82.  bool PrefGeneral::disableFiltersWithVdpau() {
  83.         return vdpau_filters_check->isChecked();
  84.  }
  85. +
  86. +void PrefGeneral::setDisableVdpauForDivx(bool b) {
  87. +       vdpau_divx_check->setChecked(b);
  88. +}
  89. +
  90. +bool PrefGeneral::disableVdpauForDivx() {
  91. +       return vdpau_divx_check->isChecked();
  92. +}
  93.  #endif
  94.  
  95.  void PrefGeneral::setBlackbordersOnFullscreen(bool b) {
  96. @@ -846,9 +856,13 @@
  97.                 );
  98.  
  99.  #ifndef Q_OS_WIN
  100. -       setWhatsThis(vdpau_filters_check, tr("Disable video filters when using vdpau"),
  101. +       setWhatsThis(vdpau_filters_check, tr("Disable video filters with vdpau"),
  102.                 tr("Usually video filters won't work when using vdpau as video output "
  103.             "driver, so it's wise to keep this option checked.") );
  104. +
  105. +       setWhatsThis(vdpau_divx_check, tr("Disable vdpau for divx"),
  106. +               tr("Not all graphics cards support vdpau DivX/XViD decoding. Check this "
  107. +           "option, only if you are sure your card supports it.") );
  108.  #endif
  109.  
  110.         setWhatsThis(postprocessing_check, tr("Enable postprocessing by default"),
  111. diff -Naur old/smplayer2/src/prefgeneral.h new/smplayer2/src/prefgeneral.h
  112. --- old/smplayer2/src/prefgeneral.h     2011-11-11 02:44:55.000000000 +0200
  113. +++ new/smplayer2/src/prefgeneral.h     2011-11-11 15:10:49.989821850 +0200
  114. @@ -123,6 +123,9 @@
  115.  #ifndef Q_OS_WIN
  116.         void setDisableFiltersWithVdpau(bool b);
  117.         bool disableFiltersWithVdpau();
  118. +
  119. +       void setDisableVdpauForDivx(bool b);
  120. +       bool disableVdpauForDivx();
  121.  #endif
  122.  
  123.         void setBlackbordersOnFullscreen(bool b);
  124. diff -Naur old/smplayer2/src/prefgeneral.ui new/smplayer2/src/prefgeneral.ui
  125. --- old/smplayer2/src/prefgeneral.ui    2011-11-11 02:44:55.000000000 +0200
  126. +++ new/smplayer2/src/prefgeneral.ui    2011-11-11 15:19:21.336510696 +0200
  127. @@ -274,12 +274,42 @@
  128.          </layout>
  129.         </item>
  130.         <item>
  131. -        <widget class="QCheckBox" name="vdpau_filters_check" >
  132. -         <property name="text" >
  133. -          <string>Disable video filters when using vd&amp;pau</string>
  134. +        <layout class="QHBoxLayout" name="_2">
  135. +         <property name="spacing">
  136. +          <number>6</number>
  137. +          </property>
  138. +         <property name="margin">
  139. +          <number>0</number>
  140.           </property>
  141. -        </widget>
  142. -       </item>
  143. +         <item>
  144. +          <widget class="QCheckBox" name="vdpau_filters_check">
  145. +           <property name="text">
  146. +            <string>Disable video filters with vd&amp;pau</string>
  147. +           </property>
  148. +          </widget>
  149. +         </item>
  150. +         <item>
  151. +          <spacer>
  152. +           <property name="orientation">
  153. +            <enum>Qt::Horizontal</enum>
  154. +           </property>
  155. +           <property name="sizeHint" stdset="0">
  156. +            <size>
  157. +             <width>20</width>
  158. +             <height>20</height>
  159. +            </size>
  160. +           </property>
  161. +          </spacer>
  162. +         </item>
  163. +         <item>
  164. +          <widget class="QCheckBox" name="vdpau_divx_check">
  165. +           <property name="text">
  166. +            <string>Disable vdpau for div&amp;x</string>
  167. +           </property>
  168. +          </widget>
  169. +         </item>
  170. +        </layout>
  171. +        </item>
  172.         <item>
  173.          <widget class="Line" name="line_5" >
  174.           <property name="sizePolicy" >
  175. @@ -1279,6 +1309,7 @@
  176.    <tabstop>vo_combo</tabstop>
  177.    <tabstop>vo_user_defined_edit</tabstop>
  178.    <tabstop>vdpau_filters_check</tabstop>
  179. +  <tabstop>vdpau_divx_check</tabstop>
  180.    <tabstop>postprocessing_check</tabstop>
  181.    <tabstop>autoq_spin</tabstop>
  182.    <tabstop>deinterlace_combo</tabstop>
  183.  
  184.