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
935655a7
Commit
935655a7
authored
Jan 29, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed embedded subtitles loading for non ODML avi files (close #3227).
parent
1c3f14ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
17 deletions
+51
-17
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+50
-17
modules/demux/avi/libavi.h
modules/demux/avi/libavi.h
+1
-0
No files found.
modules/demux/avi/avi.c
View file @
935655a7
...
...
@@ -197,7 +197,7 @@ static void AVI_IndexLoad ( demux_t * );
static
void
AVI_IndexCreate
(
demux_t
*
);
static
void
AVI_IndexAddEntry
(
demux_sys_t
*
,
int
,
avi_entry_t
*
);
static
void
AVI_ExtractSubtitle
(
demux_t
*
,
avi_chunk_list_t
*
,
avi_chunk_STRING_t
*
);
static
void
AVI_ExtractSubtitle
(
demux_t
*
,
int
i_stream
,
avi_chunk_list_t
*
,
avi_chunk_STRING_t
*
);
static
mtime_t
AVI_MovieGetLength
(
demux_t
*
);
...
...
@@ -615,7 +615,7 @@ static int Open( vlc_object_t * p_this )
case
(
AVIFOURCC_txts
):
msg_Dbg
(
p_demux
,
"stream[%d] subtitle attachment"
,
i
);
AVI_ExtractSubtitle
(
p_demux
,
p_strl
,
p_strn
);
AVI_ExtractSubtitle
(
p_demux
,
i
,
p_strl
,
p_strn
);
free
(
tk
);
continue
;
...
...
@@ -1981,6 +1981,9 @@ static void AVI_ParseStreamHeader( vlc_fourcc_t i_id,
case
AVITWOCC_AC
:
SET_PTR
(
pi_type
,
VIDEO_ES
);
break
;
case
AVITWOCC_tx
:
SET_PTR
(
pi_type
,
SPU_ES
);
break
;
default:
SET_PTR
(
pi_type
,
UNKNOWN_ES
);
break
;
...
...
@@ -2497,6 +2500,7 @@ print_stat:
* Subtitles
*****************************************************************************/
static
void
AVI_ExtractSubtitle
(
demux_t
*
p_demux
,
int
i_stream
,
avi_chunk_list_t
*
p_strl
,
avi_chunk_STRING_t
*
p_strn
)
{
...
...
@@ -2510,10 +2514,11 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
goto
exit
;
p_indx
=
AVI_ChunkFind
(
p_strl
,
AVIFOURCC_indx
,
0
);
if
(
!
p_indx
)
goto
exit
;
avi_chunk_t
ck
;
int64_t
i_position
;
unsigned
i_size
;
if
(
p_indx
)
{
if
(
p_indx
->
i_indextype
==
AVI_INDEX_OF_INDEXES
&&
p_indx
->
i_entriesinuse
>
0
)
{
...
...
@@ -2528,10 +2533,38 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
p_indx
->
i_indexsubtype
!=
0
)
goto
exit
;
/* */
int64_t
i_position
=
p_indx
->
i_baseoffset
+
i_position
=
p_indx
->
i_baseoffset
+
p_indx
->
idx
.
std
[
0
].
i_offset
-
8
;
unsigned
i_size
=
(
p_indx
->
idx
.
std
[
0
].
i_size
&
0x7fffffff
)
+
8
;
i_size
=
(
p_indx
->
idx
.
std
[
0
].
i_size
&
0x7fffffff
)
+
8
;
}
else
{
avi_chunk_idx1_t
*
p_idx1
;
uint64_t
i_offset
;
if
(
AVI_IndexFind_idx1
(
p_demux
,
&
p_idx1
,
&
i_offset
)
)
goto
exit
;
i_size
=
0
;
for
(
unsigned
i
=
0
;
i
<
p_idx1
->
i_entry_count
;
i
++
)
{
const
idx1_entry_t
*
e
=
&
p_idx1
->
entry
[
i
];
unsigned
i_cat
;
unsigned
i_stream_idx
;
AVI_ParseStreamHeader
(
e
->
i_fourcc
,
&
i_stream_idx
,
&
i_cat
);
if
(
i_cat
==
SPU_ES
&&
i_stream_idx
==
i_stream
)
{
i_position
=
e
->
i_pos
+
i_offset
;
i_size
=
e
->
i_length
+
8
;
break
;
}
}
if
(
i_size
<=
0
)
goto
exit
;
}
/* */
if
(
i_size
>
1000000
)
goto
exit
;
...
...
modules/demux/avi/libavi.h
View file @
935655a7
...
...
@@ -299,6 +299,7 @@ void AVI_ChunkFreeRoot( stream_t *, avi_chunk_t *p_chk );
#define AVITWOCC_dc VLC_TWOCC('d','c')
#define AVITWOCC_pc VLC_TWOCC('p','c')
#define AVITWOCC_AC VLC_TWOCC('A','C')
#define AVITWOCC_tx VLC_TWOCC('t','x')
/* *** codex stuff *** */
/* DV */
...
...
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