Mercurial > libavformat.hg
comparison dv.c @ 288:981b0b3c95dd libavformat
AVRational
sample_aspect_ratio
aspect ratio in JPEG JFIF is SAR not DAR !
removed nonsense SAR guessing code
various related cleanups
bugs?
author | michael |
---|---|
date | Mon, 20 Oct 2003 20:23:46 +0000 |
parents | ef2e313770e0 |
children | 252946de6d3f |
comparison
equal
deleted
inserted
replaced
287:0b3ec5cba845 | 288:981b0b3c95dd |
---|---|
554 avctx->frame_rate_base = sys->frame_rate_base; | 554 avctx->frame_rate_base = sys->frame_rate_base; |
555 avctx->width = sys->width; | 555 avctx->width = sys->width; |
556 avctx->height = sys->height; | 556 avctx->height = sys->height; |
557 avctx->pix_fmt = sys->pix_fmt; | 557 avctx->pix_fmt = sys->pix_fmt; |
558 vsc_pack = dv_extract_pack(frame, dv_video_control); | 558 vsc_pack = dv_extract_pack(frame, dv_video_control); |
559 /* MN: someone please fill in the correct SAR for dv, i dont have the standard doc so i cant, allthough its very likely the same as MPEG4 (12:11 10:11 16:11 40:33) */ | |
559 if (vsc_pack && (vsc_pack[2] & 0x07) == (apt?0x02:0x07)) | 560 if (vsc_pack && (vsc_pack[2] & 0x07) == (apt?0x02:0x07)) |
560 avctx->aspect_ratio = 16.0 / 9.0; | 561 avctx->sample_aspect_ratio = (AVRational){16,9}; |
561 else | 562 else |
562 avctx->aspect_ratio = 4.0 / 3.0; | 563 avctx->sample_aspect_ratio = (AVRational){4,3}; |
564 avctx->sample_aspect_ratio = av_div_q(avctx->sample_aspect_ratio, (AVRational){sys->width,sys->height}); | |
563 size = sys->frame_size; | 565 size = sys->frame_size; |
564 } | 566 } |
565 return size; | 567 return size; |
566 } | 568 } |
567 | 569 |
658 /* Ok, everything seems to be in working order */ | 660 /* Ok, everything seems to be in working order */ |
659 c->frames = 0; | 661 c->frames = 0; |
660 c->has_audio = c->has_video = 0; | 662 c->has_audio = c->has_video = 0; |
661 c->start_time = time(NULL); | 663 c->start_time = time(NULL); |
662 c->aspect = 0; /* 4:3 is the default */ | 664 c->aspect = 0; /* 4:3 is the default */ |
663 if ((int)(vst->codec.aspect_ratio * 10) == 17) /* 16:9 */ | 665 if ((int)(av_q2d(vst->codec.sample_aspect_ratio) * vst->codec.width / vst->codec.height * 10) == 17) /* 16:9 */ |
664 c->aspect = 0x07; | 666 c->aspect = 0x07; |
665 | 667 |
666 if (fifo_init(&c->audio_data, 100*AVCODEC_MAX_AUDIO_FRAME_SIZE) < 0) | 668 if (fifo_init(&c->audio_data, 100*AVCODEC_MAX_AUDIO_FRAME_SIZE) < 0) |
667 goto bail_out; | 669 goto bail_out; |
668 | 670 |