mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst/playback/gstplaybasebin.c: Fix unplayable files error handling. Fixes #158365
Original commit message from CVS: patch by: Ronald Bultje <rbultje@ronald.bitfreak.net> * gst/playback/gstplaybasebin.c: Fix unplayable files error handling. Fixes #158365
This commit is contained in:
parent
d0be35ce38
commit
28d19a542d
2 changed files with 33 additions and 21 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
patch by: Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* gst/playback/gstplaybasebin.c:
|
||||||
|
Fix unplayable files error handling. Fixes #158365
|
||||||
|
|
||||||
2004-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
|
2004-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
patch by: Ronald Bultje <rbultje@ronald.bitfreak.net>
|
patch by: Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
|
@ -309,16 +309,20 @@ group_destroy (GstPlayBaseGroup * group)
|
||||||
* and ready for playback
|
* and ready for playback
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
group_commit (GstPlayBaseBin * play_base_bin)
|
group_commit (GstPlayBaseBin * play_base_bin, gboolean fatal)
|
||||||
{
|
{
|
||||||
GstPlayBaseGroup *group = play_base_bin->building_group;
|
GstPlayBaseGroup *group = play_base_bin->building_group;
|
||||||
GList *prerolls;
|
GList *prerolls;
|
||||||
|
|
||||||
/* if an element signalled a no-more-pads after we stopped due
|
/* if an element signalled a no-more-pads after we stopped due
|
||||||
* to preroll, the group is NULL. This is not an error */
|
* to preroll, the group is NULL. This is not an error */
|
||||||
if (group == NULL)
|
if (group == NULL) {
|
||||||
|
if (!fatal) {
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
GST_DEBUG ("Group loading failed, bailing out");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
GST_DEBUG ("group %p done", group);
|
GST_DEBUG ("group %p done", group);
|
||||||
|
|
||||||
play_base_bin->queued_groups = g_list_append (play_base_bin->queued_groups,
|
play_base_bin->queued_groups = g_list_append (play_base_bin->queued_groups,
|
||||||
|
@ -339,6 +343,7 @@ group_commit (GstPlayBaseBin * play_base_bin)
|
||||||
GST_LOG ("removing preroll signal %s", gst_element_get_name (element));
|
GST_LOG ("removing preroll signal %s", gst_element_get_name (element));
|
||||||
g_signal_handler_disconnect (G_OBJECT (element), sig_id);
|
g_signal_handler_disconnect (G_OBJECT (element), sig_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_mutex_lock (play_base_bin->group_lock);
|
g_mutex_lock (play_base_bin->group_lock);
|
||||||
GST_DEBUG ("signal group done");
|
GST_DEBUG ("signal group done");
|
||||||
|
@ -370,7 +375,7 @@ static void
|
||||||
queue_overrun (GstElement * element, GstPlayBaseBin * play_base_bin)
|
queue_overrun (GstElement * element, GstPlayBaseBin * play_base_bin)
|
||||||
{
|
{
|
||||||
GST_DEBUG ("queue %s overrun", gst_element_get_name (element));
|
GST_DEBUG ("queue %s overrun", gst_element_get_name (element));
|
||||||
group_commit (play_base_bin);
|
group_commit (play_base_bin, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate a preroll element which is simply a queue. While there
|
/* generate a preroll element which is simply a queue. While there
|
||||||
|
@ -499,7 +504,7 @@ no_more_pads (GstElement * element, GstPlayBaseBin * play_base_bin)
|
||||||
/* setup phase */
|
/* setup phase */
|
||||||
GST_DEBUG ("no more pads");
|
GST_DEBUG ("no more pads");
|
||||||
/* we can commit this group for playback now */
|
/* we can commit this group for playback now */
|
||||||
group_commit (play_base_bin);
|
group_commit (play_base_bin, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -750,7 +755,7 @@ state_change (GstElement * element,
|
||||||
if (old_state > new_state) {
|
if (old_state > new_state) {
|
||||||
/* EOS or error occurred, we have to commit the current group */
|
/* EOS or error occurred, we have to commit the current group */
|
||||||
GST_DEBUG ("state changed downwards");
|
GST_DEBUG ("state changed downwards");
|
||||||
group_commit (play_base_bin);
|
group_commit (play_base_bin, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue