From: Wim Taymans Date: Fri, 3 Nov 2006 09:40:03 +0000 (+0000) Subject: plugins/elements/gstfdsrc.c: Add some debugging. X-Git-Tag: RELEASE-0_10_11~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=706d4bf73f98689a048008deb2680c4603dad56f;p=platform%2Fupstream%2Fgstreamer.git 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. --- diff --git a/ChangeLog b/ChangeLog index 06a1140..1b65c88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-11-03 Wim Taymans + + * 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 * plugins/elements/gstfilesrc.c: (gst_file_src_create_mmap): diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index dc9a0e6..c1f90c0 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -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; + + g_free (src->uri); + src->uri = g_strdup_printf ("fd://%d", src->fd); + + if (fstat (src->fd, &stat_results) < 0) + goto not_seekable; - if (!S_ISREG (stat_results.st_mode)) - goto not_seekable; + 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; + /* Try a seek of 0 bytes offset to check for seekability */ + if (lseek (src->fd, 0, SEEK_CUR) < 0) + goto not_seekable; - src->seekable_fd = TRUE; + 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)