Track stream state

Keep track of the stream state better
This commit is contained in:
Wim Taymans 2015-09-30 10:51:38 +02:00
parent 205a471e49
commit dbeee31c89
2 changed files with 6 additions and 1 deletions

View file

@ -272,7 +272,7 @@ fdpayload_data_destroy (gpointer user_data)
pinos_buffer_builder_end (&b, &pbuf);
GST_OBJECT_LOCK (pinossrc);
if (pinossrc->stream)
if (pinossrc->stream_state == PINOS_STREAM_STATE_STREAMING)
pinos_stream_send_buffer (pinossrc->stream, &pbuf);
GST_OBJECT_UNLOCK (pinossrc);
@ -379,6 +379,10 @@ on_stream_notify (GObject *gobject,
GST_DEBUG ("got stream state %d", state);
GST_OBJECT_LOCK (pinossrc);
pinossrc->stream_state = state;
GST_OBJECT_UNLOCK (pinossrc);
switch (state) {
case PINOS_STREAM_STATE_UNCONNECTED:
case PINOS_STREAM_STATE_CONNECTING:

View file

@ -61,6 +61,7 @@ struct _GstPinosSrc {
PinosMainLoop *loop;
PinosContext *ctx;
PinosStream *stream;
PinosStreamState stream_state;
GstAllocator *fd_allocator;
GstBuffer *current;