bluez: Handle EOF in avdtpsrc correctly
This commit is contained in:
parent
49fa7ac6b2
commit
6b1ccb8685
@ -312,6 +312,12 @@ gst_avdtp_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto read_error;
|
goto read_error;
|
||||||
|
else if (ret == 0) {
|
||||||
|
GST_ERROR_OBJECT (avdtpsrc, "Got EOF on the transport fd");
|
||||||
|
GST_ELEMENT_ERROR ((avdtpsrc), RESOURCE, FAILED, ("Disconnected"
|
||||||
|
" from remote device"), (NULL));
|
||||||
|
goto eof;
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (avdtpsrc, "Read %d bytes", ret);
|
GST_LOG_OBJECT (avdtpsrc, "Read %d bytes", ret);
|
||||||
|
|
||||||
@ -325,11 +331,12 @@ gst_avdtp_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
read_error:
|
read_error:
|
||||||
gst_buffer_unref (buf);
|
|
||||||
|
|
||||||
GST_ERROR_OBJECT (avdtpsrc, "Error while reading audio data: %s",
|
GST_ERROR_OBJECT (avdtpsrc, "Error while reading audio data: %s",
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
|
|
||||||
|
eof:
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user