$OpenBSD: patch-media_media_gyp,v 1.21 2013/07/15 14:59:30 robert Exp $
--- media/media.gyp.orig.port	Wed Jun 12 09:30:01 2013
+++ media/media.gyp	Sun Jul  7 15:54:58 2013
@@ -33,11 +33,15 @@
       }, {
         'use_alsa%': 0,
       }],
-      ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and chromeos != 1', {
+      ['os_posix == 1 and OS != "mac" and OS != "ios" 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,
+      }],
     ],
   },
   'targets': [
@@ -162,6 +166,8 @@
         'audio/pulse/audio_manager_pulse.h',
         'audio/pulse/pulse_output.cc',
         'audio/pulse/pulse_output.h',
+        'audio/sndio/sndio_output.cc',
+        'audio/sndio/sndio_output.h',
         'audio/pulse/pulse_input.cc',
         'audio/pulse/pulse_input.h',
         'audio/pulse/pulse_unified.cc',
@@ -612,6 +618,21 @@
             'webm/chromeos/ebml_writer.h',
             'webm/chromeos/webm_encoder.cc',
             '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', {
