Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
eb88ccb9
Commit
eb88ccb9
authored
Mar 05, 2020
by
Nicolas Gaullier
Committed by
Anton Khirnov
Mar 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg12dec: Do not alter avctx->rc_buffer_size
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
fa41be57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
mpeg12dec.c
libavcodec/mpeg12dec.c
+5
-4
No files found.
libavcodec/mpeg12dec.c
View file @
eb88ccb9
...
@@ -64,6 +64,7 @@ typedef struct Mpeg1Context {
...
@@ -64,6 +64,7 @@ typedef struct Mpeg1Context {
int
slice_count
;
int
slice_count
;
AVRational
save_aspect
;
AVRational
save_aspect
;
int
save_width
,
save_height
,
save_progressive_seq
;
int
save_width
,
save_height
,
save_progressive_seq
;
int
rc_buffer_size
;
AVRational
frame_rate_ext
;
/* MPEG-2 specific framerate modificator */
AVRational
frame_rate_ext
;
/* MPEG-2 specific framerate modificator */
int
sync
;
/* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
int
sync
;
/* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
int
tmpgexs
;
int
tmpgexs
;
...
@@ -1417,7 +1418,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
...
@@ -1417,7 +1418,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
bit_rate_ext
=
get_bits
(
&
s
->
gb
,
12
);
/* XXX: handle it */
bit_rate_ext
=
get_bits
(
&
s
->
gb
,
12
);
/* XXX: handle it */
s
->
bit_rate
+=
(
bit_rate_ext
<<
18
)
*
400LL
;
s
->
bit_rate
+=
(
bit_rate_ext
<<
18
)
*
400LL
;
check_marker
(
s
->
avctx
,
&
s
->
gb
,
"after bit rate extension"
);
check_marker
(
s
->
avctx
,
&
s
->
gb
,
"after bit rate extension"
);
s
->
avctx
->
rc_buffer_size
+=
get_bits
(
&
s
->
gb
,
8
)
*
1024
*
16
<<
10
;
s
1
->
rc_buffer_size
+=
get_bits
(
&
s
->
gb
,
8
)
*
1024
*
16
<<
10
;
s
->
low_delay
=
get_bits1
(
&
s
->
gb
);
s
->
low_delay
=
get_bits1
(
&
s
->
gb
);
if
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_LOW_DELAY
)
if
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_LOW_DELAY
)
...
@@ -1433,7 +1434,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
...
@@ -1433,7 +1434,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"
PRId64
"
\n
"
,
"profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"
PRId64
"
\n
"
,
s
->
avctx
->
profile
,
s
->
avctx
->
level
,
s
->
progressive_sequence
,
s
->
chroma_format
,
s
->
avctx
->
profile
,
s
->
avctx
->
level
,
s
->
progressive_sequence
,
s
->
chroma_format
,
s
->
avctx
->
rc_buffer_size
,
s
->
bit_rate
);
s
1
->
rc_buffer_size
,
s
->
bit_rate
);
}
}
static
void
mpeg_decode_sequence_display_extension
(
Mpeg1Context
*
s1
)
static
void
mpeg_decode_sequence_display_extension
(
Mpeg1Context
*
s1
)
...
@@ -2118,7 +2119,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
...
@@ -2118,7 +2119,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
s
->
avctx
->
rc_buffer_size
=
get_bits
(
&
s
->
gb
,
10
)
*
1024
*
16
;
s
1
->
rc_buffer_size
=
get_bits
(
&
s
->
gb
,
10
)
*
1024
*
16
;
skip_bits
(
&
s
->
gb
,
1
);
skip_bits
(
&
s
->
gb
,
1
);
/* get matrix */
/* get matrix */
...
@@ -2167,7 +2168,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
...
@@ -2167,7 +2168,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"vbv buffer: %d, bitrate:%"
PRId64
", aspect_ratio_info: %d
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"vbv buffer: %d, bitrate:%"
PRId64
", aspect_ratio_info: %d
\n
"
,
s
->
avctx
->
rc_buffer_size
,
s
->
bit_rate
,
s
->
aspect_ratio_info
);
s
1
->
rc_buffer_size
,
s
->
bit_rate
,
s
->
aspect_ratio_info
);
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