From: hyc Date: Sun, 14 Feb 2010 20:46:47 +0000 (+0000) Subject: More fixes for pause/resume - don't overwrite pauseStamp if already paused X-Git-Tag: v2.4~270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=180093d22a161adcfd7077d9655e2c81138f7e88;p=rtmpdump More fixes for pause/resume - don't overwrite pauseStamp if already paused git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@250 400ebc74-4327-4243-bc38-086b20814532 --- diff --git a/rtmp.c b/rtmp.c index 490e320..2de8d28 100644 --- a/rtmp.c +++ b/rtmp.c @@ -524,12 +524,14 @@ RTMP_ToggleStream(RTMP * r) { bool res; - res = RTMP_SendPause(r, true, r->m_pauseStamp); - if (!res) - return res; - - r->m_pausing = 1; - sleep(1); + if (!r->m_pausing) { + res = RTMP_SendPause(r, true, r->m_pauseStamp); + if (!res) + return res; + + r->m_pausing = 1; + sleep(1); + } res = RTMP_SendPause(r, false, r->m_pauseStamp); r->m_pausing = 3; return res; @@ -584,7 +586,7 @@ RTMP_GetNextMediaPacket(RTMP * r, RTMPPacket * packet) if (bHasMediaPacket) r->m_bPlaying = true; - else if (r->m_bTimedout) + else if (r->m_bTimedout && !r->m_pausing) r->m_pauseStamp = r->m_channelTimestamp[r->m_mediaChannel]; return bHasMediaPacket; @@ -1129,6 +1131,8 @@ RTMP_SendPause(RTMP * r, bool DoPause, double dTime) packet.m_nBodySize = enc - packet.m_body; + Log(LOGDEBUG, "%s, %d, pauseTime=%.2f", + __FUNCTION__, DoPause, dTime); return RTMP_SendPacket(r, &packet, true); }