阅读背景:

Gstreamer rtspsrc 停止不发送teardown 命令

来源:互联网 

修改 gstrtspsrc.c   

参考加粗字体

1. 

 <pre name="code" class="cpp">gst_rtspsrc_loop_send_cmd (GstRTSPSrc * src, gint cmd, gint mask)
{
  gint old;
  gboolean flushed = FALSE;

  /* start new request */
  gst_rtspsrc_loop_start_cmd (src, cmd);

  GST_DEBUG_OBJECT (src, "sending cmd %s", cmd_to_string (cmd));

  GST_OBJECT_LOCK (src);
  old = src->pending_cmd;
  if (old == CMD_RECONNECT) {
    GST_DEBUG_OBJECT (src, "ignore, we were reconnecting");
    cmd = CMD_RECONNECT;
  }
<strong><strong>  // vvv ----- Patch----
  else if (old == CMD_CLOSE) {
	  /* our CMD_CLOSE might have interrutped CMD_LOOP. gst_rtspsrc_loop
	   * will send a CMD_WAIT which would cancel our pending CMD_CLOSE (if
	    * still pending). We just avoid it here by making sure CMD_CLOSE is
	    * * still the pending command. */
	  GST_DEBUG_OBJECT (src, "ignore, we were closing");
  }
  //if (old != CMD_WAIT) {
  else if (old != CMD_WAIT) {
 // ^^^  ---- Patch ---</strong></strong>

    src->pending_cmd = CMD_WAIT;
    GST_OBJECT_UNLOCK (src);
    /* cancel previous request */
    GST_DEBUG_OBJECT (src, "cancel previous request %s", cmd_to_string (old));
    gst_rtspsrc_loop_cancel_cmd (src, old);
    GST_OBJECT_LOCK (src);
  } <pre



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: