$OpenBSD: patch-media_media_gyp,v 1.25 2014/01/18 11:42:04 robert Exp $
--- media/media.gyp.orig.port	Mon Jan 13 21:59:40 2014
+++ media/media.gyp	Thu Jan 16 12:26:42 2014
@@ -27,11 +27,15 @@
       }, {
         'use_alsa%': 0,
       }],
-      ['os_posix==1 and OS!="mac" and OS!="android" and chromeos!=1', {
+      ['os_posix==1 and OS!="mac" and OS!="android" and chromeos!=1 and os_bsd != 1', {
         'use_pulseaudio%': 1,
       }, {
         'use_pulseaudio%': 0,
       }],
+      # Override to dynamically link the sndio library.
+      ['OS=="openbsd"', {
+        'use_sndioaudio%': 0,
+      }],
     ],
   },
   'includes': [
@@ -155,6 +159,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_unified.cc',
         'audio/pulse/pulse_unified.h',
         'audio/pulse/pulse_util.cc',
@@ -551,6 +557,21 @@
             'webm/chromeos/webm_encoder.h',
           ],
         }],
+        ['use_sndio == 1', {
+          'link_settings': {
+            'libraries': [
+              '-lsndio',
+            ],
+          },
+          'defines': [
+            'USE_SNDIO',
+          ],
+        }, {  # else: use_sndio == 0
+          'sources!': [
+            'audio/sndio/sndio_output.cc',
+            'audio/sndio/sndio_output.h',
+          ],
+        }],
         ['use_alsa==1', {
           'link_settings': {
             'libraries': [
@@ -567,7 +588,7 @@
             'audio/openbsd/audio_manager_openbsd.h',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="openbsd"', {
           'variables': {
             'conditions': [
               ['sysroot!=""', {
@@ -832,7 +853,7 @@
             'ENABLE_EAC3_PLAYBACK',
           ],
         }],
-        ['OS!="linux" and OS!="win"', {
+        ['OS!="linux" and OS!="win" and OS!="openbsd"', {
           'sources!': [
             'base/keyboard_event_counter.cc',
             'base/keyboard_event_counter.h',
