diff options
author | Dave Robillard <dave@drobilla.net> | 2009-08-15 17:26:39 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-08-15 17:26:39 -0400 |
commit | 9a9917e89144923a79acaf8745ba7b958feda2a4 (patch) | |
tree | 46b8383d03acd11adb6d085abd32b44e5913da63 /ext | |
parent | e46ff7bda0f7996b456476dccb4a822688a690fb (diff) | |
parent | 2aa6fa29edf380a40c962a85aad3501950c71492 (diff) | |
download | gst-plugins-bad-9a9917e89144923a79acaf8745ba7b958feda2a4.tar.gz gst-plugins-bad-9a9917e89144923a79acaf8745ba7b958feda2a4.tar.bz2 gst-plugins-bad-9a9917e89144923a79acaf8745ba7b958feda2a4.zip |
Merge branch 'master' of git://anongit.freedesktop.org/gstreamer/gst-plugins-bad into fdo
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mimic/gstmimenc.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c index 4a65b9fd..ef60d20d 100644 --- a/ext/mimic/gstmimenc.c +++ b/ext/mimic/gstmimenc.c @@ -378,15 +378,15 @@ gst_mimenc_create_tcp_header (GstMimEnc * mimenc, guint32 payload_size, GST_BUFFER_TIMESTAMP (buf_header) = timestamp; p[0] = 24; - *((guchar *) (p + 1)) = paused ? 1 : 0; - *((guint16 *) (p + 2)) = GUINT16_TO_LE (mimenc->width); - *((guint16 *) (p + 4)) = GUINT16_TO_LE (mimenc->height); - *((guint16 *) (p + 6)) = keyframe ? 1 : 0; - *((guint32 *) (p + 8)) = GUINT32_TO_LE (payload_size); - *((guint32 *) (p + 12)) = paused ? 0 : - GUINT32_TO_LE (GST_MAKE_FOURCC ('M', 'L', '2', '0')); - *((guint32 *) (p + 16)) = 0; - *((guint32 *) (p + 20)) = timestamp / GST_MSECOND; + p[1] = paused ? 1 : 0; + GST_WRITE_UINT16_LE (p + 2, mimenc->width); + GST_WRITE_UINT16_LE (p + 4, mimenc->height); + GST_WRITE_UINT16_LE (p + 6, keyframe ? 1 : 0); + GST_WRITE_UINT32_LE (p + 8, payload_size); + GST_WRITE_UINT16_LE (p + 12, paused ? 0 : + GST_MAKE_FOURCC ('M', 'L', '2', '0')); + GST_WRITE_UINT32_LE (p + 16, 0); + GST_WRITE_UINT32_LE (p + 20, timestamp / GST_MSECOND); return buf_header; } @@ -593,10 +593,19 @@ gst_mimenc_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_PLAYING: GST_OBJECT_LOCK (mimenc); mimenc->stop_paused_mode = FALSE; - if (mimenc->last_buffer == GST_CLOCK_TIME_NONE) - mimenc->last_buffer = gst_clock_get_time (GST_ELEMENT_CLOCK (mimenc)) - - GST_ELEMENT_CAST (mimenc)->base_time; paused_mode = mimenc->paused_mode; + if (paused_mode) { + if (!GST_ELEMENT_CLOCK (mimenc)) { + GST_OBJECT_UNLOCK (mimenc); + GST_ELEMENT_ERROR (mimenc, RESOURCE, FAILED, + ("Using paused-mode requires a clock, but no clock was provided" + " to the element"), (NULL)); + return GST_STATE_CHANGE_FAILURE; + } + if (mimenc->last_buffer == GST_CLOCK_TIME_NONE) + mimenc->last_buffer = gst_clock_get_time (GST_ELEMENT_CLOCK (mimenc)) + - GST_ELEMENT_CAST (mimenc)->base_time; + } GST_OBJECT_UNLOCK (mimenc); if (paused_mode) { if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) { |