[DVDnav-discuss] r862 - in trunk/libdvdnav/src: dvdnav.c dvdnav.h

nicodvb subversion at mplayerhq.hu
Wed Apr 11 21:52:11 CEST 2007


Author: nicodvb
Date: Wed Apr 11 21:52:10 2007
New Revision: 862

Modified:
   trunk/libdvdnav/src/dvdnav.c
   trunk/libdvdnav/src/dvdnav.h

Log:
added dvdnav_audio_stream_channels(); patch by Andreas Oman (andreas olebyn nu)

Modified: trunk/libdvdnav/src/dvdnav.c
==============================================================================
--- trunk/libdvdnav/src/dvdnav.c	(original)
+++ trunk/libdvdnav/src/dvdnav.c	Wed Apr 11 21:52:10 2007
@@ -941,6 +941,26 @@ uint16_t dvdnav_audio_stream_format(dvdn
   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;
   

Modified: trunk/libdvdnav/src/dvdnav.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav.h	(original)
+++ trunk/libdvdnav/src/dvdnav.h	Wed Apr 11 21:52:10 2007
@@ -567,6 +567,12 @@ uint16_t dvdnav_audio_stream_to_lang(dvd
 uint16_t dvdnav_audio_stream_format(dvdnav_t *self, uint8_t stream);
 
 /*
+ * Returns number of channelsn in *logical* audio stream 'stream'
+ * (returns 0xffff if no such stream).
+ */
+uint16_t dvdnav_audio_stream_channels(dvdnav_t *self, uint8_t stream);
+
+/*
  * Converts a *logical* subpicture stream id into country code 
  * (returns 0xffff if no such stream).
  */



More information about the DVDnav-discuss mailing list