Commit 1c02d96f authored by Baptiste Coudurier's avatar Baptiste Coudurier

long -> int

Originally committed as revision 8774 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9e40addd
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
*/ */
typedef struct MOV_sample_to_chunk_tbl { typedef struct MOV_sample_to_chunk_tbl {
long first; int first;
long count; int count;
long id; int id;
} MOV_sample_to_chunk_tbl; } MOV_sample_to_chunk_tbl;
typedef struct { typedef struct {
...@@ -92,7 +92,7 @@ struct MOVParseTableEntry; ...@@ -92,7 +92,7 @@ struct MOVParseTableEntry;
typedef struct MOVStreamContext { typedef struct MOVStreamContext {
int ffindex; /* the ffmpeg stream id */ int ffindex; /* the ffmpeg stream id */
long next_chunk; int next_chunk;
unsigned int chunk_count; unsigned int chunk_count;
int64_t *chunk_offsets; int64_t *chunk_offsets;
unsigned int stts_count; unsigned int stts_count;
...@@ -106,12 +106,12 @@ typedef struct MOVStreamContext { ...@@ -106,12 +106,12 @@ typedef struct MOVStreamContext {
int sample_to_ctime_sample; int sample_to_ctime_sample;
unsigned int sample_size; unsigned int sample_size;
unsigned int sample_count; unsigned int sample_count;
long *sample_sizes; int *sample_sizes;
unsigned int keyframe_count; unsigned int keyframe_count;
long *keyframes; int *keyframes;
int time_scale; int time_scale;
int time_rate; int time_rate;
long current_sample; int current_sample;
unsigned int bytes_per_frame; unsigned int bytes_per_frame;
unsigned int samples_per_frame; unsigned int samples_per_frame;
int dv_audio_container; int dv_audio_container;
...@@ -229,7 +229,7 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -229,7 +229,7 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
ctype = get_le32(pb); ctype = get_le32(pb);
type = get_le32(pb); /* component subtype */ type = get_le32(pb); /* component subtype */
dprintf(c->fc, "ctype= %c%c%c%c (0x%08lx)\n", *((char *)&ctype), ((char *)&ctype)[1], ((char *)&ctype)[2], ((char *)&ctype)[3], (long) ctype); dprintf(c->fc, "ctype= %c%c%c%c (0x%08x)\n", *((char *)&ctype), ((char *)&ctype)[1], ((char *)&ctype)[2], ((char *)&ctype)[3], (int) ctype);
dprintf(c->fc, "stype= %c%c%c%c\n", *((char *)&type), ((char *)&type)[1], ((char *)&type)[2], ((char *)&type)[3]); dprintf(c->fc, "stype= %c%c%c%c\n", *((char *)&type), ((char *)&type)[1], ((char *)&type)[2], ((char *)&type)[3]);
if(!ctype) if(!ctype)
c->isom = 1; c->isom = 1;
...@@ -897,20 +897,20 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -897,20 +897,20 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
entries = get_be32(pb); entries = get_be32(pb);
if(entries >= UINT_MAX / sizeof(long)) if(entries >= UINT_MAX / sizeof(int))
return -1; return -1;
sc->keyframe_count = entries; sc->keyframe_count = entries;
#ifdef DEBUG #ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "keyframe_count = %d\n", sc->keyframe_count); av_log(NULL, AV_LOG_DEBUG, "keyframe_count = %d\n", sc->keyframe_count);
#endif #endif
sc->keyframes = av_malloc(entries * sizeof(long)); sc->keyframes = av_malloc(entries * sizeof(int));
if (!sc->keyframes) if (!sc->keyframes)
return -1; return -1;
for(i=0; i<entries; i++) { for(i=0; i<entries; i++) {
sc->keyframes[i] = get_be32(pb); sc->keyframes[i] = get_be32(pb);
#ifdef DEBUG #ifdef DEBUG
/* av_log(NULL, AV_LOG_DEBUG, "keyframes[]=%ld\n", sc->keyframes[i]); */ /* av_log(NULL, AV_LOG_DEBUG, "keyframes[]=%d\n", sc->keyframes[i]); */
#endif #endif
} }
return 0; return 0;
...@@ -929,7 +929,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -929,7 +929,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
if (!sc->sample_size) /* do not overwrite value computed in stsd */ if (!sc->sample_size) /* do not overwrite value computed in stsd */
sc->sample_size = sample_size; sc->sample_size = sample_size;
entries = get_be32(pb); entries = get_be32(pb);
if(entries >= UINT_MAX / sizeof(long)) if(entries >= UINT_MAX / sizeof(int))
return -1; return -1;
sc->sample_count = entries; sc->sample_count = entries;
...@@ -939,13 +939,13 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -939,13 +939,13 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
#ifdef DEBUG #ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "sample_size = %d sample_count = %d\n", sc->sample_size, sc->sample_count); av_log(NULL, AV_LOG_DEBUG, "sample_size = %d sample_count = %d\n", sc->sample_size, sc->sample_count);
#endif #endif
sc->sample_sizes = av_malloc(entries * sizeof(long)); sc->sample_sizes = av_malloc(entries * sizeof(int));
if (!sc->sample_sizes) if (!sc->sample_sizes)
return -1; return -1;
for(i=0; i<entries; i++) { for(i=0; i<entries; i++) {
sc->sample_sizes[i] = get_be32(pb); sc->sample_sizes[i] = get_be32(pb);
#ifdef DEBUG #ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%ld\n", sc->sample_sizes[i]); av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%d\n", sc->sample_sizes[i]);
#endif #endif
} }
return 0; return 0;
...@@ -1473,7 +1473,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -1473,7 +1473,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample]; AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample];
int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale); int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale);
dprintf(s, "stream %d, sample %ld, dts %"PRId64"\n", i, msc->current_sample, dts); dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
if (dts < best_dts) { if (dts < best_dts) {
sample = current_sample; sample = current_sample;
best_dts = dts; best_dts = dts;
...@@ -1536,7 +1536,7 @@ static int mov_seek_stream(AVStream *st, int64_t timestamp, int flags) ...@@ -1536,7 +1536,7 @@ static int mov_seek_stream(AVStream *st, int64_t timestamp, int flags)
if (sample < 0) /* not sure what to do */ if (sample < 0) /* not sure what to do */
return -1; return -1;
sc->current_sample = sample; sc->current_sample = sample;
dprintf(st->codec, "stream %d, found sample %ld\n", st->index, sc->current_sample); dprintf(st->codec, "stream %d, found sample %d\n", st->index, sc->current_sample);
/* adjust ctts index */ /* adjust ctts index */
if (sc->ctts_data) { if (sc->ctts_data) {
time_sample = 0; time_sample = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment