summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_asf.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-24 15:19:48 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-24 15:19:48 +0000
commitbd40e0ea1d816f4388256972887f25f5fdd9889d (patch)
tree430382864a32fb79773f50a7c5f7d7ea9460c4b8 /libmpdemux/demux_asf.c
parent8e6272e8322c71b5396c0c203c499cb45278b002 (diff)
downloadmpv-bd40e0ea1d816f4388256972887f25f5fdd9889d.tar.bz2
mpv-bd40e0ea1d816f4388256972887f25f5fdd9889d.tar.xz
interpolate real fps of dvr-ms files using the extended stream properties.
Patch by John Donaghy - johnfdonaghy gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19967 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_asf.c')
-rw-r--r--libmpdemux/demux_asf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c
index 85a0176b47..d14cdb5612 100644
--- a/libmpdemux/demux_asf.c
+++ b/libmpdemux/demux_asf.c
@@ -197,6 +197,15 @@ static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,in
len -= frame_end_pos;
}
close_seg = 1;
+ if (asf->avg_vid_frame_time > 0.0 ) {
+ // correct the pts for the packet
+ // because dvr-ms files do not contain accurate
+ // pts values but we can deduce them using
+ // the average frame time
+ if (asf->dvr_last_vid_pts > 0.0)
+ dp->pts=asf->dvr_last_vid_pts+asf->avg_vid_frame_time;
+ asf->dvr_last_vid_pts = dp->pts;
+ }
} else seq = ds->asf_seq;
} else close_seg = ds->asf_seq!=seq;
@@ -487,6 +496,8 @@ static void demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,float audio_de
// printf("\r -- asf: newpos=%d -- \n",newpos);
stream_seek(demuxer->stream,newpos);
+ if (asf->asf_is_dvr_ms) asf->dvr_last_vid_pts = 0.0f;
+
if (d_video->id >= 0)
ds_fill_buffer(d_video);
if(sh_audio){
@@ -556,7 +567,7 @@ static demuxer_t* demux_open_asf(demuxer_t* demuxer)
//printf("ASF: missing video stream!? contact the author, it may be a bug :(\n");
} else {
sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
- sh_video->fps=1000.0f; sh_video->frametime=0.001f; // 1ms
+ //sh_video->fps=1000.0f; sh_video->frametime=0.001f; // 1ms - now set when reading asf header
//sh_video->i_bps=10*asf->packetsize; // FIXME!
}
}