$OpenBSD: patch-media_media_gyp,v 1.29 2014/07/20 17:22:34 robert Exp $
--- media/media.gyp.orig.port	Tue Jul 15 13:02:23 2014
+++ media/media.gyp	Thu Jul 17 12:25:31 2014
@@ -22,7 +22,7 @@
         'media_use_libvpx%': 1,
       }],
       # Enable ALSA and Pulse for runtime selection.
-      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1', {
+      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1 and os_bsd != 1', {
         # ALSA is always needed for Web MIDI even if the cras is enabled.
         'use_alsa%': 1,
         'conditions': [
@@ -31,6 +31,10 @@
           }, {
             'use_pulseaudio%': 1,
           }],
+      # Override to dynamically link the sndio library.
+      ['OS=="openbsd"', {
+        'use_sndioaudio%': 0,
+      }],
         ],
       }, {
         'use_alsa%': 0,
@@ -164,6 +168,8 @@
         'audio/pulse/pulse_input.h',
         'audio/pulse/pulse_output.cc',
         'audio/pulse/pulse_output.h',
+        'audio/sndio/sndio_output.cc',
+        'audio/sndio/sndio_output.h',
         'audio/pulse/pulse_util.cc',
         'audio/pulse/pulse_util.h',
         'audio/sample_rates.cc',
@@ -637,6 +643,24 @@
             'formats/webm/chromeos/webm_encoder.h',
           ],
         }],
+        ['use_sndio == 1', {
+          'link_settings': {
+            'libraries': [
+              '-lsndio',
+            ],
+          },
+          'defines': [
+            'USE_SNDIO',
+          ],
+          'sources!': [
+            'audio/linux/audio_manager_linux.cc',
+          ],
+        }, {  # else: use_sndio == 0
+          'sources!': [
+            'audio/sndio/sndio_output.cc',
+            'audio/sndio/sndio_output.h',
+          ],
+        }],
         ['use_alsa==1', {
           'link_settings': {
             'libraries': [
@@ -658,7 +682,7 @@
             'audio/openbsd/audio_manager_openbsd.h',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="openbsd"', {
           'conditions': [
             ['use_x11==1', {
               'dependencies': [
@@ -917,7 +941,7 @@
             'base/simd/convert_yuv_to_rgb_x86.cc',
           ],
         }],
-        ['OS!="linux" and OS!="win"', {
+        ['OS!="linux" and OS!="win" and OS!="openbsd"', {
           'sources!': [
             'base/keyboard_event_counter.cc',
             'base/keyboard_event_counter.h',
@@ -1110,7 +1134,7 @@
             'USE_PULSEAUDIO',
           ],
         }],
-        ['os_posix==1 and OS!="mac"', {
+        ['os_posix==1 and OS!="mac" and OS!="openbsd"', {
           'conditions': [
             ['use_allocator!="none"', {
               'dependencies': [
@@ -1704,7 +1728,7 @@
             'filters/pipeline_integration_test_base.cc',
           ],
           'conditions': [
-            ['os_posix==1 and OS!="mac"', {
+            ['os_posix==1 and OS!="mac" and OS!="openbsd"', {
               'conditions': [
                 ['use_allocator!="none"', {
                   'dependencies': [
