1 diff -Naur git.org/plugins/elements/gstmultiqueue.c git/plugins/elements/gstmultiqueue.c
2 --- git.org/plugins/elements/gstmultiqueue.c 2013-04-22 23:33:43.840120880 +0200
3 +++ git/plugins/elements/gstmultiqueue.c 2013-04-22 23:37:47.728118492 +0200
5 GstDataQueueSize max_size, extra_size;
11 /* Protected by global lock */
17 +is_sparse (GstSingleQueue * sq)
19 + return sq->is_sparse;
23 update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
26 /* get bytes and time percentages and take the max */
29 + } else if (is_sparse (sq)) {
33 if (sq->max_size.time > 0) {
34 @@ -1609,11 +1618,24 @@
36 otherpad = (pad == sq->srcpad) ? sq->sinkpad : sq->srcpad;
38 - GST_LOG_OBJECT (otherpad, "Getting caps from the peer of this pad");
40 result = gst_pad_peer_get_caps (otherpad);
42 result = gst_caps_new_any ();
46 + const gchar *g_type;
47 + str = gst_caps_get_structure(result, 0);
48 + g_type = str ? gst_structure_get_name(str) : (const gchar*)"unknown";
50 + GST_LOG_OBJECT (otherpad, "Got caps from the peer of this pad: %s", g_type);
52 + if ( !g_strcmp0(g_type, "video/x-dvd-subpicture") || !g_strcmp0(g_type, "text/x-pango-markup") || !g_strcmp0(g_type, "text/plain") || !g_strcmp0(g_type, "subpicture/x-pgs") || !g_strcmp0(g_type, "subpicture/x-ass") )
54 + GST_INFO_OBJECT (otherpad, "subtitle stream discovered --> set is_sparse to true");
55 + sq->is_sparse = TRUE;
63 GST_LOG_OBJECT (mq, "Checking Queue %d", oq->id);
65 - if (gst_data_queue_is_empty (oq->queue)) {
66 + if (gst_data_queue_is_empty (oq->queue) && !is_sparse (oq)) {
67 GST_LOG_OBJECT (mq, "Queue %d is empty", oq->id);
68 if (IS_FILLED (sq, visible, size.visible)) {
69 sq->max_size.visible = size.visible + 1;
71 * we are checking here.
73 if (sq->is_eos || IS_FILLED (sq, bytes, ssize.bytes) ||
74 - IS_FILLED (sq, time, sq->cur_time)) {
75 + IS_FILLED (sq, time, sq->cur_time) || is_sparse (oq)) {
76 GST_LOG_OBJECT (mq, "Queue %d is filled", oq->id);
80 gst_data_queue_limits_changed (oq->queue);
83 - if (!gst_data_queue_is_empty (oq->queue))
84 + if (!gst_data_queue_is_empty (oq->queue) || is_sparse (oq))
87 GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
89 (GstDataQueueFullCallback) single_queue_overrun_cb,
90 (GstDataQueueEmptyCallback) single_queue_underrun_cb, sq);
92 + sq->is_sparse = FALSE;
94 gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
95 gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);