#define DEFAULT_DEVICE "/dev/dvd"
#define DEFAULT_FASTSTART TRUE
+#define DEFAULT_LANG "en"
#define GST_FLOW_WOULD_BLOCK GST_FLOW_CUSTOM_SUCCESS
rsn_dvdsrc_start (GstBaseSrc * bsrc)
{
resinDvdSrc *src = RESINDVDSRC (bsrc);
+ const gchar *const *langs, *const *cur;
+ gchar lang[8];
g_mutex_lock (src->dvd_lock);
if (!read_vts_info (src)) {
goto fail;
}
+ /* Attempt to set DVD menu, audio and spu languages */
+ langs = g_get_language_names ();
+ strncpy (lang, DEFAULT_LANG, 8);
+ for (cur = langs; *cur != NULL; cur++) {
+ /* Look for a 2 char iso-639 lang */
+ if (strlen (*cur) == 2) {
+ strncpy (lang, *cur, 8);
+ break;
+ }
+ }
+ /* Set the user's preferred language */
+ dvdnav_menu_language_select (src->dvdnav, lang);
+ dvdnav_audio_language_select (src->dvdnav, lang);
+ dvdnav_spu_language_select (src->dvdnav, lang);
+
if (src->faststart) {
if (dvdnav_title_play (src->dvdnav, 1) != DVDNAV_STATUS_OK ||
(dvdnav_menu_call (src->dvdnav, DVD_MENU_Title) != DVDNAV_STATUS_OK &&
dvdnav_audio_stream_change_event_t *event =
(dvdnav_audio_stream_change_event_t *) data;
+ rsn_dvdsrc_prepare_audio_stream_event (src,
+ event->logical, event->physical);
GST_DEBUG_OBJECT (src, " physical: %d", event->physical);
GST_DEBUG_OBJECT (src, " logical: %d", event->logical);
- rsn_dvdsrc_prepare_audio_stream_event (src,
- event->logical, event->physical);
break;
}
case DVDNAV_SPU_STREAM_CHANGE:{
GST_LOG_OBJECT (src, "handling seek event");
gst_event_parse_seek (event, NULL, NULL, &flags, NULL, NULL, NULL, NULL);
- src->flushing_seek = ! !(flags & GST_SEEK_FLAG_FLUSH);
+ src->flushing_seek = !!(flags & GST_SEEK_FLAG_FLUSH);
GST_DEBUG_OBJECT (src, "%s seek event",
src->flushing_seek ? "flushing" : "non-flushing");