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
c0aeb6ae
Commit
c0aeb6ae
authored
Mar 07, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce CDG decoder frame rate down to 25.
parent
96b814ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
modules/codec/cdg.c
modules/codec/cdg.c
+22
-10
No files found.
modules/codec/cdg.c
View file @
c0aeb6ae
...
@@ -58,6 +58,8 @@ struct decoder_sys_t
...
@@ -58,6 +58,8 @@ struct decoder_sys_t
int
i_offsetv
;
int
i_offsetv
;
uint8_t
screen
[
CDG_SCREEN_PITCH
*
CDG_SCREEN_HEIGHT
];
uint8_t
screen
[
CDG_SCREEN_PITCH
*
CDG_SCREEN_HEIGHT
];
uint8_t
*
p_screen
;
uint8_t
*
p_screen
;
int
i_packet
;
};
};
#define CDG_PACKET_SIZE (24)
#define CDG_PACKET_SIZE (24)
...
@@ -107,6 +109,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -107,6 +109,7 @@ static int Open( vlc_object_t *p_this )
/* Init */
/* Init */
p_sys
->
p_screen
=
p_sys
->
screen
;
p_sys
->
p_screen
=
p_sys
->
screen
;
p_sys
->
i_packet
=
0
;
/* Set output properties
/* Set output properties
* TODO maybe it would be better to use RV16 or RV24 ? */
* TODO maybe it would be better to use RV16 or RV24 ? */
...
@@ -141,6 +144,12 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
...
@@ -141,6 +144,12 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
return
NULL
;
p_block
=
*
pp_block
;
p_block
=
*
pp_block
;
if
(
p_block
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
)
)
{
p_sys
->
i_packet
=
0
;
goto
exit
;
}
/* Decode packet */
/* Decode packet */
while
(
p_block
->
i_buffer
>=
CDG_PACKET_SIZE
)
while
(
p_block
->
i_buffer
>=
CDG_PACKET_SIZE
)
{
{
...
@@ -149,20 +158,21 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
...
@@ -149,20 +158,21 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_block
->
p_buffer
+=
CDG_PACKET_SIZE
;
p_block
->
p_buffer
+=
CDG_PACKET_SIZE
;
}
}
/* Get a new picture */
/* Only display 25 frame per second (there is 75 packets per second) */
p_pic
=
decoder_NewPicture
(
p_dec
);
if
(
(
p_sys
->
i_packet
%
3
)
==
1
)
if
(
!
p_pic
)
{
goto
error
;
/* Get a new picture */
p_pic
=
decoder_NewPicture
(
p_dec
);
if
(
!
p_pic
)
goto
exit
;
Render
(
p_sys
,
p_pic
);
Render
(
p_sys
,
p_pic
);
p_pic
->
date
=
p_block
->
i_pts
>
0
?
p_block
->
i_pts
:
p_block
->
i_dts
;
p_pic
->
date
=
p_block
->
i_pts
>
0
?
p_block
->
i_pts
:
p_block
->
i_dts
;
}
exit:
block_Release
(
p_block
);
*
pp_block
=
NULL
;
block_Release
(
p_block
);
*
pp_block
=
NULL
;
return
p_pic
;
return
p_pic
;
error:
block_Release
(
p_block
);
*
pp_block
=
NULL
;
return
NULL
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -336,6 +346,8 @@ static int DecodePacket( decoder_sys_t *p_cdg, uint8_t *p_buffer, int i_buffer )
...
@@ -336,6 +346,8 @@ static int DecodePacket( decoder_sys_t *p_cdg, uint8_t *p_buffer, int i_buffer )
if
(
i_buffer
!=
CDG_PACKET_SIZE
)
if
(
i_buffer
!=
CDG_PACKET_SIZE
)
return
-
1
;
return
-
1
;
p_cdg
->
i_packet
++
;
/* Handle CDG command only */
/* Handle CDG command only */
if
(
i_cmd
!=
0x09
)
if
(
i_cmd
!=
0x09
)
return
0
;
return
0
;
...
...
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