diff dvdnav.c @ 272:baec6f29fb76 src

added dvdnav_audio_stream_channels(); patch by Andreas Oman (andreas olebyn nu)
author nicodvb
date Wed, 11 Apr 2007 19:52:10 +0000
parents 77e472cef5f8
children bd734ab914d0
line wrap: on
line diff
--- a/dvdnav.c	Tue Apr 10 20:50:09 2007 +0000
+++ b/dvdnav.c	Wed Apr 11 19:52:10 2007 +0000
@@ -941,6 +941,26 @@
   return format;
 }
 
+uint16_t dvdnav_audio_stream_channels(dvdnav_t *this, uint8_t stream) {
+  audio_attr_t  attr;
+  uint16_t format;
+
+  if(!this) {
+    printerr("Passed a NULL pointer.");
+    return -1; /* 0xffff */
+  }
+  if(!this->started) {
+    printerr("Virtual DVD machine not started.");
+    return -1; /* 0xffff */
+  }
+
+  pthread_mutex_lock(&this->vm_lock);
+  attr = vm_get_audio_attr(this->vm, stream);
+  pthread_mutex_unlock(&this->vm_lock);
+
+  return attr.channels + 1;
+}
+
 uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *this, uint8_t stream) {
   subp_attr_t  attr;