[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.7,1.8

Moritz Bunkus CVS mosu at mplayerhq.hu
Tue May 6 22:40:51 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv6617

Modified Files:
	demux_mkv.cpp 
Log Message:
Support for aspect ratio set via DisplayWidth/DisplayHeight.

Index: demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- demux_mkv.cpp	6 May 2003 10:36:32 -0000	1.7
+++ demux_mkv.cpp	6 May 2003 20:40:24 -0000	1.8
@@ -135,7 +135,7 @@
   char type; // 'v' = video, 'a' = audio, 's' = subs
   
   char v_fourcc[5];
-  uint32_t v_width, v_height;
+  uint32_t v_width, v_height, v_dwidth, v_dheight;
   float v_frate;
 
   uint16_t a_formattag;
@@ -393,6 +393,11 @@
           continue;
         }
 
+        if (t->v_dwidth == 0)
+          t->v_dwidth = t->v_width;
+        if (t->v_dheight == 0)
+          t->v_dheight = t->v_height;
+
         // This track seems to be ok.
         t->ok = 1;
 
@@ -1132,6 +1137,24 @@
                            "%u\n", track->v_height);
 
                   } else if (EbmlId(*l4) ==
+                             KaxVideoDisplayWidth::ClassInfos.GlobalId) {
+                    KaxVideoDisplayWidth &width =
+                      *static_cast<KaxVideoDisplayWidth *>(l4);
+                    width.ReadData(es->I_O());
+                    track->v_dwidth = uint16(width);
+                    mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] |   + Display width: "
+                           "%u\n", track->v_dwidth);
+
+                  } else if (EbmlId(*l4) ==
+                             KaxVideoDisplayHeight::ClassInfos.GlobalId) {
+                    KaxVideoDisplayHeight &height =
+                      *static_cast<KaxVideoDisplayHeight *>(l4);
+                    height.ReadData(es->I_O());
+                    track->v_dheight = uint16(height);
+                    mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] |   + Display height: "
+                           "%u\n", track->v_dheight);
+
+                  } else if (EbmlId(*l4) ==
                              KaxVideoFrameRate::ClassInfos.GlobalId) {
                     KaxVideoFrameRate &framerate =
                       *static_cast<KaxVideoFrameRate *>(l4);
@@ -1423,8 +1446,10 @@
       sh_v->format = sh_v->bih->biCompression;
       sh_v->fps = track->v_frate;
       sh_v->frametime = 1 / track->v_frate;
-      sh_v->disp_w = sh_v->bih->biWidth;
-      sh_v->disp_h = sh_v->bih->biHeight;
+      sh_v->disp_w = track->v_width;
+      sh_v->disp_h = track->v_height;
+      sh_v->aspect = (float)track->v_dwidth / (float)track->v_dheight;
+      mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] Aspect: %f\n", sh_v->aspect);
 
       demuxer->video->id = track->tnum;
       demuxer->video->sh = sh_v;



More information about the MPlayer-cvslog mailing list