# HG changeset patch # User alex # Date 1009482876 0 # Node ID 3080ef830f9384cb9dea12f76eda0659d7e7d527 # Parent f41bbaebcea3e59d5cd7b7f6d5d031e2de03728b aspect ratio patch by Rik Snel diff -r f41bbaebcea3 -r 3080ef830f93 libmpdemux/demux_y4m.c --- a/libmpdemux/demux_y4m.c Thu Dec 27 18:53:11 2001 +0000 +++ b/libmpdemux/demux_y4m.c Thu Dec 27 19:54:36 2001 +0000 @@ -116,7 +116,7 @@ void demux_open_y4m(demuxer_t* demuxer){ y4m_priv_t* priv = demuxer->priv; - y4m_ratio_t framerate; + y4m_ratio_t ratio; sh_video_t* sh=new_sh_video(demuxer,0); int err; @@ -186,13 +186,17 @@ mp_msg(MSGT_DEMUXER, MSGL_FATAL, "error parsing YUV4MPEG header: %s\n", y4m_strerr(err)); if(!sh->fps) { - framerate = y4m_si_get_framerate(priv->si); - if (framerate.d != 0) - sh->fps=(float)framerate.n/(float)framerate.d; + ratio = y4m_si_get_framerate(priv->si); + if (ratio.d != 0) + sh->fps=(float)ratio.n/(float)ratio.d; else sh->fps=15.0f; } sh->frametime=1.0f/sh->fps; + + ratio = y4m_si_get_sampleaspect(priv->si); + if (ratio.d != 0 && ratio.n != 0) + sh->aspect = (float)ratio.n/(float)ratio.d; sh->disp_w = y4m_si_get_width(priv->si); sh->disp_h = y4m_si_get_height(priv->si); @@ -224,7 +228,7 @@ void demux_close_y4m(demuxer_t *demuxer) { - y4m_priv_t* priv; + y4m_priv_t* priv = demuxer->priv; if (!priv->is_older) y4m_fini_stream_info(((y4m_priv_t*)demuxer->priv)->si);