shithub: aacdec

Download patch

ref: e8a21effe6c52cb0d3c4789acf68d81c5c6b3964
parent: 00ca67bc570551e0ad5a5af6c23c8a2637deb17f
author: menno <menno>
date: Sat Aug 2 18:34:46 EDT 2003

downmixing option in in_mp4

--- a/plugins/in_mp4/config.c
+++ b/plugins/in_mp4/config.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: config.c,v 1.3 2003/07/29 08:20:14 menno Exp $
+** $Id: config.c,v 1.4 2003/08/02 22:34:46 menno Exp $
 **/
 
 #define WIN32_LEAN_AND_MEAN
@@ -35,6 +35,7 @@
 int m_resolution = 0;
 int m_show_errors = 1;
 int m_use_for_aac = 1;
+int m_downmix = 0;
 
 void _r_s(char *name,char *data, int mlen)
 {
--- a/plugins/in_mp4/config.h
+++ b/plugins/in_mp4/config.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: config.h,v 1.3 2003/07/29 08:20:14 menno Exp $
+** $Id: config.h,v 1.4 2003/08/02 22:34:46 menno Exp $
 **/
 
 char app_name[];
@@ -31,6 +31,7 @@
 int m_resolution;
 int m_show_errors;
 int m_use_for_aac;
+int m_downmix;
 
 #define RS(x) (_r_s(#x,x,sizeof(x)))
 #define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: in_mp4.c,v 1.35 2003/07/29 08:20:14 menno Exp $
+** $Id: in_mp4.c,v 1.36 2003/08/02 22:34:46 menno Exp $
 **/
 
 //#define DEBUG_OUTPUT
@@ -168,6 +168,7 @@
     char resolution[10];
     char show_errors[10];
     char use_for_aac[10];
+    char downmix[10];
 
     config_init();
 
@@ -175,16 +176,19 @@
     strcpy(priority, "3");
     strcpy(resolution, "0");
     strcpy(use_for_aac, "1");
+    strcpy(downmix, "0");
 
     RS(priority);
     RS(resolution);
     RS(show_errors);
     RS(use_for_aac);
+    RS(downmix);
 
     m_priority = atoi(priority);
     m_resolution = atoi(resolution);
     m_show_errors = atoi(show_errors);
     m_use_for_aac = atoi(use_for_aac);
+    m_downmix = atoi(downmix);
 }
 
 void config_write()
@@ -193,16 +197,19 @@
     char resolution[10];
     char show_errors[10];
     char use_for_aac[10];
+    char downmix[10];
 
     itoa(m_priority, priority, 10);
     itoa(m_resolution, resolution, 10);
     itoa(m_show_errors, show_errors, 10);
     itoa(m_use_for_aac, use_for_aac, 10);
+    itoa(m_downmix, downmix, 10);
 
     WS(priority);
     WS(resolution);
     WS(show_errors);
     WS(use_for_aac);
+    WS(downmix);
 }
 
 void init()
@@ -537,6 +544,8 @@
             SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_SETCHECK, BST_CHECKED, 0);
         if (m_use_for_aac)
             SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_SETCHECK, BST_CHECKED, 0);
+        if (m_downmix)
+            SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_SETCHECK, BST_CHECKED, 0);
         return TRUE;
 
     case WM_COMMAND:
@@ -547,6 +556,7 @@
         case IDOK:
             m_show_errors = SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_GETCHECK, 0, 0);
             m_use_for_aac = SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_GETCHECK, 0, 0);
+            m_downmix = SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_GETCHECK, 0, 0);
             m_priority = SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_GETPOS, 0, 0);
             for (i = 0; i < 6; i++)
             {
@@ -587,7 +597,7 @@
     MessageBox(hwndParent,
         "AudioCoding.com MPEG-4 General Audio player " FAAD2_VERSION " compiled on " __DATE__ ".\n"
         "Visit the website for more info.\n"
-        "Copyright 2002 AudioCoding.com",
+        "Copyright 2002-2003 AudioCoding.com",
         "About",
         MB_OK);
 }
@@ -748,6 +758,7 @@
 
     config = faacDecGetCurrentConfiguration(mp4state.hDecoder);
     config->outputFormat = m_resolution + 1;
+    config->downMatrix = m_downmix;
     faacDecSetConfiguration(mp4state.hDecoder, config);
 
     if (mp4state.filetype)
@@ -911,6 +922,9 @@
             MP4Close(mp4state.mp4file);
         return -1;
     }
+
+    if (m_downmix && (mp4state.channels == 5 || mp4state.channels == 6))
+        mp4state.channels = 2;
 
     maxlatency = module.outMod->Open(mp4state.samplerate, (int)mp4state.channels,
         res_table[m_resolution], -1, -1);
--- a/plugins/in_mp4/in_mp4.rc
+++ b/plugins/in_mp4/in_mp4.rc
@@ -94,7 +94,7 @@
     LTEXT           "of",IDC_STATIC11,257,127,8,14,SS_CENTERIMAGE
 END
 
-IDD_CONFIG DIALOG DISCARDABLE  0, 0, 151, 108
+IDD_CONFIG DIALOG DISCARDABLE  0, 0, 233, 95
 STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Configuration"
 FONT 8, "MS Sans Serif"
@@ -109,12 +109,14 @@
                     37,10
     CONTROL         "32 bits",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51,
                     37,10
-    CONTROL         "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,7,70,53,10
+    CONTROL         "Downmix to stereo",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,152,13,74,10
     CONTROL         "Use for AAC",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,78,70,55,10
-    PUSHBUTTON      "Cancel",IDCANCEL,7,87,50,14
-    DEFPUSHBUTTON   "OK",IDOK,94,87,50,14
+                    WS_TABSTOP,152,27,55,10
+    CONTROL         "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,152,41,53,10
+    DEFPUSHBUTTON   "OK",IDOK,122,74,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,61,74,50,14
     GROUPBOX        "Priority",IDC_STATIC,7,7,57,58
     LTEXT           "Highest",IDC_STATIC,34,18,25,8
     LTEXT           "Normal",IDC_STATIC,34,35,23,8
@@ -142,9 +144,9 @@
     IDD_CONFIG, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 144
+        RIGHTMARGIN, 226
         TOPMARGIN, 7
-        BOTTOMMARGIN, 101
+        BOTTOMMARGIN, 88
     END
 END
 #endif    // APSTUDIO_INVOKED
--- a/plugins/in_mp4/resource.h
+++ b/plugins/in_mp4/resource.h
@@ -52,6 +52,7 @@
 #define IDC_STATIC10                    1034
 #define IDC_STATIC11                    1035
 #define IDC_STATIC12                    1036
+#define IDC_DOWNMIX                     1038
 
 // Next default values for new objects
 // 
@@ -59,7 +60,7 @@
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        103
 #define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1038
+#define _APS_NEXT_CONTROL_VALUE         1039
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif