rtph263depay: reset start variable properly

This commit is contained in:
Wim Taymans 2009-12-22 14:27:40 +01:00 committed by Wim Taymans
parent 74b3439374
commit 27ff4a8a47

View file

@ -127,7 +127,6 @@ gst_rtp_h263_depay_init (GstRtpH263Depay * rtph263depay,
rtph263depay->offset = 0; rtph263depay->offset = 0;
rtph263depay->leftover = 0; rtph263depay->leftover = 0;
rtph263depay->start = TRUE;
} }
static void static void
@ -274,7 +273,7 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
} }
if (!EBIT) { if (!EBIT) {
if(rtph263depay->start){ if (rtph263depay->start) {
GstBuffer *tmp = gst_buffer_new_and_alloc (payload_len); GstBuffer *tmp = gst_buffer_new_and_alloc (payload_len);
/* Copy the entire buffer */ /* Copy the entire buffer */
@ -282,7 +281,7 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
gst_adapter_push (rtph263depay->adapter, tmp); gst_adapter_push (rtph263depay->adapter, tmp);
} }
} else { } else {
if(rtph263depay->start){ if (rtph263depay->start) {
GstBuffer *tmp = gst_buffer_new_and_alloc (payload_len - 1); GstBuffer *tmp = gst_buffer_new_and_alloc (payload_len - 1);
/* Copy the entire buffer except for the last byte */ /* Copy the entire buffer except for the last byte */
@ -299,7 +298,7 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
} }
if (M) { if (M) {
if(rtph263depay->start){ if (rtph263depay->start) {
/* frame is completed */ /* frame is completed */
guint avail; guint avail;
guint32 timestamp; guint32 timestamp;
@ -325,7 +324,7 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
gst_base_rtp_depayload_push_ts (depayload, timestamp, outbuf); gst_base_rtp_depayload_push_ts (depayload, timestamp, outbuf);
rtph263depay->offset = 0; rtph263depay->offset = 0;
rtph263depay->leftover = 0; rtph263depay->leftover = 0;
}else{ } else {
rtph263depay->start = TRUE; rtph263depay->start = TRUE;
} }
} }
@ -347,6 +346,7 @@ gst_rtp_h263_depay_change_state (GstElement * element,
break; break;
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_adapter_clear (rtph263depay->adapter); gst_adapter_clear (rtph263depay->adapter);
rtph263depay->start = TRUE;
break; break;
default: default:
break; break;