changeset 36966:ef9dea4785bc

Detect audio AC3/DTS pass-through S/PDIF.
author ib
date Tue, 25 Mar 2014 12:25:09 +0000
parents 5fb43d5efdca
children ed7aac796e22
files gui/interface.c gui/interface.h gui/ui/actions.c gui/win32/interface.c
diffstat 4 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Tue Mar 25 00:15:02 2014 +0000
+++ b/gui/interface.c	Tue Mar 25 12:25:09 2014 +0000
@@ -48,6 +48,7 @@
 #include "input/input.h"
 #include "libaf/equalizer.h"
 #include "libavutil/common.h"
+#include "libmpcodecs/ad.h"
 #include "libmpcodecs/dec_audio.h"
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/vd.h"
@@ -328,6 +329,7 @@
     int idata = (intptr_t)data, msg, state;
     stream_t *stream = NULL;
     sh_audio_t *sh_audio;
+    const ad_functions_t *ad;
     mixer_t *mixer;
     float l, r, b;
     plItem *next = NULL;
@@ -702,6 +704,9 @@
 
         sh_audio = data;
 
+        ad = sh_audio->ad_driver;
+        guiInfo.AudioPassthrough = (gstrcmp(ad->info->short_name, "hwac3") == 0);
+
         guiInfo.AudioChannels = sh_audio ? sh_audio->channels : 0;
 
         if (guiInfo.AudioChannels < 2)
--- a/gui/interface.h	Tue Mar 25 00:15:02 2014 +0000
+++ b/gui/interface.h	Tue Mar 25 12:25:09 2014 +0000
@@ -108,6 +108,8 @@
     int StreamType;
     int AudioChannels;
 
+    int AudioPassthrough;
+
     int AudioStreams;
     stream_language_t AudioStream[32];
 
--- a/gui/ui/actions.c	Tue Mar 25 00:15:02 2014 +0000
+++ b/gui/ui/actions.c	Tue Mar 25 12:25:09 2014 +0000
@@ -707,6 +707,7 @@
     guiInfo.VideoWidth    = 0;
     guiInfo.VideoHeight   = 0;
     guiInfo.AudioChannels = 0;
+    guiInfo.AudioPassthrough = False;
     guiInfo.RunningTime   = 0;
 
     if (totals) {
--- a/gui/win32/interface.c	Tue Mar 25 00:15:02 2014 +0000
+++ b/gui/win32/interface.c	Tue Mar 25 12:25:09 2014 +0000
@@ -60,6 +60,7 @@
 #include "libvo/video_out.h"
 #include "libao2/audio_out.h"
 #include "access_mpcontext.h"
+#include "libmpcodecs/ad.h"
 #include "libmpcodecs/vd.h"
 #include "libmpcodecs/dec_audio.h"
 #include "gui/ui/actions.h"
@@ -561,6 +562,7 @@
     int idata = (intptr_t) data;
     stream_t *stream;
     sh_audio_t *sh_audio;
+    const ad_functions_t *ad;
 #ifdef CONFIG_DVDREAD
     dvd_priv_t *dvdp;
 #endif
@@ -623,6 +625,8 @@
         case GUI_SET_AUDIO:
         {
             sh_audio = data;
+            ad = sh_audio->ad_driver;
+            guiInfo.AudioPassthrough = (gstrcmp(ad->info->short_name, "hwac3") == 0);
             guiInfo.AudioChannels = sh_audio ? sh_audio->channels : 0;
             if (sh_audio && !guiInfo.sh_video) guiInfo.VideoWindow = FALSE;
             if(IsWindowVisible(mygui->videowindow) && !guiInfo.VideoWindow)
@@ -793,6 +797,7 @@
           guiInfo.ElapsedTime = 0;
           guiInfo.Position = 0;
           guiInfo.AudioChannels = 0;
+          guiInfo.AudioPassthrough = FALSE;
 
           guiInfo.Track = 1;
           guiInfo.Chapter = 1;