Improve mov atom parsing debug message, print parent atom and size in decimal

Originally committed as revision 23764 to svn://svn.ffmpeg.org/ffmpeg/trunk
oldabi
Baptiste Coudurier 15 years ago
parent 27d8806986
commit 3491866a4b
  1. 10
      libavformat/mov.c

@ -266,8 +266,8 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
a.type = get_le32(pb);
}
total_size += 8;
dprintf(c->fc, "type: %08x %.4s sz: %"PRIx64" %"PRIx64" %"PRIx64"\n",
a.type, (char*)&a.type, a.size, atom.size, total_size);
dprintf(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
if (a.size == 1) { /* 64 bit extended size */
a.size = get_be64(pb) - 8;
total_size += 8;
@ -960,7 +960,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
//Parsing Sample description table
enum CodecID id;
int dref_id = 1;
MOVAtom a = { 0 };
MOVAtom a = { AV_RL32("stsd") };
int64_t start_pos = url_ftell(pb);
int size = get_be32(pb); /* size */
uint32_t format = get_le32(pb); /* data format */
@ -2366,7 +2366,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
MOVContext *mov = s->priv_data;
ByteIOContext *pb = s->pb;
int err;
MOVAtom atom = { 0 };
MOVAtom atom = { AV_RL32("root") };
mov->fc = s;
/* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
@ -2430,7 +2430,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!sample) {
mov->found_mdat = 0;
if (!url_is_streamed(s->pb) ||
mov_read_default(mov, s->pb, (MOVAtom){ 0, INT64_MAX }) < 0 ||
mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
url_feof(s->pb))
return AVERROR_EOF;
dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));

Loading…
Cancel
Save