cosmectics, use consistant and homogeneous type names for atoms
Originally committed as revision 8828 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f8c18cd711
commit
e23848a49c
@ -32,9 +32,9 @@ extern const AVCodecTag codec_movaudio_tags[];
|
|||||||
int ff_mov_iso639_to_lang(const char *lang, int mp4);
|
int ff_mov_iso639_to_lang(const char *lang, int mp4);
|
||||||
int ff_mov_lang_to_iso639(int code, char *to);
|
int ff_mov_lang_to_iso639(int code, char *to);
|
||||||
|
|
||||||
typedef struct Time2Sample{
|
typedef struct {
|
||||||
int count;
|
int count;
|
||||||
int duration;
|
int duration;
|
||||||
}Time2Sample;
|
} MOV_stts_t;
|
||||||
|
|
||||||
#endif /* FFMPEG_ISOM_H */
|
#endif /* FFMPEG_ISOM_H */
|
||||||
|
@ -63,11 +63,11 @@
|
|||||||
* Here we just use what is needed to read the chunks
|
* Here we just use what is needed to read the chunks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct MOV_sample_to_chunk_tbl {
|
typedef struct {
|
||||||
int first;
|
int first;
|
||||||
int count;
|
int count;
|
||||||
int id;
|
int id;
|
||||||
} MOV_sample_to_chunk_tbl;
|
} MOV_stsc_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
@ -75,10 +75,10 @@ typedef struct {
|
|||||||
int64_t size; /* total size (excluding the size and type fields) */
|
int64_t size; /* total size (excluding the size and type fields) */
|
||||||
} MOV_atom_t;
|
} MOV_atom_t;
|
||||||
|
|
||||||
typedef struct MOV_mdat_atom_s {
|
typedef struct {
|
||||||
offset_t offset;
|
offset_t offset;
|
||||||
int64_t size;
|
int64_t size;
|
||||||
} MOV_mdat_atom_t;
|
} MOV_mdat_t;
|
||||||
|
|
||||||
struct MOVParseTableEntry;
|
struct MOVParseTableEntry;
|
||||||
|
|
||||||
@ -88,12 +88,12 @@ typedef struct MOVStreamContext {
|
|||||||
unsigned int chunk_count;
|
unsigned int chunk_count;
|
||||||
int64_t *chunk_offsets;
|
int64_t *chunk_offsets;
|
||||||
unsigned int stts_count;
|
unsigned int stts_count;
|
||||||
Time2Sample *stts_data;
|
MOV_stts_t *stts_data;
|
||||||
unsigned int ctts_count;
|
unsigned int ctts_count;
|
||||||
Time2Sample *ctts_data;
|
MOV_stts_t *ctts_data;
|
||||||
unsigned int edit_count; /* number of 'edit' (elst atom) */
|
unsigned int edit_count; /* number of 'edit' (elst atom) */
|
||||||
unsigned int sample_to_chunk_sz;
|
unsigned int sample_to_chunk_sz;
|
||||||
MOV_sample_to_chunk_tbl *sample_to_chunk;
|
MOV_stsc_t *sample_to_chunk;
|
||||||
int sample_to_ctime_index;
|
int sample_to_ctime_index;
|
||||||
int sample_to_ctime_sample;
|
int sample_to_ctime_sample;
|
||||||
unsigned int sample_size;
|
unsigned int sample_size;
|
||||||
@ -123,7 +123,7 @@ typedef struct MOVContext {
|
|||||||
/* NOTE: for recursion save to/ restore from local variable! */
|
/* NOTE: for recursion save to/ restore from local variable! */
|
||||||
|
|
||||||
AVPaletteControl palette_control;
|
AVPaletteControl palette_control;
|
||||||
MOV_mdat_atom_t *mdat_list;
|
MOV_mdat_t *mdat_list;
|
||||||
int mdat_count;
|
int mdat_count;
|
||||||
DVDemuxContext *dv_demux;
|
DVDemuxContext *dv_demux;
|
||||||
AVFormatContext *dv_fctx;
|
AVFormatContext *dv_fctx;
|
||||||
@ -860,13 +860,13 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
|||||||
|
|
||||||
entries = get_be32(pb);
|
entries = get_be32(pb);
|
||||||
|
|
||||||
if(entries >= UINT_MAX / sizeof(MOV_sample_to_chunk_tbl))
|
if(entries >= UINT_MAX / sizeof(MOV_stsc_t))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
|
dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
|
||||||
|
|
||||||
sc->sample_to_chunk_sz = entries;
|
sc->sample_to_chunk_sz = entries;
|
||||||
sc->sample_to_chunk = av_malloc(entries * sizeof(MOV_sample_to_chunk_tbl));
|
sc->sample_to_chunk = av_malloc(entries * sizeof(MOV_stsc_t));
|
||||||
if (!sc->sample_to_chunk)
|
if (!sc->sample_to_chunk)
|
||||||
return -1;
|
return -1;
|
||||||
for(i=0; i<entries; i++) {
|
for(i=0; i<entries; i++) {
|
||||||
@ -948,11 +948,11 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
|||||||
get_byte(pb); /* version */
|
get_byte(pb); /* version */
|
||||||
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
|
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
|
||||||
entries = get_be32(pb);
|
entries = get_be32(pb);
|
||||||
if(entries >= UINT_MAX / sizeof(Time2Sample))
|
if(entries >= UINT_MAX / sizeof(MOV_stts_t))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
sc->stts_count = entries;
|
sc->stts_count = entries;
|
||||||
sc->stts_data = av_malloc(entries * sizeof(Time2Sample));
|
sc->stts_data = av_malloc(entries * sizeof(MOV_stts_t));
|
||||||
|
|
||||||
dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
|
dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
|
||||||
|
|
||||||
@ -990,11 +990,11 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
|||||||
get_byte(pb); /* version */
|
get_byte(pb); /* version */
|
||||||
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
|
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
|
||||||
entries = get_be32(pb);
|
entries = get_be32(pb);
|
||||||
if(entries >= UINT_MAX / sizeof(Time2Sample))
|
if(entries >= UINT_MAX / sizeof(MOV_stts_t))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
sc->ctts_count = entries;
|
sc->ctts_count = entries;
|
||||||
sc->ctts_data = av_malloc(entries * sizeof(Time2Sample));
|
sc->ctts_data = av_malloc(entries * sizeof(MOV_stts_t));
|
||||||
|
|
||||||
dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
|
dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
|
||||||
|
|
||||||
|
@ -643,7 +643,7 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack* track)
|
|||||||
|
|
||||||
static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track)
|
static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track)
|
||||||
{
|
{
|
||||||
Time2Sample *ctts_entries;
|
MOV_stts_t *ctts_entries;
|
||||||
uint32_t entries = 0;
|
uint32_t entries = 0;
|
||||||
uint32_t atom_size;
|
uint32_t atom_size;
|
||||||
int i;
|
int i;
|
||||||
@ -677,7 +677,7 @@ static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track)
|
|||||||
/* Time to sample atom */
|
/* Time to sample atom */
|
||||||
static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack* track)
|
static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack* track)
|
||||||
{
|
{
|
||||||
Time2Sample *stts_entries;
|
MOV_stts_t *stts_entries;
|
||||||
uint32_t entries = -1;
|
uint32_t entries = -1;
|
||||||
uint32_t atom_size;
|
uint32_t atom_size;
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user