Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Fix] Fixes dvdnav_audio_stream_format(...). Don't change the audio f…

…ormat numbers, e.g. DTS is 6 not 5, 5 is unknown.
  • Loading branch information...
commit 2e171e6221b7a2e21003e0b5b87d5444883bc400 1 parent e0e12a7
@ace20022 authored
View
23 lib/libdvd/libdvdnav/src/dvdnav.c
@@ -925,27 +925,10 @@ uint16_t dvdnav_audio_stream_format(dvdnav_t *this, uint8_t stream) {
attr = vm_get_audio_attr(this->vm, stream);
pthread_mutex_unlock(&this->vm_lock);
- switch(attr.audio_format) {
- case 0:
- format = DVDNAV_FORMAT_AC3;
- break;
- case 2: /* MPEG-1 or MPEG-2 without extension bitstream. */
- case 3: /* MPEG-2 with extension bitstream. */
- format = DVDNAV_FORMAT_MPEGAUDIO;
- break;
- case 4:
- format = DVDNAV_FORMAT_LPCM;
- break;
- case 6:
- format = DVDNAV_FORMAT_DTS;
- break;
- case 7:
- format = DVDNAV_FORMAT_SDDS;
- break;
- default:
+ if (attr.audio_format >=0 && attr.audio_format <= 7)
+ format = attr.audio_format;
+ else
format = 0xffff;
- break;
- }
return format;
}
View
6 lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h
@@ -63,12 +63,6 @@ typedef int32_t dvdnav_status_t;
#define DVDNAV_STATUS_ERR 0
#define DVDNAV_STATUS_OK 1
-#define DVDNAV_FORMAT_AC3 0
-#define DVDNAV_FORMAT_MPEGAUDIO 3
-#define DVDNAV_FORMAT_LPCM 4
-#define DVDNAV_FORMAT_DTS 5
-#define DVDNAV_FORMAT_SDDS 6
-
/*********************************************************************
* initialisation & housekeeping functions *
*********************************************************************/
View
33 lib/libdvd/patches/libdvdnav_correct_dvdnav_audio_stream_format.diff
@@ -0,0 +1,33 @@
+--- libdvdnav-4.2.0/src/dvdnav.c Wed Mar 20 11:38:53 2013
++++ lib/libdvd/libdvdnav/src/dvdnav.c Wed Mar 20 13:20:35 2013
+@@ -907,27 +925,10 @@
+ attr = vm_get_audio_attr(this->vm, stream);
+ pthread_mutex_unlock(&this->vm_lock);
+
+- switch(attr.audio_format) {
+- case 0:
+- format = DVDNAV_FORMAT_AC3;
+- break;
+- case 2: /* MPEG-1 or MPEG-2 without extension bitstream. */
+- case 3: /* MPEG-2 with extension bitstream. */
+- format = DVDNAV_FORMAT_MPEGAUDIO;
+- break;
+- case 4:
+- format = DVDNAV_FORMAT_LPCM;
+- break;
+- case 6:
+- format = DVDNAV_FORMAT_DTS;
+- break;
+- case 7:
+- format = DVDNAV_FORMAT_SDDS;
+- break;
+- default:
++ if (attr.audio_format >=0 && attr.audio_format <= 7)
++ format = attr.audio_format;
++ else
+ format = 0xffff;
+- break;
+- }
+
+ return format;
+ }
View
15 lib/libdvd/patches/libdvdnav_remove_unneeded_defines.diff
@@ -0,0 +1,15 @@
+--- libdvdnav-4.2.0/src/dvdnav/dvdnav.h Wed Mar 20 11:38:52 2013
++++ lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h Wed Mar 20 13:19:13 2013
+@@ -63,12 +63,6 @@
+ #define DVDNAV_STATUS_ERR 0
+ #define DVDNAV_STATUS_OK 1
+
+-#define DVDNAV_FORMAT_AC3 0
+-#define DVDNAV_FORMAT_MPEGAUDIO 3
+-#define DVDNAV_FORMAT_LPCM 4
+-#define DVDNAV_FORMAT_DTS 5
+-#define DVDNAV_FORMAT_SDDS 6
+-
+ /*********************************************************************
+ * initialisation & housekeeping functions *
+ *********************************************************************/
Please sign in to comment.
Something went wrong with that request. Please try again.