mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
dvdreadsrc: map subtitle language tag to stream indicated in PGC data
This commit is contained in:
parent
cacc663b35
commit
20dcefd5c0
1 changed files with 13 additions and 2 deletions
|
@ -521,15 +521,26 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
||||||
/* subtitle */
|
/* subtitle */
|
||||||
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) {
|
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) {
|
||||||
const subp_attr_t *u;
|
const subp_attr_t *u;
|
||||||
|
const video_attr_t *v;
|
||||||
|
gint sid;
|
||||||
|
|
||||||
/* subpicture stream present? */
|
/* subpicture stream present? */
|
||||||
if (pgc0 != NULL && (pgc0->subp_control[i] & 0x80000000) == 0)
|
if (pgc0 != NULL && (pgc0->subp_control[i] & 0x80000000) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
u = &src->vts_file->vtsi_mat->vts_subp_attr[i];
|
u = &src->vts_file->vtsi_mat->vts_subp_attr[i];
|
||||||
|
v = &src->vts_file->vtsi_mat->vts_video_attr;
|
||||||
|
|
||||||
|
sid = i;
|
||||||
|
if (pgc0 != NULL) {
|
||||||
|
if (v->display_aspect_ratio == 0) /* 4:3 */
|
||||||
|
sid = (pgc0->subp_control[i] >> 24) & 0x1f;
|
||||||
|
else if (v->display_aspect_ratio == 3) /* 16:9 */
|
||||||
|
sid = (pgc0->subp_control[i] >> 8) & 0x1f;
|
||||||
|
}
|
||||||
|
|
||||||
if (u->type) {
|
if (u->type) {
|
||||||
t = g_strdup_printf ("subtitle-%d-language", i);
|
t = g_strdup_printf ("subtitle-%d-language", sid);
|
||||||
lang_code[0] = (u->lang_code >> 8) & 0xff;
|
lang_code[0] = (u->lang_code >> 8) & 0xff;
|
||||||
lang_code[1] = u->lang_code & 0xff;
|
lang_code[1] = u->lang_code & 0xff;
|
||||||
gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL);
|
gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL);
|
||||||
|
@ -539,7 +550,7 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_INFO_OBJECT (src, "[%02d] Subtitle %02d: lang='%s', type=%d",
|
GST_INFO_OBJECT (src, "[%02d] Subtitle %02d: lang='%s', type=%d",
|
||||||
src->title + 1, i, lang_code, u->type);
|
src->title + 1, sid, lang_code, u->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
src->title_lang_event_pending =
|
src->title_lang_event_pending =
|
||||||
|
|
Loading…
Reference in a new issue