[FFmpeg-soc] [soc]: r4476 - rtmp/rtmpdec.c

kostya subversion at mplayerhq.hu
Thu Jun 18 06:17:14 CEST 2009


Author: kostya
Date: Thu Jun 18 06:17:14 2009
New Revision: 4476

Log:
Introduce state for future switch to event-driven behaviour

Modified:
   rtmp/rtmpdec.c

Modified: rtmp/rtmpdec.c
==============================================================================
--- rtmp/rtmpdec.c	Thu Jun 18 06:15:40 2009	(r4475)
+++ rtmp/rtmpdec.c	Thu Jun 18 06:17:14 2009	(r4476)
@@ -36,10 +36,18 @@
 #include "rtmp.h"
 #include "rtmppkt.h"
 
+typedef enum {
+    STATE_START,
+    STATE_HANDSHAKED,
+    STATE_CONNECTING,
+    STATE_PLAYING,
+} ClientState;
+
 typedef struct RTMPState {
     URLContext *rtmp_hd;
     RTMPPacketHistory rhist, whist;
     char playpath[256];
+    ClientState state;
 } RTMPState;
 
 #define PLAYER_KEY_OPEN_PART_LEN 30
@@ -346,9 +354,11 @@ static int rtmp_read_header(AVFormatCont
         port = RTMP_DEFAULT_PORT;
     snprintf(buf, sizeof(buf), "tcp://%s:%d", hostname, port);
     url_open(&rt->rtmp_hd, buf, URL_RDWR);
+    rt->state = STATE_START;
     if (rtmp_handshake(s, rt))
         return -1;
 
+    rt->state = STATE_HANDSHAKED;
     //extract "app" part from path
     if (!strncmp(path, "/ondemand/", 10)) {
         fname = path + 10;


More information about the FFmpeg-soc mailing list