Commit 5efc8ec8 authored by Aurelien Jacobs's avatar Aurelien Jacobs

matroskadec: remove some useless or out of date comments

Originally committed as revision 14580 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8f35a2c0
...@@ -181,7 +181,6 @@ typedef struct { ...@@ -181,7 +181,6 @@ typedef struct {
MatroskaLevel levels[EBML_MAX_DEPTH]; MatroskaLevel levels[EBML_MAX_DEPTH];
int level_up; int level_up;
/* timescale in the file */
uint64_t time_scale; uint64_t time_scale;
double duration; double duration;
char *title; char *title;
...@@ -456,12 +455,6 @@ static EbmlSyntax matroska_clusters[] = { ...@@ -456,12 +455,6 @@ static EbmlSyntax matroska_clusters[] = {
{ 0 } { 0 }
}; };
/*
* The first few functions handle EBML file parsing. The rest
* is the document interpretation. Matroska really just is a
* EBML file.
*/
/* /*
* Return: the amount of levels in the hierarchy that the * Return: the amount of levels in the hierarchy that the
* current element lies higher than the previous one. * current element lies higher than the previous one.
...@@ -775,14 +768,12 @@ ebml_read_master (MatroskaDemuxContext *matroska, ...@@ -775,14 +768,12 @@ ebml_read_master (MatroskaDemuxContext *matroska,
(res = ebml_read_element_length(matroska, &length)) < 0) (res = ebml_read_element_length(matroska, &length)) < 0)
return res; return res;
/* protect... (Heaven forbids that the '>' is true) */
if (matroska->num_levels >= EBML_MAX_DEPTH) { if (matroska->num_levels >= EBML_MAX_DEPTH) {
av_log(matroska->ctx, AV_LOG_ERROR, av_log(matroska->ctx, AV_LOG_ERROR,
"File moves beyond max. allowed depth (%d)\n", EBML_MAX_DEPTH); "File moves beyond max. allowed depth (%d)\n", EBML_MAX_DEPTH);
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
/* remember level */
level = &matroska->levels[matroska->num_levels++]; level = &matroska->levels[matroska->num_levels++];
level->start = url_ftell(pb); level->start = url_ftell(pb);
level->length = length; level->length = length;
...@@ -1017,9 +1008,6 @@ matroska_probe (AVProbeData *p) ...@@ -1017,9 +1008,6 @@ matroska_probe (AVProbeData *p)
return 0; return 0;
} }
/*
* From here on, it's all XML-style DTD stuff... Needs no comments.
*/
static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
void *data, uint32_t expected_id, int once); void *data, uint32_t expected_id, int once);
...@@ -1431,26 +1419,19 @@ matroska_read_header (AVFormatContext *s, ...@@ -1431,26 +1419,19 @@ matroska_read_header (AVFormatContext *s,
if (st == NULL) if (st == NULL)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
/* Set the FourCC from the CodecID. */
/* This is the MS compatibility mode which stores a
* BITMAPINFOHEADER in the CodecPrivate. */
if (!strcmp(track->codec_id, if (!strcmp(track->codec_id,
MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC) && MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC) &&
(track->codec_priv.size >= 40) && (track->codec_priv.size >= 40) &&
(track->codec_priv.data != NULL)) { (track->codec_priv.data != NULL)) {
/* Offset of biCompression. Stored in LE. */
track->video.fourcc = AV_RL32(track->codec_priv.data + 16); track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
codec_id = codec_get_id(codec_bmp_tags, track->video.fourcc); codec_id = codec_get_id(codec_bmp_tags, track->video.fourcc);
} }
/* This is the MS compatibility mode which stores a
* WAVEFORMATEX in the CodecPrivate. */
else if (!strcmp(track->codec_id, else if (!strcmp(track->codec_id,
MATROSKA_CODEC_ID_AUDIO_ACM) && MATROSKA_CODEC_ID_AUDIO_ACM) &&
(track->codec_priv.size >= 18) && (track->codec_priv.size >= 18) &&
(track->codec_priv.data != NULL)) { (track->codec_priv.data != NULL)) {
/* Offset of wFormatTag. Stored in LE. */
uint16_t tag = AV_RL16(track->codec_priv.data); uint16_t tag = AV_RL16(track->codec_priv.data);
codec_id = codec_get_id(codec_wav_tags, tag); codec_id = codec_get_id(codec_wav_tags, tag);
...@@ -1582,7 +1563,6 @@ matroska_read_header (AVFormatContext *s, ...@@ -1582,7 +1563,6 @@ matroska_read_header (AVFormatContext *s,
st->codec->codec_type = CODEC_TYPE_SUBTITLE; st->codec->codec_type = CODEC_TYPE_SUBTITLE;
} }
/* What do we do with private data? E.g. for Vorbis. */
} }
attachements = attachements_list->elem; attachements = attachements_list->elem;
...@@ -1653,7 +1633,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, ...@@ -1653,7 +1633,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
int n, flags, laces = 0; int n, flags, laces = 0;
uint64_t num; uint64_t num;
/* first byte(s): tracknum */
if ((n = matroska_ebmlnum_uint(data, size, &num)) < 0) { if ((n = matroska_ebmlnum_uint(data, size, &num)) < 0) {
av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n"); av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
return res; return res;
...@@ -1661,7 +1640,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, ...@@ -1661,7 +1640,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
data += n; data += n;
size -= n; size -= n;
/* fetch track from num */
track = matroska_find_track_by_num(matroska, num); track = matroska_find_track_by_num(matroska, num);
if (size <= 3 || !track || !track->stream) { if (size <= 3 || !track || !track->stream) {
av_log(matroska->ctx, AV_LOG_INFO, av_log(matroska->ctx, AV_LOG_INFO,
...@@ -1674,7 +1652,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, ...@@ -1674,7 +1652,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
if (duration == AV_NOPTS_VALUE) if (duration == AV_NOPTS_VALUE)
duration = track->default_duration / matroska->time_scale; duration = track->default_duration / matroska->time_scale;
/* block_time (relative to cluster time) */
block_time = AV_RB16(data); block_time = AV_RB16(data);
data += 2; data += 2;
flags = *data++; flags = *data++;
...@@ -1878,10 +1855,8 @@ matroska_read_packet (AVFormatContext *s, ...@@ -1878,10 +1855,8 @@ matroska_read_packet (AVFormatContext *s,
{ {
MatroskaDemuxContext *matroska = s->priv_data; MatroskaDemuxContext *matroska = s->priv_data;
/* Read stream until we have a packet queued. */
while (matroska_deliver_packet(matroska, pkt)) { while (matroska_deliver_packet(matroska, pkt)) {
/* Have we already reached the end? */
if (matroska->done) if (matroska->done)
return AVERROR(EIO); return AVERROR(EIO);
...@@ -1900,14 +1875,12 @@ matroska_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, ...@@ -1900,14 +1875,12 @@ matroska_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp,
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];
int index; int index;
/* find index entry */
index = av_index_search_timestamp(st, timestamp, flags); index = av_index_search_timestamp(st, timestamp, flags);
if (index < 0) if (index < 0)
return 0; return 0;
matroska_clear_queue(matroska); matroska_clear_queue(matroska);
/* do the seek */
url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET); url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY); matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
matroska->skip_to_stream = st; matroska->skip_to_stream = st;
......
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