[vlc-devel] [PATCH][GSoC 09]RTMP implementation (Input part)

Rémi Denis-Courmont remi at remlab.net
Fri Aug 28 17:20:36 CEST 2009


Le mardi 25 août 2009 20:29:13 zhigang wang, vous avez écrit :
> Hi,
> I worked on RTMP streaming implementation for the GSoC project,
> Now the patch of RTMP access module is posted here for the code review.
> Because some of the codes are common for RTMP input and output (e.g. AMF
> packages decoding and encoding), I had put all the common part in this
> patch.

         /* */
         case ACCESS_SET_PAUSE_STATE:
-            /* Nothing to do */
+            pb_bool = (bool*)va_arg( args, bool* );
+#ifdef DEBUG_RTMP
+            msg_Dbg(p_access, "ACCESS_SET_PAUSE_STATE: %d", (int)pb_bool);
+#endif
             break;

I think the parameter is 'int' not 'bool*'.

 
+        case ACCESS_SET_SEEKPOINT:
+            i_64 = (int64_t) va_arg( args, int64_t );
+#ifdef DEBUG_RTMP
+            msg_Dbg(p_access, "ACCESS_SET_SEEKPOINT: "PRId64, i_64);
+#endif
+            int i_ret = rtmp_seek( p_access, i_64);
+            sleep(2);
+            if (i_ret < 0) return VLC_EGENERIC;
+            return VLC_SUCCESS;

You cannot use sleep() inside VLC as it is not thread-safe. You should use 
msleep(2 * CLOCK_FREQ) instead, if you really cannot avoid the two seconds 
delay.

-static void rtmp_handler_invoke     ( rtmp_control_thread_t *p_thread, 
rtmp_packet_t *rtmp_packet );
+static int rtmp_handler_invoke     ( rtmp_control_thread_t *p_thread, 
rtmp_packet_t *rtmp_packet );

Looks like an accidental change here.

+	usleep(1000 * 500);

Again, this should be msleep()


-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list