Commit d276d9be authored by bcoudurier's avatar bcoudurier

use dprintf with AVFormatContext and simplify

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8827 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e1d7161d
...@@ -401,9 +401,9 @@ static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -401,9 +401,9 @@ static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
get_be32(pb); /* modification time */ get_be32(pb); /* modification time */
} }
c->time_scale = get_be32(pb); /* time scale */ c->time_scale = get_be32(pb); /* time scale */
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "time scale = %i\n", c->time_scale); dprintf(c->fc, "time scale = %i\n", c->time_scale);
#endif
c->duration = (version == 1) ? get_be64(pb) : get_be32(pb); /* duration */ c->duration = (version == 1) ? get_be64(pb) : get_be32(pb); /* duration */
get_be32(pb); /* preferred scale */ get_be32(pb); /* preferred scale */
...@@ -635,9 +635,9 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -635,9 +635,9 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
get_be32(pb); /* vert resolution */ get_be32(pb); /* vert resolution */
get_be32(pb); /* data size, always 0 */ get_be32(pb); /* data size, always 0 */
frames_per_sample = get_be16(pb); /* frames per samples */ frames_per_sample = get_be16(pb); /* frames per samples */
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "frames/samples = %d\n", frames_per_sample); dprintf(c->fc, "frames/samples = %d\n", frames_per_sample);
#endif
get_buffer(pb, codec_name, 32); /* codec name, pascal string (FIXME: true for mp4?) */ get_buffer(pb, codec_name, 32); /* codec name, pascal string (FIXME: true for mp4?) */
if (codec_name[0] <= 31) { if (codec_name[0] <= 31) {
memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]); memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]);
...@@ -863,9 +863,8 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -863,9 +863,8 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
if(entries >= UINT_MAX / sizeof(MOV_sample_to_chunk_tbl)) if(entries >= UINT_MAX / sizeof(MOV_sample_to_chunk_tbl))
return -1; return -1;
#ifdef DEBUG dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
av_log(NULL, AV_LOG_DEBUG, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
#endif
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_sample_to_chunk_tbl));
if (!sc->sample_to_chunk) if (!sc->sample_to_chunk)
...@@ -893,17 +892,15 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -893,17 +892,15 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
return -1; return -1;
sc->keyframe_count = entries; sc->keyframe_count = entries;
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "keyframe_count = %d\n", sc->keyframe_count); dprintf(c->fc, "keyframe_count = %d\n", sc->keyframe_count);
#endif
sc->keyframes = av_malloc(entries * sizeof(int)); 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 //dprintf(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
/* av_log(NULL, AV_LOG_DEBUG, "keyframes[]=%d\n", sc->keyframes[i]); */
#endif
} }
return 0; return 0;
} }
...@@ -928,17 +925,14 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -928,17 +925,14 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
if (sample_size) if (sample_size)
return 0; return 0;
#ifdef DEBUG dprintf(c->fc, "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
sc->sample_sizes = av_malloc(entries * sizeof(int)); 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 dprintf(c->fc, "sample_sizes[]=%d\n", sc->sample_sizes[i]);
av_log(NULL, AV_LOG_DEBUG, "sample_sizes[]=%d\n", sc->sample_sizes[i]);
#endif
} }
return 0; return 0;
} }
...@@ -960,9 +954,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -960,9 +954,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
sc->stts_count = entries; sc->stts_count = entries;
sc->stts_data = av_malloc(entries * sizeof(Time2Sample)); sc->stts_data = av_malloc(entries * sizeof(Time2Sample));
#ifdef DEBUG dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
av_log(NULL, AV_LOG_DEBUG, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
#endif
sc->time_rate=0; sc->time_rate=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