1
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4
* Copyright (C) Rouquier Philippe 2008 <bonfire-app@wanadoo.fr>
6
* brasero-vob.c is free software.
8
* You may redistribute it and/or modify it under the terms of the
9
* GNU General Public License, as published by the Free Software
10
* Foundation; either version 2 of the License, or (at your option)
13
* brasero-vob.c is distributed in the hope that it will be useful,
4
* Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
6
* Libbrasero-burn is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* The Libbrasero-burn authors hereby grant permission for non-GPL compatible
12
* GStreamer plugins to be used and distributed together with GStreamer
13
* and Libbrasero-burn. This permission is above and beyond the permissions granted
14
* by the GPL license by which Libbrasero-burn is covered. If you modify this code
15
* you may extend this exception to your version of the code, but you are not
16
* obligated to do so. If you do not wish to do so, delete this exception
17
* statement from your version.
19
* Libbrasero-burn is distributed in the hope that it will be useful,
14
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
* See the GNU General Public License for more details.
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU Library General Public License for more details.
18
24
* You should have received a copy of the GNU General Public License
19
* along with brasero-vob.c. If not, write to:
25
* along with this program; if not, write to:
20
26
* The Free Software Foundation, Inc.,
21
27
* 51 Franklin Street, Fifth Floor
22
28
* Boston, MA 02110-1301, USA.
1131
1137
gst_element_query_duration (priv->pipeline, &format, &duration);
1132
1138
gst_element_query_position (priv->pipeline, &format, &position);
1134
if (duration > 0.0) {
1140
if (duration <= 0.0 || position <= 0.0) {
1141
format = GST_FORMAT_BYTES;
1142
gst_element_query_duration (priv->pipeline, &format, &duration);
1143
gst_element_query_position (priv->pipeline, &format, &position);
1146
if (duration > 0.0 && position > 0.0) {
1135
1147
gdouble progress;
1137
1149
progress = (gdouble) position / (gdouble) duration;
1138
1150
brasero_job_set_progress (job, progress);
1153
brasero_job_set_progress (job, -1.0);
1141
1155
return BRASERO_BURN_OK;