mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
ext/resindvd/resindvdsrc.c: Fix next/prev chapter seeking at the beginning or end.
Original commit message from CVS: * ext/resindvd/resindvdsrc.c: Fix next/prev chapter seeking at the beginning or end. Use 64-bit scaling utility functions for converting MPEG timestamps.
This commit is contained in:
parent
b398d611a4
commit
a1b977dc8b
2 changed files with 21 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-10-07 Jan Schmidt <jan.schmidt@sun.com>
|
||||||
|
|
||||||
|
* ext/resindvd/resindvdsrc.c:
|
||||||
|
Fix next/prev chapter seeking at the beginning or end.
|
||||||
|
Use 64-bit scaling utility functions for converting MPEG
|
||||||
|
timestamps.
|
||||||
|
|
||||||
2008-10-07 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-10-07 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Håvard Graff <havard dot graff at tandberg dot com>
|
Patch by: Håvard Graff <havard dot graff at tandberg dot com>
|
||||||
|
|
|
@ -38,8 +38,10 @@ GST_DEBUG_CATEGORY_STATIC (rsndvdsrc_debug);
|
||||||
#define CLOCK_BASE 9LL
|
#define CLOCK_BASE 9LL
|
||||||
#define CLOCK_FREQ CLOCK_BASE * 10000
|
#define CLOCK_FREQ CLOCK_BASE * 10000
|
||||||
|
|
||||||
#define MPEGTIME_TO_GSTTIME(time) (((time) * (GST_MSECOND/10)) / CLOCK_BASE)
|
#define MPEGTIME_TO_GSTTIME(time) (gst_util_uint64_scale ((time), \
|
||||||
#define GSTTIME_TO_MPEGTIME(time) (((time) * CLOCK_BASE) / (GST_MSECOND/10))
|
GST_MSECOND/10, CLOCK_BASE))
|
||||||
|
#define GSTTIME_TO_MPEGTIME(time) (gst_util_uint64_scale ((time), \
|
||||||
|
CLOCK_BASE, GST_MSECOND/10))
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -1891,8 +1893,16 @@ rsn_dvdsrc_do_seek (RsnBaseSrc * bsrc, GstSegment * segment)
|
||||||
gint32 title, chapters, x;
|
gint32 title, chapters, x;
|
||||||
if (dvdnav_current_title_info (src->dvdnav, &title, &x) ==
|
if (dvdnav_current_title_info (src->dvdnav, &title, &x) ==
|
||||||
DVDNAV_STATUS_OK) {
|
DVDNAV_STATUS_OK) {
|
||||||
if (dvdnav_get_number_of_parts (src->dvdnav, title, &chapters) ==
|
if (segment->start + 1 == x) {
|
||||||
DVDNAV_STATUS_OK) {
|
dvdnav_prev_pg_search (src->dvdnav);
|
||||||
|
ret = TRUE;
|
||||||
|
src->discont = TRUE;
|
||||||
|
} else if (segment->start == x + 1) {
|
||||||
|
dvdnav_next_pg_search (src->dvdnav);
|
||||||
|
ret = TRUE;
|
||||||
|
src->discont = TRUE;
|
||||||
|
} else if (dvdnav_get_number_of_parts (src->dvdnav, title,
|
||||||
|
&chapters) == DVDNAV_STATUS_OK) {
|
||||||
if (segment->start > 0 && segment->start <= chapters) {
|
if (segment->start > 0 && segment->start <= chapters) {
|
||||||
dvdnav_part_play (src->dvdnav, title, segment->start);
|
dvdnav_part_play (src->dvdnav, title, segment->start);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue