Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
e331532c
Commit
e331532c
authored
Jan 23, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support subtitle description when comming from attachments (close #3241).
parent
0ad9871b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
src/input/input.c
src/input/input.c
+18
-7
No files found.
src/input/input.c
View file @
e331532c
...
...
@@ -1035,31 +1035,42 @@ static void LoadSubtitles( input_thread_t *p_input )
/* Load subtitles from attachments */
int
i_attachment
=
0
;
char
**
ppsz
_attachment
=
NULL
;
input_attachment_t
**
pp
_attachment
=
NULL
;
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
for
(
int
i
=
0
;
i
<
p_input
->
p
->
i_attachment
;
i
++
)
{
const
input_attachment_t
*
a
=
p_input
->
p
->
attachment
[
i
];
if
(
!
strcmp
(
a
->
psz_mime
,
"application/x-srt"
)
)
TAB_APPEND
(
i_attachment
,
ppsz_attachment
,
strdup
(
a
->
psz_name
)
);
TAB_APPEND
(
i_attachment
,
pp_attachment
,
vlc_input_attachment_New
(
a
->
psz_name
,
NULL
,
a
->
psz_description
,
NULL
,
0
)
);
}
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
if
(
i_attachment
>
0
)
var_Create
(
p_input
,
"sub-description"
,
VLC_VAR_STRING
);
for
(
int
i
=
0
;
i
<
i_attachment
;
i
++
)
{
input_attachment_t
*
a
=
pp_attachment
[
i
];
if
(
!
a
)
continue
;
char
*
psz_mrl
;
if
(
ppsz_attachment
[
i
]
&&
asprintf
(
&
psz_mrl
,
"attachment://%s"
,
ppsz_attachment
[
i
]
)
>=
0
)
if
(
a
->
psz_name
[
i
]
&&
asprintf
(
&
psz_mrl
,
"attachment://%s"
,
a
->
psz_name
)
>=
0
)
{
var_SetString
(
p_input
,
"sub-description"
,
a
->
psz_description
?
a
->
psz_description
:
""
);
SubtitleAdd
(
p_input
,
psz_mrl
,
b_forced
);
b_forced
=
false
;
free
(
psz_mrl
);
}
free
(
ppsz_attachment
[
i
]
);
vlc_input_attachment_Delete
(
a
);
}
free
(
ppsz_attachment
);
free
(
pp_attachment
);
if
(
i_attachment
>
0
)
var_Destroy
(
p_input
,
"sub-description"
);
}
static
void
LoadSlaves
(
input_thread_t
*
p_input
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment