[libbluray-devel] [Git][videolan/libbluray][master] 2 commits: Split function

Administrator gitlab at videolan.org
Thu Mar 14 15:21:51 CET 2019


Administrator pushed to branch master at VideoLAN / libbluray


Commits:
411bdf4c by hpi1 at 2019-03-04T11:32:32Z
Split function

- - - - -
e143a72f by hpi1 at 2019-03-04T11:33:37Z
Initialize defaults for selected streams when opening a playlist without menus

- - - - -


1 changed file:

- src/libbluray/bluray.c


Changes:

=====================================
src/libbluray/bluray.c
=====================================
@@ -356,6 +356,40 @@ static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip)
     }
 }
 
+static void _update_playlist_psrs(BLURAY *bd)
+{
+    NAV_CLIP *clip = bd->st0.clip;
+
+    bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name));
+    bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
+    bd_psr_write(bd->regs, PSR_CHAPTER, 0xffff);
+
+    if (clip && bd->title_type == title_undef) {
+        /* Initialize selected audio and subtitle stream PSRs when not using menus.
+         * Selection is based on language setting PSRs and clip STN.
+         */
+        MPLS_STN *stn = &clip->title->pl->play_item[clip->ref].stn;
+        uint32_t audio_lang = 0;
+
+        /* make sure clip is up-to-date before STREAM events are triggered */
+        bd_psr_write(bd->regs, PSR_PLAYITEM, clip->ref);
+
+        if (stn->num_audio) {
+            _update_stream_psr_by_lang(bd->regs,
+                                       PSR_AUDIO_LANG, PSR_PRIMARY_AUDIO_ID, 0,
+                                       stn->audio, stn->num_audio,
+                                       &audio_lang, 0);
+        }
+
+        if (stn->num_pg) {
+            _update_stream_psr_by_lang(bd->regs,
+                                       PSR_PG_AND_SUB_LANG, PSR_PG_STREAM, 0x80000000,
+                                       stn->pg, stn->num_pg,
+                                       NULL, audio_lang);
+        }
+    }
+}
+
 static int _is_interactive_title(BLURAY *bd)
 {
     if (bd->titles && bd->title_type != title_undef) {
@@ -2335,12 +2369,11 @@ static int _open_playlist(BLURAY *bd, const char *f_name, unsigned angle)
     bd->end_of_playlist = 0;
     bd->st0.ig_pid = 0;
 
-    bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name));
-    bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
-    bd_psr_write(bd->regs, PSR_CHAPTER, 0xffff);
-
     // Get the initial clip of the playlist
     bd->st0.clip = nav_next_clip(bd->title, NULL);
+
+    _update_playlist_psrs(bd);
+
     if (_open_m2ts(bd, &bd->st0)) {
         BD_DEBUG(DBG_BLURAY, "Title %s selected\n", f_name);
 



View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/bbab2eff3f16de77130e8da06b0eccf3c94b20dc...e143a72f695a95dd8c3906d7f1142ee766a0f6ce

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/bbab2eff3f16de77130e8da06b0eccf3c94b20dc...e143a72f695a95dd8c3906d7f1142ee766a0f6ce
You're receiving this email because of your account on code.videolan.org.


More information about the libbluray-devel mailing list