$OpenBSD: patch-media_media_gyp,v 1.11 2016/05/28 14:49:39 robert Exp $
--- media/media.gyp.orig.port	Wed May 25 21:01:03 2016
+++ media/media.gyp	Thu May 26 08:09:47 2016
@@ -13,7 +13,7 @@
     'linux_link_pulseaudio%': 0,
     'conditions': [
       # Enable ALSA and Pulse for runtime selection.
-      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and (embedded==0 or chromecast==1)', {
+      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and (embedded==0 or chromecast==1) and os_bsd!=1', {
         # ALSA is always needed for Web MIDI even if the cras is enabled.
         'use_alsa%': 1,
         'conditions': [
@@ -27,6 +27,10 @@
         'use_alsa%': 0,
         'use_pulseaudio%': 0,
       }],
+      # Override to dynamically link the sndio library.
+      ['OS=="openbsd"', {
+        'use_sndioaudio%': 0,
+      }],
       # low memory buffer is used in non-Android based chromecast build due to hardware limitation.
       ['chromecast==1 and OS!="android"', {
         'use_low_memory_buffer%': 1,
@@ -191,6 +195,8 @@
         'audio/mac/audio_manager_mac.h',
         'audio/null_audio_sink.cc',
         'audio/null_audio_sink.h',
+        'audio/openbsd/audio_manager_openbsd.cc',
+        'audio/openbsd/audio_manager_openbsd.h',
         'audio/pulse/audio_manager_pulse.cc',
         'audio/pulse/audio_manager_pulse.h',
         'audio/pulse/pulse_input.cc',
@@ -199,6 +205,10 @@
         'audio/pulse/pulse_output.h',
         'audio/pulse/pulse_util.cc',
         'audio/pulse/pulse_util.h',
+        'audio/sndio/sndio_input.cc',
+        'audio/sndio/sndio_input.h',
+        'audio/sndio/sndio_output.cc',
+        'audio/sndio/sndio_output.h',
         'audio/sample_rates.cc',
         'audio/sample_rates.h',
         'audio/scoped_task_runner_observer.cc',
@@ -745,6 +755,24 @@
             'filters/h264_bitstream_buffer.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': [
@@ -760,7 +788,7 @@
             ['exclude', '_alsa\\.(h|cc)$'],
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or os_bsd==1', {
           'conditions': [
             ['use_x11==1', {
               'dependencies': [
@@ -812,7 +840,7 @@
             }],
           ],
         }],
-        ['OS!="linux"', {
+        ['OS!="linux" and os_bsd!=1', {
           'sources!': [
             'audio/cras/audio_manager_cras.cc',
             'audio/cras/audio_manager_cras.h',
@@ -1059,7 +1087,7 @@
             'base/simd/filter_yuv_sse2.cc',
           ],
         }],
-        ['OS!="linux" and OS!="win"', {
+        ['OS!="linux" and OS!="win" and os_bsd!=1', {
           'sources!': [
             'base/keyboard_event_counter.cc',
             'base/keyboard_event_counter.h',
