Fix task creation again.

Original commit message from CVS:
Fix task creation again.
This commit is contained in:
Wim Taymans 2005-01-18 13:30:13 +00:00
parent 864a9acf69
commit 0a4f48bd55
3 changed files with 23 additions and 18 deletions

View file

@ -1,3 +1,10 @@
2005-01-18 Wim Taymans <wim@fluendo.com>
* gst/elements/gstfilesrc.c: (gst_filesrc_getrange),
(gst_filesrc_open_file), (gst_filesrc_activate),
(filesrc_find_peek), (gst_filesrc_type_find):
Fix task creation again.
2005-01-18 Wim Taymans <wim@fluendo.com>
* docs/design/part-states.txt:

View file

@ -929,18 +929,17 @@ gst_filesrc_activate (GstPad * pad, GstActivateMode mode)
switch (mode) {
case GST_ACTIVATE_PUSH:
/* try to start the task */
GST_STREAM_LOCK (pad);
filesrc->task = gst_element_create_task (GST_ELEMENT (filesrc),
(GstTaskFunction) gst_filesrc_loop, filesrc);
/* if we have a scheduler we can start the task */
if (GST_ELEMENT_SCHEDULER (filesrc)) {
GST_STREAM_LOCK (pad);
GST_RPAD_TASK (pad) =
gst_scheduler_create_task (GST_ELEMENT_SCHEDULER (filesrc),
(GstTaskFunction) gst_filesrc_loop, pad);
if (filesrc->task) {
gst_task_start (filesrc->task);
gst_task_start (GST_RPAD_TASK (pad));
result = TRUE;
} else {
result = FALSE;
GST_STREAM_UNLOCK (pad);
}
GST_STREAM_UNLOCK (pad);
break;
case GST_ACTIVATE_PULL:
result = TRUE;

View file

@ -929,18 +929,17 @@ gst_filesrc_activate (GstPad * pad, GstActivateMode mode)
switch (mode) {
case GST_ACTIVATE_PUSH:
/* try to start the task */
GST_STREAM_LOCK (pad);
filesrc->task = gst_element_create_task (GST_ELEMENT (filesrc),
(GstTaskFunction) gst_filesrc_loop, filesrc);
/* if we have a scheduler we can start the task */
if (GST_ELEMENT_SCHEDULER (filesrc)) {
GST_STREAM_LOCK (pad);
GST_RPAD_TASK (pad) =
gst_scheduler_create_task (GST_ELEMENT_SCHEDULER (filesrc),
(GstTaskFunction) gst_filesrc_loop, pad);
if (filesrc->task) {
gst_task_start (filesrc->task);
gst_task_start (GST_RPAD_TASK (pad));
result = TRUE;
} else {
result = FALSE;
GST_STREAM_UNLOCK (pad);
}
GST_STREAM_UNLOCK (pad);
break;
case GST_ACTIVATE_PULL:
result = TRUE;