summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-04-20 14:18:05 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-04-20 14:18:05 (GMT)
commit011afcdbf0614cc61dd4022448122fe40cfa39ff (patch)
tree42940be5a667efaf6eec97baae0cf067762f5027 /src
parent336cc3d0101ebc6d7a0e2cd509d351951f804368 (diff)
inverted meaning of offset
more output @info level
Diffstat (limited to 'src')
-rw-r--r--src/file_list.c2
-rw-r--r--src/writer.c19
2 files changed, 12 insertions, 9 deletions
diff --git a/src/file_list.c b/src/file_list.c
index c31ecef..c427381 100644
--- a/src/file_list.c
+++ b/src/file_list.c
@@ -45,7 +45,7 @@
static void delete_file(void* element)
{
file_t* deletee = (file_t*)element;
- log_printf(INFO, "removing/closing file '%s'", deletee->path_);
+ log_printf(INFO, "removing/closing file '%s' -> %d", deletee->path_, deletee->fd_);
if(deletee->path_) free(deletee->path_);
if(deletee->fd_ >= 0) close(deletee->fd_);
}
diff --git a/src/writer.c b/src/writer.c
index 4d8d664..8d08cd9 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -70,19 +70,25 @@ static int init_time_boundaries(writer_t* writer)
static void added_cb(GstElement* sink, gint fd, gpointer data)
{
- log_printf(INFO, "fdsink: successfully added client %d", fd);
+ gint num_fds;
+ g_object_get(G_OBJECT(sink), "num_fds", &num_fds, NULL);
+ log_printf(INFO, "fdsink: successfully added client %d (sink has now %d fds)", fd, num_fds);
}
static void removed_cb(GstElement* sink, gint fd, gpointer data)
{
- log_printf(INFO, "fdsink: successfully removed client %d", fd);
+ gint num_fds;
+ g_object_get(G_OBJECT(sink), "num_fds", &num_fds, NULL);
+ log_printf(INFO, "fdsink: successfully removed client %d (sink has now %d fds)", fd, num_fds);
}
static void fdremoved_cb(GstElement* sink, gint fd, gpointer data)
{
- writer_t *writer = (writer_t*)data;
- log_printf(INFO, "fdsink: successfully removed fd %d", fd);
+ gint num_fds;
+ g_object_get(G_OBJECT(sink), "num_fds", &num_fds, NULL);
+ log_printf(INFO, "fdsink: successfully removed fd %d (sink has now %d fds)", fd, num_fds);
+ writer_t *writer = (writer_t*)data;
// call post processing script
file_list_remove(&(writer->files_), fd);
}
@@ -123,15 +129,12 @@ int writer_init(writer_t* writer, GMainLoop *loop, const char* name_format, mode
static void add_fd(writer_t* writer, int fd)
{
log_printf(INFO, "adding fd %d to fdsink", fd);
-// g_object_set(G_OBJECT(writer->sink_), "fd", fd, NULL);
-
g_signal_emit_by_name(G_OBJECT(writer->sink_), "add", fd, NULL);
}
static void remove_fd(writer_t* writer, int fd)
{
log_printf(INFO, "removing fd %d from fdsink", fd);
- // nothing yet
g_signal_emit_by_name(G_OBJECT(writer->sink_), "remove-flush", fd, NULL);
}
@@ -142,7 +145,7 @@ static int check_boundaries(writer_t* writer)
GstClockTime tmp = GST_TIMESPEC_TO_TIME(now);
GstClockTime boundary = GST_TIMESPEC_TO_TIME(writer->next_boundary_);
- tmp += writer->offset_;
+ tmp -= writer->offset_;
if(tmp >= boundary) {
struct tm now_bd;
localtime_r(&(now.tv_sec), &now_bd);