Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
bd57eaae
Commit
bd57eaae
authored
May 01, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for AQT subtitles.
Parsing is fine but timing is wrong since it must be multiplied by FPS.
parent
beee3221
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletion
+59
-1
modules/demux/subtitle.c
modules/demux/subtitle.c
+59
-1
No files found.
modules/demux/subtitle.c
View file @
bd57eaae
...
...
@@ -99,7 +99,8 @@ enum
SUB_TYPE_SAMI
,
SUB_TYPE_SUBVIEWER
,
SUB_TYPE_DVDSUBTITLE
,
SUB_TYPE_MPL2
SUB_TYPE_MPL2
,
SUB_TYPE_AQT
};
typedef
struct
...
...
@@ -145,6 +146,7 @@ static int ParseVplayer ( demux_t *, subtitle_t *, int );
static
int
ParseSami
(
demux_t
*
,
subtitle_t
*
,
int
);
static
int
ParseDVDSubtitle
(
demux_t
*
,
subtitle_t
*
,
int
);
static
int
ParseMPL2
(
demux_t
*
,
subtitle_t
*
,
int
);
static
int
ParseAQT
(
demux_t
*
,
subtitle_t
*
,
int
);
static
struct
{
...
...
@@ -164,6 +166,7 @@ static struct
{
"sami"
,
SUB_TYPE_SAMI
,
"SAMI"
,
ParseSami
},
{
"dvdsubtitle"
,
SUB_TYPE_DVDSUBTITLE
,
"DVDSubtitle"
,
ParseDVDSubtitle
},
{
"mpl2"
,
SUB_TYPE_MPL2
,
"MPL2"
,
ParseMPL2
},
{
"aqt"
,
SUB_TYPE_AQT
,
"AQTitle"
,
ParseAQT
},
{
NULL
,
SUB_TYPE_UNKNOWN
,
"Unknown"
,
NULL
}
};
...
...
@@ -317,6 +320,9 @@ static int Open ( vlc_object_t *p_this )
{
p_sys
->
i_type
=
SUB_TYPE_MPL2
;
break
;
}
else
if
(
sscanf
(
s
,
"-->> %d"
,
&
i_dummy
)
==
1
)
{
p_sys
->
i_type
=
SUB_TYPE_AQT
;
}
free
(
s
);
...
...
@@ -1226,3 +1232,55 @@ static int ParseMPL2( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
return
VLC_SUCCESS
;
}
static
int
ParseAQT
(
demux_t
*
p_demux
,
subtitle_t
*
p_subtitle
,
int
i_idx
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
text_t
*
txt
=
&
p_sys
->
txt
;
char
*
psz_text
=
strdup
(
""
);
int
i_old
=
0
;
int
i_firstline
=
1
;
for
(
;;
)
{
int
t
;
/* Time */
const
char
*
s
=
TextGetLine
(
txt
);
if
(
!
s
)
return
VLC_EGENERIC
;
/* Data Lines */
if
(
sscanf
(
s
,
"-->> %d"
,
&
t
)
==
1
)
{
p_subtitle
->
i_start
=
(
int64_t
)
t
;
/* * FPS*/
p_subtitle
->
i_stop
=
0
;
/* Starting of a subtitle */
if
(
i_firstline
)
{
i_firstline
=
0
;
}
/* We have been too far: end of the subtitle, begin of next */
else
{
txt
->
i_line
--
;
break
;
}
}
/* Text Lines */
else
{
i_old
=
strlen
(
psz_text
)
+
1
;
psz_text
=
realloc
(
psz_text
,
i_old
+
strlen
(
s
)
+
1
);
if
(
!
psz_text
)
return
VLC_ENOMEM
;
strcat
(
psz_text
,
s
);
strcat
(
psz_text
,
"
\n
"
);
if
(
txt
->
i_line
==
txt
->
i_line_count
)
break
;
}
}
p_subtitle
->
psz_text
=
psz_text
;
return
VLC_SUCCESS
;
}
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