summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_dvd.c16
-rw-r--r--src/input/libdvdnav/dvdnav.c11
-rw-r--r--src/input/libdvdnav/dvdnav_events.h3
3 files changed, 25 insertions, 5 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index f945f0fe2..b36edb934 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.141 2003/04/04 19:20:48 miguelfreitas Exp $
+ * $Id: input_dvd.c,v 1.142 2003/04/05 12:28:16 miguelfreitas Exp $
*
*/
@@ -150,6 +150,7 @@ typedef struct {
time_t pause_end_time;
int64_t pg_length;
int64_t pgc_length;
+ int64_t cell_start;
int32_t buttonN;
int typed_buttonN;/* for XINE_EVENT_INPUT_NUMBER_* */
@@ -627,6 +628,7 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen,
this->pg_length = cell_event->pg_length;
this->pgc_length = cell_event->pgc_length;
+ this->cell_start = cell_event->cell_start;
}
break;
case DVDNAV_HOP_CHANNEL:
@@ -702,12 +704,16 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen,
if (this->pg_length && this->pgc_length) {
int pos, length;
dvdnav_get_position(this->dvdnav, &pos, &length);
+ buf->extra_info->input_pos = pos * (off_t)DVD_BLOCK_SIZE;
+ buf->extra_info->input_length = length * (off_t)DVD_BLOCK_SIZE;
switch (((dvd_input_class_t *)this->input_plugin.input_class)->seek_mode) {
case 0: /* PGC based seeking */
- buf->extra_info->input_time = this->pgc_length * pos / (length * 90);
+ buf->extra_info->total_time = this->pgc_length / 90;
+ buf->extra_info->input_time = this->cell_start / 90;
break;
case 1: /* PG based seeking */
- buf->extra_info->input_time = this->pg_length * pos / (length * 90);
+ buf->extra_info->total_time = this->pg_length / 90;
+ buf->extra_info->input_time = 0;
break;
}
}
@@ -1627,6 +1633,10 @@ static void *init_class (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.142 2003/04/05 12:28:16 miguelfreitas
+ * "perfect" time display for dvds
+ * (see thread on xine-devel for details)
+ *
* Revision 1.141 2003/04/04 19:20:48 miguelfreitas
* add initial async error/general message reporting to frontend
* obs: more messages should be added
diff --git a/src/input/libdvdnav/dvdnav.c b/src/input/libdvdnav/dvdnav.c
index 5cbc17615..bf9002ef7 100644
--- a/src/input/libdvdnav/dvdnav.c
+++ b/src/input/libdvdnav/dvdnav.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dvdnav.c,v 1.21 2003/04/01 09:02:43 jcdutton Exp $
+ * $Id: dvdnav.c,v 1.22 2003/04/05 12:28:16 miguelfreitas Exp $
*
*/
@@ -602,6 +602,11 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, unsigned char **buf,
cell_event->pg_length +=
dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
cell_event->pgc_length = dvdnav_convert_time(&state->pgc->playback_time);
+
+ cell_event->cell_start = 0;
+ for (i = 1; i < state->cellN; i++)
+ cell_event->cell_start +=
+ dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time);
this->position_current.cell = this->position_next.cell;
this->position_current.cell_restart = this->position_next.cell_restart;
@@ -1018,6 +1023,10 @@ uint32_t dvdnav_get_next_still_flag(dvdnav_t *this) {
/*
* $Log: dvdnav.c,v $
+ * Revision 1.22 2003/04/05 12:28:16 miguelfreitas
+ * "perfect" time display for dvds
+ * (see thread on xine-devel for details)
+ *
* Revision 1.21 2003/04/01 09:02:43 jcdutton
* Get libdvdnav to build in DEBUG and TRACE mode.
*
diff --git a/src/input/libdvdnav/dvdnav_events.h b/src/input/libdvdnav/dvdnav_events.h
index 95f1e23ad..918e5df3d 100644
--- a/src/input/libdvdnav/dvdnav_events.h
+++ b/src/input/libdvdnav/dvdnav_events.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dvdnav_events.h,v 1.8 2003/03/25 13:17:21 mroi Exp $
+ * $Id: dvdnav_events.h,v 1.9 2003/04/05 12:28:16 miguelfreitas Exp $
*
*/
@@ -99,6 +99,7 @@ typedef struct {
int64_t cell_length; /*!< The length of the current cell in PTS ticks */
int64_t pg_length; /*!< The length of the current program in PTS ticks */
int64_t pgc_length; /*!< The length of the current program chain in PTS ticks */
+ int64_t cell_start; /*!< The start of the current cell in PTS ticks */
} dvdnav_cell_change_event_t;
/* FIXME: These are unused. */