Revision 1c02d96f libavformat/mov.c

View differences:

libavformat/mov.c
72 72
 */
73 73

  
74 74
typedef struct MOV_sample_to_chunk_tbl {
75
    long first;
76
    long count;
77
    long id;
75
    int first;
76
    int count;
77
    int id;
78 78
} MOV_sample_to_chunk_tbl;
79 79

  
80 80
typedef struct {
......
92 92

  
93 93
typedef struct MOVStreamContext {
94 94
    int ffindex; /* the ffmpeg stream id */
95
    long next_chunk;
95
    int next_chunk;
96 96
    unsigned int chunk_count;
97 97
    int64_t *chunk_offsets;
98 98
    unsigned int stts_count;
......
106 106
    int sample_to_ctime_sample;
107 107
    unsigned int sample_size;
108 108
    unsigned int sample_count;
109
    long *sample_sizes;
109
    int *sample_sizes;
110 110
    unsigned int keyframe_count;
111
    long *keyframes;
111
    int *keyframes;
112 112
    int time_scale;
113 113
    int time_rate;
114
    long current_sample;
114
    int current_sample;
115 115
    unsigned int bytes_per_frame;
116 116
    unsigned int samples_per_frame;
117 117
    int dv_audio_container;
......
229 229
    ctype = get_le32(pb);
230 230
    type = get_le32(pb); /* component subtype */
231 231

  
232
    dprintf(c->fc, "ctype= %c%c%c%c (0x%08lx)\n", *((char *)&ctype), ((char *)&ctype)[1], ((char *)&ctype)[2], ((char *)&ctype)[3], (long) ctype);
232
    dprintf(c->fc, "ctype= %c%c%c%c (0x%08x)\n", *((char *)&ctype), ((char *)&ctype)[1], ((char *)&ctype)[2], ((char *)&ctype)[3], (int) ctype);
233 233
    dprintf(c->fc, "stype= %c%c%c%c\n", *((char *)&type), ((char *)&type)[1], ((char *)&type)[2], ((char *)&type)[3]);
234 234
    if(!ctype)
235 235
        c->isom = 1;
......
897 897

  
898 898
    entries = get_be32(pb);
899 899

  
900
    if(entries >= UINT_MAX / sizeof(long))
900
    if(entries >= UINT_MAX / sizeof(int))
901 901
        return -1;
902 902

  
903 903
    sc->keyframe_count = entries;
904 904
#ifdef DEBUG
905 905
    av_log(NULL, AV_LOG_DEBUG, "keyframe_count = %d\n", sc->keyframe_count);
906 906
#endif
907
    sc->keyframes = av_malloc(entries * sizeof(long));
907
    sc->keyframes = av_malloc(entries * sizeof(int));
908 908
    if (!sc->keyframes)
909 909
        return -1;
910 910
    for(i=0; i<entries; i++) {
911 911
        sc->keyframes[i] = get_be32(pb);
912 912
#ifdef DEBUG
913
/*        av_log(NULL, AV_LOG_DEBUG, "keyframes[]=%ld\n", sc->keyframes[i]); */
913
/*        av_log(NULL, AV_LOG_DEBUG, "keyframes[]=%d\n", sc->keyframes[i]); */
914 914
#endif
915 915
    }
916 916
    return 0;
......
929 929
    if (!sc->sample_size) /* do not overwrite value computed in stsd */
930 930
        sc->sample_size = sample_size;
931 931
    entries = get_be32(pb);
932
    if(entries >= UINT_MAX / sizeof(long))
932
    if(entries >= UINT_MAX / sizeof(int))
933 933
        return -1;
934 934

  
935 935
    sc->sample_count = entries;
......
939 939
#ifdef DEBUG
940 940
    av_log(NULL, AV_LOG_DEBUG, "sample_size = %d sample_count = %d\n", sc->sample_size, sc->sample_count);
941 941
#endif
942
    sc->sample_sizes = av_malloc(entries * sizeof(long));
942
    sc->sample_sizes = av_malloc(entries * sizeof(int));
943 943
    if (!sc->sample_sizes)
944 944
        return -1;
945 945
    for(i=0; i<entries; i++) {
946 946
        sc->sample_sizes[i] = get_be32(pb);
947 947
#ifdef DEBUG
948
        av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%ld\n", sc->sample_sizes[i]);
948
        av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%d\n", sc->sample_sizes[i]);
949 949
#endif
950 950
    }
951 951
    return 0;
......
1473 1473
            AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample];
1474 1474
            int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale);
1475 1475

  
1476
            dprintf(s, "stream %d, sample %ld, dts %"PRId64"\n", i, msc->current_sample, dts);
1476
            dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
1477 1477
            if (dts < best_dts) {
1478 1478
                sample = current_sample;
1479 1479
                best_dts = dts;
......
1536 1536
    if (sample < 0) /* not sure what to do */
1537 1537
        return -1;
1538 1538
    sc->current_sample = sample;
1539
    dprintf(st->codec, "stream %d, found sample %ld\n", st->index, sc->current_sample);
1539
    dprintf(st->codec, "stream %d, found sample %d\n", st->index, sc->current_sample);
1540 1540
    /* adjust ctts index */
1541 1541
    if (sc->ctts_data) {
1542 1542
        time_sample = 0;

Also available in: Unified diff