[PATCH] vlc: port to FFmpeg-0.8 API

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Sun Sep 4 00:14:45 CEST 2011


Attached.

-- 
Fedora http://fedoraproject.org/wiki/User:Rathann
RPMFusion http://rpmfusion.org | MPlayer http://mplayerhq.hu
"Faith manages."
        -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
-------------- next part --------------
diff -up vlc-1.1.11/modules/stream_out/switcher.c.ffmpeg vlc-1.1.11/modules/stream_out/switcher.c
--- vlc-1.1.11/modules/stream_out/switcher.c.ffmpeg	2010-04-13 02:22:27.000000000 +0200
+++ vlc-1.1.11/modules/stream_out/switcher.c	2011-08-25 18:07:43.000000000 +0200
@@ -360,6 +360,7 @@ static sout_stream_id_t *Add( sout_strea
         /* Set CPU capabilities */
         unsigned i_cpu = vlc_CPU();
         id->ff_enc_c->dsp_mask = 0;
+#if FF_API_MM_FLAGS
         if( !(i_cpu & CPU_CAPABILITY_MMX) )
         {
             id->ff_enc_c->dsp_mask |= FF_MM_MMX;
@@ -377,7 +378,25 @@ static sout_stream_id_t *Add( sout_strea
             id->ff_enc_c->dsp_mask |= FF_MM_SSE;
             id->ff_enc_c->dsp_mask |= FF_MM_SSE2;
         }
-
+#else
+        if( !(i_cpu & CPU_CAPABILITY_MMX) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_SSE) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
+        }
+#endif
         id->ff_enc_c->sample_rate = p_fmt->audio.i_rate;
         id->ff_enc_c->channels    = p_fmt->audio.i_channels;
         id->ff_enc_c->bit_rate    = p_fmt->i_bitrate;
@@ -749,6 +768,7 @@ static mtime_t VideoCommand( sout_stream
         /* Set CPU capabilities */
         unsigned i_cpu = vlc_CPU();
         id->ff_enc_c->dsp_mask = 0;
+#if FF_API_MM_FLAGS
         if( !(i_cpu & CPU_CAPABILITY_MMX) )
         {
             id->ff_enc_c->dsp_mask |= FF_MM_MMX;
@@ -766,6 +786,25 @@ static mtime_t VideoCommand( sout_stream
             id->ff_enc_c->dsp_mask |= FF_MM_SSE;
             id->ff_enc_c->dsp_mask |= FF_MM_SSE2;
         }
+#else
+        if( !(i_cpu & CPU_CAPABILITY_MMX) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_SSE) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
+        }
+#endif
 
         id->ff_enc_c->width = p_sys->p_pictures[p_sys->i_cmd-1].format.i_width;
         id->ff_enc_c->height = p_sys->p_pictures[p_sys->i_cmd-1].format.i_height;


More information about the rpmfusion-developers mailing list