aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoachim Breuer <git@jmbreuer.net>2013-07-13 09:30:43 +0200
committerJoachim Breuer <git@jmbreuer.net>2013-07-13 09:35:34 +0200
commit88fd7aec411ca0deb27dd2d51d64bedeb10057ab (patch)
treecb9948a69dbc3bec7f7e2d1fc061cf65ffe3cdd0 /lib
parent24d9d5005652410baf200599a9ba966d66b90e44 (diff)
Update to rev. 7 from upstream
http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/2012-December/001837.html
Diffstat (limited to 'lib')
-rw-r--r--lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h2
-rw-r--r--lib/libdvd/libdvdnav/src/dvdnav_internal.h3
-rw-r--r--lib/libdvd/libdvdnav/src/searching.c17
-rw-r--r--lib/libdvd/patches/libdvdnav-accurate_seek.diff36
4 files changed, 40 insertions, 18 deletions
diff --git a/lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h b/lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h
index ca3f720ba3..506a2867d3 100644
--- a/lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h
+++ b/lib/libdvd/libdvdnav/src/dvdnav/dvdnav.h
@@ -378,7 +378,7 @@ int64_t dvdnav_get_current_time(dvdnav_t *self);
* Alternative to dvdnav_time_search
*/
dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
- uint64_t time_in_pts_ticks);
+ uint64_t time_in_pts_ticks, int32_t mode);
/*
* Stop playing the current position and start playback of the title
diff --git a/lib/libdvd/libdvdnav/src/dvdnav_internal.h b/lib/libdvd/libdvdnav/src/dvdnav_internal.h
index c60752fdf0..df26014d8d 100644
--- a/lib/libdvd/libdvdnav/src/dvdnav_internal.h
+++ b/lib/libdvd/libdvdnav/src/dvdnav_internal.h
@@ -160,6 +160,9 @@ typedef struct {
*/
#define TMAP_IDX_EDGE_BGN -1
#define TMAP_IDX_EDGE_END -2
+#define JUMP_MODE_TIME_AFTER 1
+#define JUMP_MODE_TIME_DEFAULT 0
+#define JUMP_MODE_TIME_BEFORE -1
typedef struct dvdnav_vobu_s {
int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */
diff --git a/lib/libdvd/libdvdnav/src/searching.c b/lib/libdvd/libdvdnav/src/searching.c
index 2df7212d3b..0115e2fa21 100644
--- a/lib/libdvd/libdvdnav/src/searching.c
+++ b/lib/libdvd/libdvdnav/src/searching.c
@@ -1030,7 +1030,7 @@ static int32_t dvdnav_tmap_search(vts_tmap_t *tmap, uint32_t tmap_len,
}
}
-/* Find the cell for a given sector */
+/* Find the cell for a given time */
static int32_t dvdnav_cell_find(dvdnav_t *this, dvd_state_t *state,
uint64_t find_val, dvdnav_cell_data_t *cell_data) {
uint32_t cells_len = 0;
@@ -1329,9 +1329,16 @@ static int32_t dvdnav_find_vobu_by_cell_boundaries(dvdnav_t *this,
return 1;
}
+/* Jump to sector by time */
+/* NOTE: Mode is currently unimplemented. Only 0 should be passed. */
+/* 1 and -1 are for future implementation */
+/* 0: Default. Jump to a time which may be either <> time_in_pts_ticks */
+/* 1: After. Always jump to a time that is > time_in_pts_ticks */
+/* -1: Before. Always jump to a time that is < time_in_pts_ticks */
dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
- uint64_t time_in_pts_ticks) {
- int32_t result = 1;
+ uint64_t time_in_pts_ticks, int32_t mode) {
+ if (mode != JUMP_MODE_TIME_DEFAULT) return DVDNAV_STATUS_ERR;
+ int32_t result = DVDNAV_STATUS_ERR;
dvd_state_t *state = NULL;
uint32_t sector_off = 0;
dvdnav_pos_data_t *jump = NULL;
@@ -1360,7 +1367,7 @@ dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
/* find sector */
result = dvdnav_find_vobu_by_tmap(this, state, args, cell_data, jump);
- if (!result) {// bad tmap; interpolate over cell
+ if (!result) {/* bad tmap; interpolate over cell */
result = dvdnav_find_vobu_by_cell_boundaries(this, args, cell_data, jump);
if (!result) {
goto exit;
@@ -1379,7 +1386,7 @@ dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
pthread_mutex_lock(&this->vm_lock);
this->vm->hop_channel += HOP_SEEK;
pthread_mutex_unlock(&this->vm_lock);
- result = 1;
+ result = DVDNAV_STATUS_OK;
}
#ifdef LOG_DEBUG
diff --git a/lib/libdvd/patches/libdvdnav-accurate_seek.diff b/lib/libdvd/patches/libdvdnav-accurate_seek.diff
index a97dccee68..efcda5f8d3 100644
--- a/lib/libdvd/patches/libdvdnav-accurate_seek.diff
+++ b/lib/libdvd/patches/libdvdnav-accurate_seek.diff
@@ -1,17 +1,19 @@
More accurate seeking with libdvdnav
applied to current codebase from:
- http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/2011-November/001612.html
+ http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/2012-December/001837.html
full credit goes to gnosygnu, see
http://forum.videolan.org/viewtopic.php?f=32&t=76308&start=20#p316583
+ https://github.com/xbmc/xbmc/pull/2957#issuecomment-20855719
related tickets:
http://trac.xbmc.org/ticket/12212
http://trac.xbmc.org/ticket/14493
+
diff --git a/libdvdnav/src/dvdnav/dvdnav.h b/libdvdnav/src/dvdnav/dvdnav.h
-index 359b951..ca3f720 100644
+index 359b951..506a286 100644
--- a/libdvdnav/src/dvdnav/dvdnav.h
+++ b/libdvdnav/src/dvdnav/dvdnav.h
@@ -373,6 +373,14 @@ dvdnav_status_t dvdnav_sector_search(dvdnav_t *self,
@@ -23,17 +25,17 @@ index 359b951..ca3f720 100644
+ * Alternative to dvdnav_time_search
+ */
+dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
-+ uint64_t time_in_pts_ticks);
++ uint64_t time_in_pts_ticks, int32_t mode);
+
+/*
* Stop playing the current position and start playback of the title
* from the specified timecode.
*
diff --git a/libdvdnav/src/dvdnav_internal.h b/libdvdnav/src/dvdnav_internal.h
-index d64a5ba..c60752f 100644
+index d64a5ba..df26014 100644
--- a/libdvdnav/src/dvdnav_internal.h
+++ b/libdvdnav/src/dvdnav_internal.h
-@@ -125,6 +125,42 @@ typedef struct {
+@@ -125,6 +125,45 @@ typedef struct {
} ATTRIBUTE_PACKED spu_status_t;
#endif
@@ -72,12 +74,15 @@ index d64a5ba..c60752f 100644
+ */
+#define TMAP_IDX_EDGE_BGN -1
+#define TMAP_IDX_EDGE_END -2
++#define JUMP_MODE_TIME_AFTER 1
++#define JUMP_MODE_TIME_DEFAULT 0
++#define JUMP_MODE_TIME_BEFORE -1
+
typedef struct dvdnav_vobu_s {
int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */
int32_t vobu_length;
diff --git a/libdvdnav/src/searching.c b/libdvdnav/src/searching.c
-index a5e48fe..2df7212 100644
+index a5e48fe..0115e2f 100644
--- a/libdvdnav/src/searching.c
+++ b/libdvdnav/src/searching.c
@@ -36,6 +36,7 @@
@@ -88,7 +93,7 @@ index a5e48fe..2df7212 100644
/*
#define LOG_DEBUG
-@@ -805,3 +806,586 @@ dvdnav_status_t dvdnav_set_state(dvdnav_t *this, dvd_state_t *save_state)
+@@ -805,3 +806,593 @@ dvdnav_status_t dvdnav_set_state(dvdnav_t *this, dvd_state_t *save_state)
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
@@ -316,7 +321,7 @@ index a5e48fe..2df7212 100644
+ }
+}
+
-+/* Find the cell for a given sector */
++/* Find the cell for a given time */
+static int32_t dvdnav_cell_find(dvdnav_t *this, dvd_state_t *state,
+ uint64_t find_val, dvdnav_cell_data_t *cell_data) {
+ uint32_t cells_len = 0;
@@ -615,9 +620,16 @@ index a5e48fe..2df7212 100644
+ return 1;
+}
+
++/* Jump to sector by time */
++/* NOTE: Mode is currently unimplemented. Only 0 should be passed. */
++/* 1 and -1 are for future implementation */
++/* 0: Default. Jump to a time which may be either <> time_in_pts_ticks */
++/* 1: After. Always jump to a time that is > time_in_pts_ticks */
++/* -1: Before. Always jump to a time that is < time_in_pts_ticks */
+dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *this,
-+ uint64_t time_in_pts_ticks) {
-+ int32_t result = 1;
++ uint64_t time_in_pts_ticks, int32_t mode) {
++ if (mode != JUMP_MODE_TIME_DEFAULT) return DVDNAV_STATUS_ERR;
++ int32_t result = DVDNAV_STATUS_ERR;
+ dvd_state_t *state = NULL;
+ uint32_t sector_off = 0;
+ dvdnav_pos_data_t *jump = NULL;
@@ -646,7 +658,7 @@ index a5e48fe..2df7212 100644
+
+ /* find sector */
+ result = dvdnav_find_vobu_by_tmap(this, state, args, cell_data, jump);
-+ if (!result) {// bad tmap; interpolate over cell
++ if (!result) {/* bad tmap; interpolate over cell */
+ result = dvdnav_find_vobu_by_cell_boundaries(this, args, cell_data, jump);
+ if (!result) {
+ goto exit;
@@ -665,7 +677,7 @@ index a5e48fe..2df7212 100644
+ pthread_mutex_lock(&this->vm_lock);
+ this->vm->hop_channel += HOP_SEEK;
+ pthread_mutex_unlock(&this->vm_lock);
-+ result = 1;
++ result = DVDNAV_STATUS_OK;
+ }
+
+#ifdef LOG_DEBUG