1 --- ./plugins/elements/gstmultiqueue.c-original 2013-01-08 14:40:09.002563354 +0100
2 +++ ./plugins/elements/gstmultiqueue.c 2013-01-08 14:39:45.578850244 +0100
4 GstDataQueueSize max_size, extra_size;
10 /* Protected by global lock */
16 +is_sparse (GstSingleQueue * sq)
18 + return sq->is_sparse;
22 update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
25 /* get bytes and time percentages and take the max */
28 + } else if (is_sparse (sq)) {
32 if (sq->max_size.time > 0) {
33 @@ -1606,15 +1615,26 @@
34 GstSingleQueue *sq = gst_pad_get_element_private (pad);
39 + const gchar *g_type;
41 otherpad = (pad == sq->srcpad) ? sq->sinkpad : sq->srcpad;
43 - GST_LOG_OBJECT (otherpad, "Getting caps from the peer of this pad");
45 result = gst_pad_peer_get_caps (otherpad);
47 result = gst_caps_new_any ();
49 + str = gst_caps_get_structure(result, 0);
50 + g_type = str ? gst_structure_get_name(str) : (const gchar*)"unknown";
52 + GST_LOG_OBJECT (otherpad, "Got caps from the peer of this pad: %s", g_type);
54 + 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") )
56 + GST_INFO_OBJECT (otherpad, "subtitle stream discovered --> set is_sparse to true");
57 + sq->is_sparse = TRUE;
65 GST_LOG_OBJECT (mq, "Checking Queue %d", oq->id);
67 - if (gst_data_queue_is_empty (oq->queue)) {
68 + if (gst_data_queue_is_empty (oq->queue) && !is_sparse (oq)) {
69 GST_LOG_OBJECT (mq, "Queue %d is empty", oq->id);
70 if (IS_FILLED (sq, visible, size.visible)) {
71 sq->max_size.visible = size.visible + 1;
73 * we are checking here.
75 if (sq->is_eos || IS_FILLED (sq, bytes, ssize.bytes) ||
76 - IS_FILLED (sq, time, sq->cur_time)) {
77 + IS_FILLED (sq, time, sq->cur_time) || is_sparse (oq)) {
78 GST_LOG_OBJECT (mq, "Queue %d is filled", oq->id);
82 gst_data_queue_limits_changed (oq->queue);
85 - if (!gst_data_queue_is_empty (oq->queue))
86 + if (!gst_data_queue_is_empty (oq->queue) || is_sparse (oq))
89 GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
91 (GstDataQueueFullCallback) single_queue_overrun_cb,
92 (GstDataQueueEmptyCallback) single_queue_underrun_cb, sq);
94 + sq->is_sparse = FALSE;
96 gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
97 gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);