[vlc-devel] commit: (live555) Implement RTSP pause correctly. (Jean-Paul Saman )
git version control
git at videolan.org
Mon Nov 24 15:06:37 CET 2008
vlc | branch: 0.8.6-bugfix | Jean-Paul Saman <jpsaman at videolan.org> | Sun Nov 23 16:36:27 2008 +0100| [5687169bc1e2e3e9fcf7c2b7059ccf39fceadb3c] | committer: Jean-Paul Saman
(live555) Implement RTSP pause correctly.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5687169bc1e2e3e9fcf7c2b7059ccf39fceadb3c
---
modules/demux/live555.cpp | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index bb6414b..76c2931 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -1234,7 +1234,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
else
{
*pi64 = i_time - i_caching;
- printf("time %zd\n", *pi64);
return VLC_SUCCESS;
}
@@ -1299,10 +1298,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_SUCCESS;
case DEMUX_SET_PAUSE_STATE:
- double d_npt;
-
- d_npt = ( (double)( p_sys->i_pcr - p_sys->i_pcr_start +
- p_sys->i_start ) ) / 1000000.00;
+ {
+ int i;
b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t );
if( p_sys->rtsp == NULL )
@@ -1310,7 +1307,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( ( b_bool && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) ||
( !b_bool && !p_sys->rtsp->playMediaSession( *p_sys->ms,
- d_npt > 0 ? d_npt : -1 ) ) )
+ -1 ) ) )
{
msg_Err( p_demux, "PLAY or PAUSE failed %s", p_sys->env->getResultMsg() );
return VLC_EGENERIC;
@@ -1328,16 +1325,23 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->p_timeout->b_handle_keep_alive = VLC_TRUE;
else if( !b_bool && p_sys->p_timeout != NULL )
p_sys->p_timeout->b_handle_keep_alive = VLC_FALSE;
-#if 0
+
/* reset PCR and PCR start, mmh won't work well for multi-stream I fear */
- for( i = 0; i < p_sys->i_track; i++ )
+ for( i = 0; !b_bool && i < p_sys->i_track; i++ )
{
+ p_sys->track[i]->b_rtcp_sync = VLC_FALSE;
p_sys->track[i]->i_pts = 0;
+ p_sys->i_pcr = 0;
+ es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
}
- p_sys->i_pcr_start = 0; /* FIXME Wrong */
- p_sys->i_pcr = 0;
-#endif
+
+ p_sys->i_pcr = p_sys->i_pcr_start = p_sys->ms->playStartTime();
+ p_sys->i_length = (int64_t)((double) p_sys->ms->playEndTime() * 1000000.0);
+ msg_Dbg( p_demux, "pause start: %lld stop: %lld",
+ p_sys->i_pcr_start, p_sys->i_length );
+
return VLC_SUCCESS;
+ }
case DEMUX_GET_TITLE_INFO:
case DEMUX_SET_TITLE:
More information about the vlc-devel
mailing list