ref: 0bb1af0581fd67b41814b9f6e01daad76b328bda
parent: 779598b7a137b8eefaae16af0a3e97c66bd8d26e
author: menno <menno>
date: Fri Nov 21 14:02:03 EST 2003
Now even gapless can work again
--- a/common/mp4ff/mp4atom.c
+++ b/common/mp4ff/mp4atom.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: mp4atom.c,v 1.2 2003/11/21 18:20:56 menno Exp $
+** $Id: mp4atom.c,v 1.3 2003/11/21 19:02:02 menno Exp $
**/
#include <stdlib.h>
@@ -345,8 +345,8 @@
{
int32_t i;
- /* version */ mp4ff_read_char(f);
- /* flags */ mp4ff_read_int24(f);
+ mp4ff_read_char(f); /* version */
+ mp4ff_read_int24(f); /* flags */
f->track[f->total_tracks - 1]->stts_entry_count = mp4ff_read_int32(f);
f->track[f->total_tracks - 1]->stts_sample_count = (int32_t*)malloc(f->track[f->total_tracks - 1]->stts_entry_count * sizeof(int32_t));
--- a/common/mp4ff/mp4ff.c
+++ b/common/mp4ff/mp4ff.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: mp4ff.c,v 1.2 2003/11/21 15:08:48 menno Exp $
+** $Id: mp4ff.c,v 1.3 2003/11/21 19:02:02 menno Exp $
**/
#include <stdlib.h>
@@ -233,7 +233,7 @@
int32_t mp4ff_time_scale(mp4ff_t *f, int32_t track)
{
- return f->time_scale;
+ return f->track[track]->sampleRate;
}
int32_t mp4ff_num_samples(mp4ff_t *f, int32_t track)
--- a/common/mp4ff/mp4ff.h
+++ b/common/mp4ff/mp4ff.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: mp4ff.h,v 1.5 2003/11/21 18:20:57 menno Exp $
+** $Id: mp4ff.h,v 1.6 2003/11/21 19:02:02 menno Exp $
**/
#ifndef MP4FF_H
@@ -111,7 +111,7 @@
int32_t type;
int32_t channelCount;
int32_t sampleSize;
- int32_t sampleRate;
+ uint16_t sampleRate;
/* stsd */
int32_t stsd_entry_count;
@@ -172,10 +172,10 @@
/* mp4util.c */
int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, int32_t size);
-int32_t mp4ff_read_int32(mp4ff_t *f);
-int32_t mp4ff_read_int24(mp4ff_t *f);
-int16_t mp4ff_read_int16(mp4ff_t *f);
-int8_t mp4ff_read_char(mp4ff_t *f);
+uint32_t mp4ff_read_int32(mp4ff_t *f);
+uint32_t mp4ff_read_int24(mp4ff_t *f);
+uint16_t mp4ff_read_int16(mp4ff_t *f);
+uint8_t mp4ff_read_char(mp4ff_t *f);
uint32_t mp4ff_read_mp4_descr_length(mp4ff_t *f);
int32_t mp4ff_position(mp4ff_t *f);
int32_t mp4ff_set_position(mp4ff_t *f, int32_t position);
--- a/common/mp4ff/mp4util.c
+++ b/common/mp4ff/mp4util.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: mp4util.c,v 1.1 2003/11/21 15:08:48 menno Exp $
+** $Id: mp4util.c,v 1.2 2003/11/21 19:02:03 menno Exp $
**/
#include "mp4ff.h"
@@ -51,7 +51,7 @@
return f->current_position;
}
-int32_t mp4ff_read_int32(mp4ff_t *f)
+uint32_t mp4ff_read_int32(mp4ff_t *f)
{
uint32_t result;
uint32_t a, b, c, d;
@@ -64,10 +64,10 @@
d = (uint8_t)data[3];
result = (a<<24) | (b<<16) | (c<<8) | d;
- return (int32_t)result;
+ return (uint32_t)result;
}
-int32_t mp4ff_read_int24(mp4ff_t *f)
+uint32_t mp4ff_read_int24(mp4ff_t *f)
{
uint32_t result;
uint32_t a, b, c;
@@ -79,10 +79,10 @@
c = (uint8_t)data[2];
result = (a<<16) | (b<<8) | c;
- return (int32_t)result;
+ return (uint32_t)result;
}
-int16_t mp4ff_read_int16(mp4ff_t *f)
+uint16_t mp4ff_read_int16(mp4ff_t *f)
{
uint32_t result;
uint32_t a, b;
@@ -93,12 +93,12 @@
b = (uint8_t)data[1];
result = (a<<8) | b;
- return (int16_t)result;
+ return (uint16_t)result;
}
-int8_t mp4ff_read_char(mp4ff_t *f)
+uint8_t mp4ff_read_char(mp4ff_t *f)
{
- int8_t output;
+ uint8_t output;
mp4ff_read_data(f, &output, 1);
return output;
}
--- a/frontend/main.c
+++ b/frontend/main.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: main.c,v 1.62 2003/11/21 18:20:57 menno Exp $
+** $Id: main.c,v 1.63 2003/11/21 19:02:03 menno Exp $
**/
#ifdef _WIN32
@@ -832,6 +832,7 @@
buffer_size = 0;
dur = mp4ff_get_sample_duration(infile, track, sampleId);
+ printf("%d\n", dur);
rc = mp4ff_read_sample(infile, track, sampleId, &buffer, &buffer_size);
if (rc == 0)
{