mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
bluez: Handle EOF in avdtpsrc correctly
This commit is contained in:
parent
49fa7ac6b2
commit
6b1ccb8685
1 changed files with 9 additions and 2 deletions
|
@ -312,6 +312,12 @@ gst_avdtp_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||
|
||||
if (ret < 0)
|
||||
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);
|
||||
|
||||
|
@ -325,11 +331,12 @@ gst_avdtp_src_create (GstBaseSrc * bsrc, guint64 offset,
|
|||
return GST_FLOW_OK;
|
||||
|
||||
read_error:
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
GST_ERROR_OBJECT (avdtpsrc, "Error while reading audio data: %s",
|
||||
strerror (errno));
|
||||
|
||||
eof:
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue