Commit 01eeb422 authored by Baptiste Coudurier's avatar Baptiste Coudurier

cosmetics

Originally committed as revision 11235 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 687f35f3
...@@ -662,9 +662,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -662,9 +662,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
/* if the depth is 2, 4, or 8 bpp, file is palettized */ /* if the depth is 2, 4, or 8 bpp, file is palettized */
if ((color_depth == 2) || (color_depth == 4) || if ((color_depth == 2) || (color_depth == 4) ||
(color_depth == 8)) { (color_depth == 8)) {
if (color_greyscale) { if (color_greyscale) {
/* compute the greyscale palette */ /* compute the greyscale palette */
color_count = 1 << color_depth; color_count = 1 << color_depth;
color_index = 255; color_index = 255;
...@@ -677,9 +675,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -677,9 +675,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
if (color_index < 0) if (color_index < 0)
color_index = 0; color_index = 0;
} }
} else if (st->codec->color_table_id & 0x08) { } else if (st->codec->color_table_id & 0x08) {
/* if flag bit 3 is set, use the default palette */ /* if flag bit 3 is set, use the default palette */
color_count = 1 << color_depth; color_count = 1 << color_depth;
if (color_depth == 2) if (color_depth == 2)
...@@ -696,9 +692,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -696,9 +692,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
c->palette_control.palette[j] = c->palette_control.palette[j] =
(r << 16) | (g << 8) | (b); (r << 16) | (g << 8) | (b);
} }
} else { } else {
/* load the palette from the file */ /* load the palette from the file */
color_start = get_be32(pb); color_start = get_be32(pb);
color_count = get_be16(pb); color_count = get_be16(pb);
...@@ -722,7 +716,6 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -722,7 +716,6 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
} }
} }
} }
st->codec->palctrl = &c->palette_control; st->codec->palctrl = &c->palette_control;
st->codec->palctrl->palette_changed = 1; st->codec->palctrl->palette_changed = 1;
} else } else
...@@ -1364,7 +1357,6 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1364,7 +1357,6 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
} }
} else { /* read whole chunk */ } else { /* read whole chunk */
unsigned int chunk_samples, chunk_size, chunk_duration; unsigned int chunk_samples, chunk_size, chunk_duration;
for (i = 0; i < sc->chunk_count; i++) { for (i = 0; i < sc->chunk_count; i++) {
current_offset = sc->chunk_offsets[i]; current_offset = sc->chunk_offsets[i];
if (stsc_index + 1 < sc->sample_to_chunk_sz && i + 1 == sc->sample_to_chunk[stsc_index + 1].first) if (stsc_index + 1 < sc->sample_to_chunk_sz && i + 1 == sc->sample_to_chunk[stsc_index + 1].first)
...@@ -1379,7 +1371,6 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1379,7 +1371,6 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
chunk_size = INT_MAX; chunk_size = INT_MAX;
for (j = 0; j < mov->total_streams; j++) { for (j = 0; j < mov->total_streams; j++) {
MOVStreamContext *msc = mov->streams[j]; MOVStreamContext *msc = mov->streams[j];
for (k = msc->next_chunk; k < msc->chunk_count; k++) { for (k = msc->next_chunk; k < msc->chunk_count; k++) {
if (msc->chunk_offsets[k] > current_offset && msc->chunk_offsets[k] - current_offset < chunk_size) { if (msc->chunk_offsets[k] > current_offset && msc->chunk_offsets[k] - current_offset < chunk_size) {
chunk_size = msc->chunk_offsets[k] - current_offset; chunk_size = msc->chunk_offsets[k] - current_offset;
...@@ -1507,11 +1498,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -1507,11 +1498,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
for (i = 0; i < mov->total_streams; i++) { for (i = 0; i < mov->total_streams; i++) {
MOVStreamContext *msc = mov->streams[i]; MOVStreamContext *msc = mov->streams[i];
if (s->streams[i]->discard != AVDISCARD_ALL && msc->current_sample < msc->sample_count) { if (s->streams[i]->discard != AVDISCARD_ALL && msc->current_sample < msc->sample_count) {
AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample]; AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample];
int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale); int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale);
dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts); dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
if (!sample || (url_is_streamed(s->pb) && current_sample->pos < sample->pos) || if (!sample || (url_is_streamed(s->pb) && current_sample->pos < sample->pos) ||
(!url_is_streamed(s->pb) && (!url_is_streamed(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