#define MAX_PRINT_LEN 2048
-AMF_LogLevel debuglevel = LOGERROR;
+AMF_LogLevel AMF_debuglevel = LOGERROR;
static int neednl;
len = vsnprintf(str, MAX_PRINT_LEN-1, format, args);
va_end(args);
- if ( debuglevel==LOGCRIT )
+ if ( AMF_debuglevel==LOGCRIT )
return;
if ( !fmsg ) fmsg = stderr;
vsnprintf(str, MAX_PRINT_LEN-1, format, args);
va_end(args);
- if ( debuglevel==LOGCRIT )
+ if ( AMF_debuglevel==LOGCRIT )
return;
if ( !fmsg ) fmsg = stderr;
va_end(args);
// Filter out 'no-name'
- if ( debuglevel<LOGALL && strstr(str, "no-name" ) != NULL )
+ if ( AMF_debuglevel<LOGALL && strstr(str, "no-name" ) != NULL )
return;
if ( !fmsg ) fmsg = stderr;
- if ( level <= debuglevel ) {
+ if ( level <= AMF_debuglevel ) {
if (neednl) {
putc('\n', fmsg);
neednl = 0;
void LogHex(int level, const char *data, unsigned long len)
{
unsigned long i;
- if ( level > debuglevel )
+ if ( level > AMF_debuglevel )
return;
for(i=0; i<len; i++) {
LogPrintf("%02X ", (unsigned char)data[i]);
char line[BP_LEN];
unsigned long i;
- if ( !data || level > debuglevel )
+ if ( !data || level > AMF_debuglevel )
return;
/* in case len is zero */
#define LogPrintf AMF_LogPrintf
#define LogSetOutput AMF_LogSetOutput
#define LogStatus AMF_LogStatus
-#define debuglevel AMF_debuglevel
-extern AMF_LogLevel debuglevel;
+extern AMF_LogLevel AMF_debuglevel;
void LogSetOutput(FILE *file);
void LogPrintf(const char *format, ...);
packet.m_nBodySize = enc - packet.m_body;
+ r->m_read.flags |= RTMP_READ_SEEKING;
+ r->m_read.nResumeTS = (int)dTime;
+
return RTMP_SendPacket(r, &packet, true);
}
static const AVal av_NetStream_Play_Start = AVC("NetStream.Play.Start");
static const AVal av_NetStream_Play_Complete = AVC("NetStream.Play.Complete");
static const AVal av_NetStream_Play_Stop = AVC("NetStream.Play.Stop");
+static const AVal av_NetStream_Seek_Notify = AVC("NetStream.Seek.Notify");
+static const AVal av_NetStream_Pause_Notify = AVC("NetStream.Pause.Notify");
// Returns 0 for OK/Failed/error, 1 for 'Stop or Complete'
static int
Log(LOGERROR, "Closing connection: %s", code.av_val);
}
- if (AVMATCH(&code, &av_NetStream_Play_Start))
+ else if (AVMATCH(&code, &av_NetStream_Play_Start))
{
int i;
r->m_bPlaying = true;
}
// Return 1 if this is a Play.Complete or Play.Stop
- if (AVMATCH(&code, &av_NetStream_Play_Complete)
+ else if (AVMATCH(&code, &av_NetStream_Play_Complete)
|| AVMATCH(&code, &av_NetStream_Play_Stop))
{
RTMP_Close(r);
ret = 1;
}
+
+ else if (AVMATCH(&code, &av_NetStream_Seek_Notify))
+ {
+ r->m_read.flags &= ~RTMP_READ_SEEKING;
+ }
+
+ else if (AVMATCH(&code, &av_NetStream_Pause_Notify))
+ {
+ if (r->m_pausing == 1 || r->m_pausing == 2)
+ {
+ RTMP_SendPause(r, false, r->m_pauseStamp);
+ r->m_pausing = 3;
+ }
+ }
}
else
{
ret = RTMP_READ_IGNORE;
break;
}
+
+ if (r->m_read.flags & RTMP_READ_SEEKING)
+ {
+ ret = RTMP_READ_IGNORE;
+ break;
+ }
#if 1 /* _DEBUG */
Log(LOGDEBUG, "type: %02X, size: %d, TS: %d ms, abs TS: %d",
packet.m_packetType, nPacketLen, packet.m_nTimeStamp,
r->m_read.flags |= RTMP_READ_HEADER;
}
+ if ((r->m_read.flags & RTMP_READ_SEEKING) && r->m_read.buf)
+ {
+ /* drop whatever's here */
+ free(r->m_read.buf);
+ r->m_read.buf = NULL;
+ r->m_read.bufpos = NULL;
+ r->m_read.buflen = 0;
+ }
+
/* If there's leftover data buffered, use it up */
if (r->m_read.buf)
{