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
57846458
Commit
57846458
authored
Oct 18, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: transmit palette to libavcodec >= 54
parent
8972e11e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+19
-2
No files found.
modules/codec/avcodec/video.c
View file @
57846458
...
@@ -77,7 +77,7 @@ struct decoder_sys_t
...
@@ -77,7 +77,7 @@ struct decoder_sys_t
#if LIBAVCODEC_VERSION_MAJOR < 54
#if LIBAVCODEC_VERSION_MAJOR < 54
AVPaletteControl
palette
;
AVPaletteControl
palette
;
#else
#else
# warning FIXME
bool
palette_sent
;
#endif
#endif
/* */
/* */
...
@@ -389,7 +389,13 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
...
@@ -389,7 +389,13 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys
->
p_context
->
palctrl
=
&
p_sys
->
palette
;
p_sys
->
p_context
->
palctrl
=
&
p_sys
->
palette
;
}
}
#else
#else
# warning FIXME
if
(
p_dec
->
fmt_in
.
video
.
p_palette
)
{
p_sys
->
palette_sent
=
false
;
p_dec
->
fmt_out
.
video
.
p_palette
=
malloc
(
sizeof
(
video_palette_t
)
);
if
(
p_dec
->
fmt_out
.
video
.
p_palette
)
*
p_dec
->
fmt_out
.
video
.
p_palette
=
*
p_dec
->
fmt_in
.
video
.
p_palette
;
}
else
p_sys
->
palette_sent
=
true
;
#endif
#endif
/* ***** init this codec with special data ***** */
/* ***** init this codec with special data ***** */
...
@@ -557,6 +563,17 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -557,6 +563,17 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
pkt
.
pts
=
p_block
->
i_pts
;
pkt
.
pts
=
p_block
->
i_pts
;
pkt
.
dts
=
p_block
->
i_dts
;
pkt
.
dts
=
p_block
->
i_dts
;
#if LIBAVCODEC_VERSION_MAJOR >= 54
if
(
!
p_sys
->
palette_sent
)
{
uint8_t
*
pal
=
av_packet_new_side_data
(
&
pkt
,
AV_PKT_DATA_PALETTE
,
AVPALETTE_SIZE
);
if
(
pal
)
{
memcpy
(
pal
,
p_dec
->
fmt_in
.
video
.
p_palette
->
palette
,
AVPALETTE_SIZE
);
p_sys
->
palette_sent
=
true
;
}
}
#endif
/* Make sure we don't reuse the same timestamps twice */
/* Make sure we don't reuse the same timestamps twice */
p_block
->
i_pts
=
p_block
->
i_pts
=
p_block
->
i_dts
=
VLC_TS_INVALID
;
p_block
->
i_dts
=
VLC_TS_INVALID
;
...
...
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