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
435b4df5
Commit
435b4df5
authored
Jan 20, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* mpegvideo.c : fix dts generation for non-progressive stream.
parent
21fb8028
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
modules/packetizer/mpegvideo.c
modules/packetizer/mpegvideo.c
+22
-3
No files found.
modules/packetizer/mpegvideo.c
View file @
435b4df5
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mpegvideo.c
* mpegvideo.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegvideo.c,v 1.
4 2003/01/19 08:27:2
8 fenrir Exp $
* $Id: mpegvideo.c,v 1.
5 2003/01/20 02:15:0
8 fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -50,6 +50,7 @@ typedef struct packetizer_s
...
@@ -50,6 +50,7 @@ typedef struct packetizer_s
mtime_t
i_last_dts
;
mtime_t
i_last_dts
;
mtime_t
i_last_ref_pts
;
mtime_t
i_last_ref_pts
;
double
d_frame_rate
;
double
d_frame_rate
;
int
i_progressive_sequence
;
uint8_t
p_sequence_header
[
150
];
uint8_t
p_sequence_header
[
150
];
int
i_sequence_header_length
;
int
i_sequence_header_length
;
int
i_last_sequence_header
;
int
i_last_sequence_header
;
...
@@ -280,9 +281,17 @@ static void PacketizeThread( packetizer_t *p_pack )
...
@@ -280,9 +281,17 @@ static void PacketizeThread( packetizer_t *p_pack )
/* sequence_extension (10 bytes) */
/* sequence_extension (10 bytes) */
if
(
ShowBits
(
&
p_pack
->
bit_stream
,
32
)
!=
0x1B5
)
if
(
ShowBits
(
&
p_pack
->
bit_stream
,
32
)
!=
0x1B5
)
{
msg_Dbg
(
p_pack
->
p_fifo
,
"ARRGG no extension_start_code"
);
msg_Dbg
(
p_pack
->
p_fifo
,
"ARRGG no extension_start_code"
);
p_pack
->
i_progressive_sequence
=
1
;
}
else
else
GetChunk
(
&
p_pack
->
bit_stream
,
p_temp
+
i_pos
,
10
);
i_pos
+=
10
;
{
GetChunk
(
&
p_pack
->
bit_stream
,
p_temp
+
i_pos
,
10
);
p_pack
->
i_progressive_sequence
=
(
p_temp
[
i_pos
+
5
]
&
0x08
)
?
1
:
0
;
i_pos
+=
10
;
}
/* remember sequence_header and sequence_extention */
/* remember sequence_header and sequence_extention */
memcpy
(
p_pack
->
p_sequence_header
,
p_temp
,
i_pos
);
memcpy
(
p_pack
->
p_sequence_header
,
p_temp
,
i_pos
);
...
@@ -374,6 +383,9 @@ static void PacketizeThread( packetizer_t *p_pack )
...
@@ -374,6 +383,9 @@ static void PacketizeThread( packetizer_t *p_pack )
p_sout_buffer
->
i_pts
=
p_pack
->
i_last_ref_pts
+
p_sout_buffer
->
i_pts
=
p_pack
->
i_last_ref_pts
+
i_temporal_ref
*
(
mtime_t
)(
1000000
/
p_pack
->
d_frame_rate
);
i_temporal_ref
*
(
mtime_t
)(
1000000
/
p_pack
->
d_frame_rate
);
msg_Dbg
(
p_pack
->
p_fifo
,
"dts:%lld pst:%lld tmp_ref:%d"
,
p_sout_buffer
->
i_dts
,
p_sout_buffer
->
i_pts
,
i_temporal_ref
);
p_sout_buffer
->
i_length
=
(
uint64_t
)
1000000
/
p_pack
->
d_frame_rate
;
p_sout_buffer
->
i_length
=
(
uint64_t
)
1000000
/
p_pack
->
d_frame_rate
;
p_sout_buffer
->
i_bitrate
=
(
int
)(
8
*
i_pos
*
p_pack
->
d_frame_rate
);
p_sout_buffer
->
i_bitrate
=
(
int
)(
8
*
i_pos
*
p_pack
->
d_frame_rate
);
...
@@ -381,7 +393,14 @@ static void PacketizeThread( packetizer_t *p_pack )
...
@@ -381,7 +393,14 @@ static void PacketizeThread( packetizer_t *p_pack )
sout_InputSendBuffer
(
p_pack
->
p_sout_input
,
p_sout_buffer
);
sout_InputSendBuffer
(
p_pack
->
p_sout_input
,
p_sout_buffer
);
if
(
p_pack
->
i_progressive_sequence
)
{
p_pack
->
i_last_dts
+=
(
mtime_t
)(
1000000
/
p_pack
->
d_frame_rate
);
p_pack
->
i_last_dts
+=
(
mtime_t
)(
1000000
/
p_pack
->
d_frame_rate
);
}
else
{
p_pack
->
i_last_dts
+=
(
mtime_t
)(
1000000
/
p_pack
->
d_frame_rate
/
2
);
}
}
}
...
...
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