comparison avidec.c @ 5623:d8bfadee68a0 libavformat

Set nb_frames. Also add DXSA tag (commited by mistake in this commit, i can revert and recommit seperately if someone wants)
author michael
date Tue, 02 Feb 2010 23:53:38 +0000
parents 7698da6e1f0a
children 71fc72a36677
comparison
equal deleted inserted replaced
5622:a427102c12cd 5623:d8bfadee68a0
249 { 249 {
250 AVIContext *avi = s->priv_data; 250 AVIContext *avi = s->priv_data;
251 ByteIOContext *pb = s->pb; 251 ByteIOContext *pb = s->pb;
252 unsigned int tag, tag1, handler; 252 unsigned int tag, tag1, handler;
253 int codec_type, stream_index, frame_period, bit_rate; 253 int codec_type, stream_index, frame_period, bit_rate;
254 unsigned int size, nb_frames; 254 unsigned int size;
255 int i; 255 int i;
256 AVStream *st; 256 AVStream *st;
257 AVIStream *ast = NULL; 257 AVIStream *ast = NULL;
258 int avih_width=0, avih_height=0; 258 int avih_width=0, avih_height=0;
259 int amv_file_format=0; 259 int amv_file_format=0;
410 } 410 }
411 } 411 }
412 av_set_pts_info(st, 64, ast->scale, ast->rate); 412 av_set_pts_info(st, 64, ast->scale, ast->rate);
413 413
414 ast->cum_len=get_le32(pb); /* start */ 414 ast->cum_len=get_le32(pb); /* start */
415 nb_frames = get_le32(pb); 415 st->nb_frames = get_le32(pb);
416 416
417 st->start_time = 0; 417 st->start_time = 0;
418 st->duration = nb_frames; 418 st->duration = st->nb_frames;
419 get_le32(pb); /* buffer size */ 419 get_le32(pb); /* buffer size */
420 get_le32(pb); /* quality */ 420 get_le32(pb); /* quality */
421 ast->sample_size = get_le32(pb); /* sample ssize */ 421 ast->sample_size = get_le32(pb); /* sample ssize */
422 ast->cum_len *= FFMAX(1, ast->sample_size); 422 ast->cum_len *= FFMAX(1, ast->sample_size);
423 // av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size); 423 // av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);
474 get_le32(pb); /* XPelsPerMeter */ 474 get_le32(pb); /* XPelsPerMeter */
475 get_le32(pb); /* YPelsPerMeter */ 475 get_le32(pb); /* YPelsPerMeter */
476 get_le32(pb); /* ClrUsed */ 476 get_le32(pb); /* ClrUsed */
477 get_le32(pb); /* ClrImportant */ 477 get_le32(pb); /* ClrImportant */
478 478
479 if (tag1 == MKTAG('D', 'X', 'S', 'B')) { 479 if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) {
480 st->codec->codec_type = CODEC_TYPE_SUBTITLE; 480 st->codec->codec_type = CODEC_TYPE_SUBTITLE;
481 st->codec->codec_tag = tag1; 481 st->codec->codec_tag = tag1;
482 st->codec->codec_id = CODEC_ID_XSUB; 482 st->codec->codec_id = CODEC_ID_XSUB;
483 break; 483 break;
484 } 484 }