Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e4b51d8d
Commit
e4b51d8d
authored
Jul 27, 2010
by
Hugo Beauzée-Luyssen
Committed by
Rémi Denis-Courmont
Jul 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: encoder: Don't assume a maximum BPP of 24
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
178f2e27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+17
-7
No files found.
modules/codec/avcodec/encoder.c
View file @
e4b51d8d
...
...
@@ -436,13 +436,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_enc
->
fmt_in
.
video
.
i_sar_num
,
p_enc
->
fmt_in
.
video
.
i_sar_den
,
1
<<
30
);
p_sys
->
i_buffer_out
=
p_context
->
height
*
p_context
->
width
*
3
/* Assume 24bpp maximum */
+
200
;
/* some room for potential headers (such as BMP) */
if
(
p_sys
->
i_buffer_out
<
FF_MIN_BUFFER_SIZE
)
p_sys
->
i_buffer_out
=
FF_MIN_BUFFER_SIZE
;
p_sys
->
p_buffer_out
=
malloc
(
p_sys
->
i_buffer_out
);
p_sys
->
p_buffer_out
=
NULL
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
p_enc
->
fmt_in
.
video
.
i_chroma
=
p_enc
->
fmt_in
.
i_codec
;
...
...
@@ -805,6 +799,22 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
AVFrame
frame
;
int
i_out
,
i_plane
;
/* Initialize the video output buffer the first time.
* This is done here instead of OpenEncoder() because we need the actual
* bits_per_pixel value, without having to assume anything.
*/
if
(
p_sys
->
p_buffer_out
==
NULL
)
{
int
bytesPerPixel
=
p_enc
->
fmt_out
.
video
.
i_bits_per_pixel
?
p_enc
->
fmt_out
.
video
.
i_bits_per_pixel
/
8
:
3
;
p_sys
->
i_buffer_out
=
p_sys
->
p_context
->
height
*
p_sys
->
p_context
->
width
*
bytesPerPixel
+
200
;
/* some room for potential headers (such as BMP) */
if
(
p_sys
->
i_buffer_out
<
FF_MIN_BUFFER_SIZE
)
p_sys
->
i_buffer_out
=
FF_MIN_BUFFER_SIZE
;
p_sys
->
p_buffer_out
=
malloc
(
p_sys
->
i_buffer_out
);
}
memset
(
&
frame
,
0
,
sizeof
(
AVFrame
)
);
if
(
likely
(
p_pict
)
)
{
...
...
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