Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
235529f2
Commit
235529f2
authored
Jul 08, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed used of uninitialized memory on unsupported track.
Fixed usage of start_time. (It should fix #799)
parent
da12022b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+17
-7
No files found.
modules/demux/avformat/demux.c
View file @
235529f2
...
@@ -200,6 +200,7 @@ int OpenDemux( vlc_object_t *p_this )
...
@@ -200,6 +200,7 @@ int OpenDemux( vlc_object_t *p_this )
es_out_id_t
*
es
;
es_out_id_t
*
es
;
es_format_t
fmt
;
es_format_t
fmt
;
vlc_fourcc_t
fcc
;
vlc_fourcc_t
fcc
;
const
char
*
psz_type
=
"unknown"
;
if
(
!
GetVlcFourcc
(
cc
->
codec_id
,
NULL
,
&
fcc
,
NULL
)
)
if
(
!
GetVlcFourcc
(
cc
->
codec_id
,
NULL
,
&
fcc
,
NULL
)
)
{
{
...
@@ -221,6 +222,7 @@ int OpenDemux( vlc_object_t *p_this )
...
@@ -221,6 +222,7 @@ int OpenDemux( vlc_object_t *p_this )
fmt
.
audio
.
i_rate
=
cc
->
sample_rate
;
fmt
.
audio
.
i_rate
=
cc
->
sample_rate
;
fmt
.
audio
.
i_bitspersample
=
cc
->
bits_per_sample
;
fmt
.
audio
.
i_bitspersample
=
cc
->
bits_per_sample
;
fmt
.
audio
.
i_blockalign
=
cc
->
block_align
;
fmt
.
audio
.
i_blockalign
=
cc
->
block_align
;
psz_type
=
"audio"
;
break
;
break
;
case
CODEC_TYPE_VIDEO
:
case
CODEC_TYPE_VIDEO
:
es_format_Init
(
&
fmt
,
VIDEO_ES
,
fcc
);
es_format_Init
(
&
fmt
,
VIDEO_ES
,
fcc
);
...
@@ -231,11 +233,20 @@ int OpenDemux( vlc_object_t *p_this )
...
@@ -231,11 +233,20 @@ int OpenDemux( vlc_object_t *p_this )
fmt
.
video
.
p_palette
=
malloc
(
sizeof
(
video_palette_t
)
);
fmt
.
video
.
p_palette
=
malloc
(
sizeof
(
video_palette_t
)
);
*
fmt
.
video
.
p_palette
=
*
(
video_palette_t
*
)
cc
->
palctrl
;
*
fmt
.
video
.
p_palette
=
*
(
video_palette_t
*
)
cc
->
palctrl
;
}
}
psz_type
=
"video"
;
break
;
break
;
case
CODEC_TYPE_SUBTITLE
:
case
CODEC_TYPE_SUBTITLE
:
es_format_Init
(
&
fmt
,
SPU_ES
,
fcc
);
es_format_Init
(
&
fmt
,
SPU_ES
,
fcc
);
psz_type
=
"subtitle"
;
break
;
break
;
default:
default:
es_format_Init
(
&
fmt
,
UNKNOWN_ES
,
0
);
if
(
cc
->
codec_type
==
CODEC_TYPE_DATA
)
psz_type
=
"data"
;
else
if
(
cc
->
codec_type
==
CODEC_TYPE_ATTACHMENT
)
psz_type
=
"attachment"
;
msg_Warn
(
p_demux
,
"unsupported track type in ffmpeg demux"
);
msg_Warn
(
p_demux
,
"unsupported track type in ffmpeg demux"
);
break
;
break
;
}
}
...
@@ -246,8 +257,7 @@ int OpenDemux( vlc_object_t *p_this )
...
@@ -246,8 +257,7 @@ int OpenDemux( vlc_object_t *p_this )
es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
msg_Dbg
(
p_demux
,
"adding es: %s codec = %4.4s"
,
msg_Dbg
(
p_demux
,
"adding es: %s codec = %4.4s"
,
cc
->
codec_type
==
CODEC_TYPE_AUDIO
?
"audio"
:
"video"
,
psz_type
,
(
char
*
)
&
fcc
);
(
char
*
)
&
fcc
);
TAB_APPEND
(
p_sys
->
i_tk
,
p_sys
->
tk
,
es
);
TAB_APPEND
(
p_sys
->
i_tk
,
p_sys
->
tk
,
es
);
}
}
...
@@ -315,16 +325,16 @@ static int Demux( demux_t *p_demux )
...
@@ -315,16 +325,16 @@ static int Demux( demux_t *p_demux )
p_frame
->
i_flags
|=
BLOCK_FLAG_TYPE_I
;
p_frame
->
i_flags
|=
BLOCK_FLAG_TYPE_I
;
i_start_time
=
(
p_sys
->
ic
->
start_time
!=
(
int64_t
)
AV_NOPTS_VALUE
)
?
i_start_time
=
(
p_sys
->
ic
->
start_time
!=
(
int64_t
)
AV_NOPTS_VALUE
)
?
(
p_sys
->
ic
->
start_time
/
AV_TIME_BASE
)
:
0
;
(
p_sys
->
ic
->
start_time
*
1000000
/
AV_TIME_BASE
)
:
0
;
p_frame
->
i_dts
=
(
pkt
.
dts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
p_frame
->
i_dts
=
(
pkt
.
dts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
dts
-
i_start_time
)
*
1000000
*
0
:
(
pkt
.
dts
)
*
1000000
*
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
;
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
-
i_start_time
;
p_frame
->
i_pts
=
(
pkt
.
pts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
p_frame
->
i_pts
=
(
pkt
.
pts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
pts
-
i_start_time
)
*
1000000
*
0
:
(
pkt
.
pts
)
*
1000000
*
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
;
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
-
i_start_time
;
#ifdef AVFORMAT_DEBUG
#ifdef AVFORMAT_DEBUG
msg_Dbg
(
p_demux
,
"tk[%d] dts=%"
PRId64
" pts=%"
PRId64
,
msg_Dbg
(
p_demux
,
"tk[%d] dts=%"
PRId64
" pts=%"
PRId64
,
...
...
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