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
dfc8392c
Commit
dfc8392c
authored
Aug 22, 2006
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/ffmpeg/mux.c: libavformat is much more happy with timestamps which start from 0.
parent
834b64d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
modules/codec/ffmpeg/mux.c
modules/codec/ffmpeg/mux.c
+16
-4
No files found.
modules/codec/ffmpeg/mux.c
View file @
dfc8392c
...
...
@@ -59,6 +59,8 @@ struct sout_mux_sys_t
vlc_bool_t
b_write_header
;
vlc_bool_t
b_error
;
int64_t
i_initial_dts
;
};
/*****************************************************************************
...
...
@@ -135,6 +137,7 @@ int E_(OpenMux)( vlc_object_t *p_this )
p_sys
->
b_write_header
=
VLC_TRUE
;
p_sys
->
b_error
=
VLC_FALSE
;
p_sys
->
i_initial_dts
=
0
;
return
VLC_SUCCESS
;
}
...
...
@@ -287,6 +290,7 @@ static int MuxGetStream( sout_mux_t *p_mux, int *pi_stream, mtime_t *pi_dts )
}
if
(
pi_stream
)
*
pi_stream
=
i_stream
;
if
(
pi_dts
)
*
pi_dts
=
i_dts
;
if
(
!
p_mux
->
p_sys
->
i_initial_dts
)
p_mux
->
p_sys
->
i_initial_dts
=
i_dts
;
return
i_stream
;
}
...
...
@@ -295,25 +299,33 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
block_t
*
p_data
=
block_FifoGet
(
p_input
->
p_fifo
);
int
i_stream
=
*
((
int
*
)
p_input
->
p_sys
);
AVStream
*
p_stream
=
p_sys
->
oc
->
streams
[
i_stream
];
AVPacket
pkt
=
{
0
};
av_init_packet
(
&
pkt
);
pkt
.
data
=
p_data
->
p_buffer
;
pkt
.
size
=
p_data
->
i_buffer
;
pkt
.
stream_index
=
i_stream
;
if
(
p_data
->
i_flags
&
BLOCK_FLAG_TYPE_I
)
pkt
.
flags
|=
PKT_FLAG_KEY
;
/* avformat expects pts/dts which start from 0 */
p_data
->
i_dts
-=
p_mux
->
p_sys
->
i_initial_dts
;
p_data
->
i_pts
-=
p_mux
->
p_sys
->
i_initial_dts
;
if
(
p_data
->
i_pts
>
0
)
pkt
.
pts
=
p_data
->
i_pts
*
p_s
ys
->
oc
->
streams
[
i_stream
]
->
time_base
.
den
/
I64C
(
1000000
)
/
p_s
ys
->
oc
->
streams
[
i_stream
]
->
time_base
.
num
;
pkt
.
pts
=
p_data
->
i_pts
*
p_s
tream
->
time_base
.
den
/
I64C
(
1000000
)
/
p_s
tream
->
time_base
.
num
;
if
(
p_data
->
i_dts
>
0
)
pkt
.
dts
=
p_data
->
i_dts
*
p_s
ys
->
oc
->
streams
[
i_stream
]
->
time_base
.
den
/
I64C
(
1000000
)
/
p_s
ys
->
oc
->
streams
[
i_stream
]
->
time_base
.
num
;
pkt
.
dts
=
p_data
->
i_dts
*
p_s
tream
->
time_base
.
den
/
I64C
(
1000000
)
/
p_s
tream
->
time_base
.
num
;
if
(
av_write_frame
(
p_sys
->
oc
,
&
pkt
)
<
0
)
{
msg_Err
(
p_mux
,
"could not write frame (pts: "
I64Fd
", dts: "
I64Fd
") "
"(pkt pts: "
I64Fd
", dts: "
I64Fd
")"
,
p_data
->
i_pts
,
p_data
->
i_dts
,
pkt
.
pts
,
pkt
.
dts
);
block_Release
(
p_data
);
return
VLC_EGENERIC
;
}
...
...
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