[MPlayer-cvslog] r23375 - in trunk/libmpdemux: asf.h asfheader.c demux_asf.c

zuxy subversion at mplayerhq.hu
Tue May 22 15:55:14 CEST 2007


Author: zuxy
Date: Tue May 22 15:55:14 2007
New Revision: 23375

Log:
Set i_bps for ASF video streams according to extended stream properties


Modified:
   trunk/libmpdemux/asf.h
   trunk/libmpdemux/asfheader.c
   trunk/libmpdemux/demux_asf.c

Modified: trunk/libmpdemux/asf.h
==============================================================================
--- trunk/libmpdemux/asf.h	(original)
+++ trunk/libmpdemux/asf.h	Tue May 22 15:55:14 2007
@@ -241,6 +241,7 @@ struct asf_priv {
     int aud_ext_timing_index;
     int vid_ext_frame_index;
     int know_frame_time;
+    unsigned bps;
 };
 
 #endif

Modified: trunk/libmpdemux/asfheader.c
==============================================================================
--- trunk/libmpdemux/asfheader.c	(original)
+++ trunk/libmpdemux/asfheader.c	Tue May 22 15:55:14 2007
@@ -198,6 +198,7 @@ static int get_ext_stream_properties(cha
   int pos=0;
   uint8_t *buffer = &buf[0];
   uint64_t avg_ft;
+  unsigned bitrate;
 
   while ((pos = find_asf_guid(buf, asf_ext_stream_header, pos, buf_len)) >= 0) {
     int this_stream_num, stnamect, payct, i, objlen;
@@ -213,7 +214,9 @@ static int get_ext_stream_properties(cha
     // max-object-size(4),
     // flags(4) (reliable,seekable,no_cleanpoints?,resend-live-cleanpoints, rest of bits reserved)
 
-    buffer +=8+8+4+4+4+4+4+4+4+4;
+    buffer += 8+8;
+    bitrate = AV_RL32(buffer);
+    buffer += 8*4;
     this_stream_num=AV_RL16(buffer);buffer+=2;
 
     if (this_stream_num == stream_num) {
@@ -222,6 +225,7 @@ static int get_ext_stream_properties(cha
       buffer+=2; //skip stream-language-id-index
       avg_ft = AV_RL64(buffer); // provided in 100ns units
       buffer+=8;
+      asf->bps = bitrate / 8;
 
       // after this are values for stream-name-count and
       // payload-extension-system-count
@@ -556,6 +560,7 @@ int read_asf_header(demuxer_t *demuxer,s
           sh_video->aspect = asp_ratio * sh_video->bih->biWidth /
             sh_video->bih->biHeight;
         }
+        sh_video->i_bps = asf->bps;
 
         if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih, MSGL_V);
         //asf_video_id=streamh.stream_no & 0x7F;

Modified: trunk/libmpdemux/demux_asf.c
==============================================================================
--- trunk/libmpdemux/demux_asf.c	(original)
+++ trunk/libmpdemux/demux_asf.c	Tue May 22 15:55:14 2007
@@ -715,7 +715,6 @@ static demuxer_t* demux_open_asf(demuxer
         } else {
             sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
             sh_video->fps=1000.0f; sh_video->frametime=0.001f;
-            //sh_video->i_bps=10*asf->packetsize; // FIXME!
 
             if (asf->asf_is_dvr_ms) {
                 sh_video->bih->biWidth = 0;



More information about the MPlayer-cvslog mailing list