An aspect ratio of 1.0 is actually the pixel AR instead of the display AR.

This commit is contained in:
Moritz Bunkus 2004-12-28 21:49:26 +00:00
parent 4068f28871
commit 84ecc597e1

View File

@ -117,7 +117,7 @@ mpeg_es_reader_c::mpeg_es_reader_c(track_info_c *nti)
height = seq_hdr.height; height = seq_hdr.height;
frame_rate = seq_hdr.frameRate; frame_rate = seq_hdr.frameRate;
aspect_ratio = seq_hdr.aspectRatio; aspect_ratio = seq_hdr.aspectRatio;
if (aspect_ratio <= 0) if ((aspect_ratio <= 0) || (aspect_ratio == 1))
dwidth = width; dwidth = width;
else else
dwidth = (int)(height * aspect_ratio); dwidth = (int)(height * aspect_ratio);
@ -514,7 +514,7 @@ mpeg_ps_reader_c::found_new_stream(int id) {
track->v_height = seq_hdr.height; track->v_height = seq_hdr.height;
track->v_frame_rate = seq_hdr.frameRate; track->v_frame_rate = seq_hdr.frameRate;
track->v_aspect_ratio = seq_hdr.aspectRatio; track->v_aspect_ratio = seq_hdr.aspectRatio;
if (track->v_aspect_ratio <= 0) if ((track->v_aspect_ratio <= 0) || (track->v_aspect_ratio == 1))
track->v_dwidth = track->v_width; track->v_dwidth = track->v_width;
else else
track->v_dwidth = (int)(track->v_height * track->v_aspect_ratio); track->v_dwidth = (int)(track->v_height * track->v_aspect_ratio);