Update of /cvsroot/xine/xine-lib/src/demuxers
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11699

Modified Files:
        demux_asf.c 
Log Message:
Compute the average byterate for time based seeking.


Index: demux_asf.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/demuxers/demux_asf.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -r1.186 -r1.187
--- demux_asf.c 21 Nov 2006 18:26:01 -0000      1.186
+++ demux_asf.c 26 Nov 2006 17:03:12 -0000      1.187
@@ -120,7 +120,7 @@
   int                video_stream;
   int                audio_stream;
 
-  uint64_t           length;
+  int64_t            length;
   uint32_t           rate;
 
   /* packet filling */
@@ -402,8 +402,15 @@
   this->packet_size = this->asf_header->file->packet_size;
   this->packet_count = this->asf_header->file->data_packet_count;
   
+  /* compute stream duration */
   this->length = (this->asf_header->file->send_duration - 
                   this->asf_header->file->preroll) / 10000;
+  if (this->length < 0)
+    this->length = 0;
+    
+  /* compute average byterate (needed for seeking) */
+  if (this->length)
+    this->rate = (int64_t) this->input->get_length(this->input) * 1000 / 
this->length;
 
   _x_stream_info_set(this->stream, XINE_STREAM_INFO_BITRATE, 
this->asf_header->file->max_bitrate);
 
@@ -1787,7 +1794,7 @@
   start_pos = (off_t) ( (double) start_pos / 65535 *
               this->input->get_length (this->input) );
 
-  lprintf ("demux_asf_seek: start_pos = %lld, start_time=%d\n",
+  lprintf ("demux_asf_seek: start_pos=%lld, start_time=%d\n",
           start_pos, start_time);
 
   this->status = DEMUX_OK;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to