shithub: aacdec

Download patch

ref: 49179daaf56a9ddde3ce1ab82c37ce5e83b5fa87
parent: 4ec9a8f39dbd88813601b448ec07849bac4caa6b
author: menno <menno>
date: Wed Jul 9 14:32:43 EDT 2003

fixed bug with mp4info

--- a/common/mp4v2/mp4file.cpp
+++ b/common/mp4v2/mp4file.cpp
@@ -551,7 +551,7 @@
 	fclose(m_pFile);
 	m_pFile = NULL;
 #else
-	m_MP4fclose(this);
+	m_MP4fclose(m_userData);
 #endif
 }
 
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: main.c,v 1.41 2003/07/09 15:11:25 menno Exp $
+** $Id: main.c,v 1.42 2003/07/09 18:32:42 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -570,7 +570,6 @@
                   int outputFormat, int fileType, int downMatrix, int infoOnly)
 {
     int track;
-    unsigned int tracks;
     unsigned long samplerate;
     unsigned char channels;
     void *sample_buffer;
@@ -609,23 +608,10 @@
     }
 
     /* print some mp4 file info */
-    tracks = MP4GetNumberOfTracks(infile, NULL, 0);
-    if (tracks > 0)
     {
-        char *file_info;
-        unsigned int i;
-
-        fprintf(stderr, "%s file info:\n", mp4file);
-        for (i = 0; i < tracks; i++)
-        {
-            file_info = MP4Info(infile, i+1);
-            if (file_info)
-            {
-                fprintf(stderr, "Track: %s", file_info);
-                free(file_info);
-            }
-        }
-        fprintf(stderr, "\n");
+        char *file_info = MP4Info(infile, MP4_INVALID_TRACK_ID);
+        fprintf(stderr, "%s", file_info);
+        free(file_info);
     }
 
     if (infoOnly)
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: in_mp4.c,v 1.33 2003/07/02 15:12:01 menno Exp $
+** $Id: in_mp4.c,v 1.34 2003/07/09 18:32:43 menno Exp $
 **/
 
 //#define DEBUG_OUTPUT
@@ -211,8 +211,8 @@
 BOOL CALLBACK mp4_info_dialog_proc(HWND hwndDlg, UINT message,
                                    WPARAM wParam, LPARAM lParam)
 {
+    char *file_info;
     MP4FileHandle file;
-    int tracks, i;
 
 #ifdef DEBUG_OUTPUT
     in_mp4_DebugOutput("mp4_info_dialog_proc");
@@ -232,24 +232,9 @@
         if (!file)
             return FALSE;
 
-        tracks = MP4GetNumberOfTracks(file, NULL, 0);
-
-        if (tracks == 0)
-        {
-            SetDlgItemText(hwndDlg, IDC_INFOTEXT, "No tracks found");
-        } else {
-            char *file_info;
-            char *info_text = malloc(1024*sizeof(char));
-            info_text[0] = '\0';
-
-            for (i = 0; i < tracks; i++)
-            {
-                file_info = MP4Info(file, i+1);
-                lstrcat(info_text, file_info);
-            }
-            SetDlgItemText(hwndDlg, IDC_INFOTEXT, info_text);
-            free(info_text);
-        }
+        file_info = MP4Info(file, MP4_INVALID_TRACK_ID);
+        SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info);
+        free(file_info);
 
         MP4Close(file);