diff options
author | Jan Schmidt <thaytan@noraisin.net> | 2009-03-25 01:21:28 +0000 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-05-03 12:03:13 -0400 |
commit | 3d2037b110a1ee8a42d9dde8d8dbdb1eb70cf932 (patch) | |
tree | 7cfe52525eb538622490d68f2ea97f6207200a89 | |
parent | 15dd50cc82ca48e4c35863166c5ce8527bd876a6 (diff) | |
download | gst-plugins-bad-3d2037b110a1ee8a42d9dde8d8dbdb1eb70cf932.tar.gz gst-plugins-bad-3d2037b110a1ee8a42d9dde8d8dbdb1eb70cf932.tar.bz2 gst-plugins-bad-3d2037b110a1ee8a42d9dde8d8dbdb1eb70cf932.zip |
resindvd: Support multiangle titles.
Add a workaround for an apparent libdvdnav bug where it loses nav packets
during multiangle titles, and add some keypress bindings to switch the angle.
-rw-r--r-- | ext/resindvd/resindvdsrc.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index 2a7ef8aa..2d98f04b 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -757,9 +757,10 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock) if (new_start_ptm != src->cur_end_ts) { /* Hack because libdvdnav seems to lose a NAV packet during - * angle block changes */ + * angle block changes, triggering a false discont */ GstClockTimeDiff diff = GST_CLOCK_DIFF (src->cur_end_ts, new_start_ptm); - if (src->cur_end_ts == GST_CLOCK_TIME_NONE || diff > 2 * GST_SECOND) { + if (src->cur_end_ts == GST_CLOCK_TIME_NONE || diff > 2 * GST_SECOND || + diff < 0) { discont = TRUE; } } @@ -1209,6 +1210,17 @@ rsn_dvdsrc_handle_navigation_event (resinDvdSrc * src, GstEvent * event) } else if (g_str_equal (key, "period")) { dvdnav_next_pg_search (src->dvdnav); channel_hop = TRUE; + } else if (g_str_equal (key, "bracketleft")) { + gint32 cur, agls; + if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK + && cur > 0 + && dvdnav_angle_change (src->dvdnav, cur - 1) == DVDNAV_STATUS_OK) + g_print ("Switched to angle %d\n", cur - 1); + } else if (g_str_equal (key, "bracketright")) { + gint32 cur, agls; + if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK + && dvdnav_angle_change (src->dvdnav, cur + 1) == DVDNAV_STATUS_OK) + g_print ("Switched to angle %d\n", cur + 1); } else { g_print ("Unknown keypress: %s\n", key); } |