mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
plugins/elements/gstfdsrc.c: Add some debugging.
Original commit message from CVS: * plugins/elements/gstfdsrc.c: (gst_fd_src_update_fd), (gst_fd_src_create): Add some debugging. Only update fd when it's different from the old.
This commit is contained in:
parent
9e24b65bfa
commit
706d4bf73f
2 changed files with 31 additions and 13 deletions
|
@ -1,3 +1,10 @@
|
|||
2006-11-03 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* plugins/elements/gstfdsrc.c: (gst_fd_src_update_fd),
|
||||
(gst_fd_src_create):
|
||||
Add some debugging.
|
||||
Only update fd when it's different from the old.
|
||||
|
||||
2006-11-02 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* plugins/elements/gstfilesrc.c: (gst_file_src_create_mmap):
|
||||
|
|
|
@ -192,26 +192,34 @@ gst_fd_src_update_fd (GstFdSrc * src)
|
|||
{
|
||||
struct stat stat_results;
|
||||
|
||||
src->fd = src->new_fd;
|
||||
GST_INFO_OBJECT (src, "Updating to fd %d", src->fd);
|
||||
g_free (src->uri);
|
||||
src->uri = g_strdup_printf ("fd://%d", src->fd);
|
||||
if (src->fd != src->new_fd) {
|
||||
GST_INFO_OBJECT (src, "Updating to fd %d", src->new_fd);
|
||||
|
||||
if (fstat (src->fd, &stat_results) < 0)
|
||||
goto not_seekable;
|
||||
src->fd = src->new_fd;
|
||||
|
||||
if (!S_ISREG (stat_results.st_mode))
|
||||
goto not_seekable;
|
||||
g_free (src->uri);
|
||||
src->uri = g_strdup_printf ("fd://%d", src->fd);
|
||||
|
||||
/* Try a seek of 0 bytes offset to check for seekability */
|
||||
if (lseek (src->fd, 0, SEEK_CUR) < 0)
|
||||
goto not_seekable;
|
||||
if (fstat (src->fd, &stat_results) < 0)
|
||||
goto not_seekable;
|
||||
|
||||
src->seekable_fd = TRUE;
|
||||
if (!S_ISREG (stat_results.st_mode))
|
||||
goto not_seekable;
|
||||
|
||||
/* Try a seek of 0 bytes offset to check for seekability */
|
||||
if (lseek (src->fd, 0, SEEK_CUR) < 0)
|
||||
goto not_seekable;
|
||||
|
||||
GST_INFO_OBJECT (src, "marking fd %d as seekable", src->fd);
|
||||
src->seekable_fd = TRUE;
|
||||
}
|
||||
return;
|
||||
|
||||
not_seekable:
|
||||
src->seekable_fd = FALSE;
|
||||
{
|
||||
GST_INFO_OBJECT (src, "marking fd %d as NOT seekable", src->fd);
|
||||
src->seekable_fd = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -341,6 +349,8 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
gchar command;
|
||||
int res;
|
||||
|
||||
GST_LOG_OBJECT (src, "reading command");
|
||||
|
||||
READ_COMMAND (src, command, res);
|
||||
if (res < 0) {
|
||||
GST_LOG_OBJECT (src, "no more commands");
|
||||
|
@ -359,6 +369,7 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
|
||||
do {
|
||||
readbytes = read (src->fd, GST_BUFFER_DATA (buf), blocksize);
|
||||
GST_LOG_OBJECT (src, "read %d", readbytes);
|
||||
} while (readbytes == -1 && errno == EINTR); /* retry if interrupted */
|
||||
|
||||
if (readbytes < 0)
|
||||
|
|
Loading…
Reference in a new issue