[MPlayer-cvslog] r37290 - trunk/libmpdemux/demux_lavf.c

reimar subversion at mplayerhq.hu
Sun Sep 28 14:21:43 CEST 2014


Author: reimar
Date: Sun Sep 28 14:21:42 2014
New Revision: 37290

Log:
demux_lavf: set stream_pts if possible.

Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Sat Sep 27 20:44:47 2014	(r37289)
+++ trunk/libmpdemux/demux_lavf.c	Sun Sep 28 14:21:42 2014	(r37290)
@@ -640,6 +640,7 @@ static int demux_lavf_fill_buffer(demuxe
     demux_packet_t *dp;
     demux_stream_t *ds;
     int id;
+    double stream_pts = MP_NOPTS_VALUE;
     mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_lavf_fill_buffer()\n");
 
     demux->filepos=stream_tell(demux->stream);
@@ -699,6 +700,9 @@ static int demux_lavf_fill_buffer(demuxe
     }
     dp->pos=demux->filepos;
     dp->flags= !!(pkt.flags&AV_PKT_FLAG_KEY);
+    if (ds == demux->video &&
+        stream_control(demux->stream, STREAM_CTRL_GET_CURRENT_TIME, (void *)&stream_pts) != STREAM_UNSUPPORTED)
+        dp->stream_pts = stream_pts;
     // append packet to DS stream:
     ds_add_packet(ds,dp);
     return 1;


More information about the MPlayer-cvslog mailing list