Commit 3491866a authored by Baptiste Coudurier's avatar Baptiste Coudurier

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