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
9244370a
Commit
9244370a
authored
Sep 05, 2009
by
Sascha Sommer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reindent
Originally committed as revision 19765 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
42ea9681
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
43 deletions
+43
-43
wmaprodec.c
libavcodec/wmaprodec.c
+43
-43
No files found.
libavcodec/wmaprodec.c
View file @
9244370a
...
@@ -1449,62 +1449,62 @@ static int decode_packet(AVCodecContext *avctx,
...
@@ -1449,62 +1449,62 @@ static int decode_packet(AVCodecContext *avctx,
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
{
{
WMAProDecodeCtx
*
s
=
avctx
->
priv_data
;
WMAProDecodeCtx
*
s
=
avctx
->
priv_data
;
GetBitContext
*
gb
=
&
s
->
pgb
;
GetBitContext
*
gb
=
&
s
->
pgb
;
const
uint8_t
*
buf
=
avpkt
->
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
int
more_frames
=
1
;
int
more_frames
=
1
;
int
num_bits_prev_frame
;
int
num_bits_prev_frame
;
int
packet_sequence_number
;
int
packet_sequence_number
;
s
->
samples
=
data
;
s
->
samples
=
data
;
s
->
samples_start
=
data
;
s
->
samples_start
=
data
;
s
->
samples_end
=
(
float
*
)((
int8_t
*
)
data
+
*
data_size
);
s
->
samples_end
=
(
float
*
)((
int8_t
*
)
data
+
*
data_size
);
*
data_size
=
0
;
*
data_size
=
0
;
if
(
!
s
->
output_buffer_full
)
{
if
(
!
s
->
output_buffer_full
)
{
s
->
buf_bit_size
=
buf_size
<<
3
;
s
->
buf_bit_size
=
buf_size
<<
3
;
/** sanity check for the buffer length */
/** sanity check for the buffer length */
if
(
buf_size
<
avctx
->
block_align
)
if
(
buf_size
<
avctx
->
block_align
)
return
0
;
return
0
;
buf_size
=
avctx
->
block_align
;
buf_size
=
avctx
->
block_align
;
/** parse packet header */
/** parse packet header */
init_get_bits
(
gb
,
buf
,
s
->
buf_bit_size
);
init_get_bits
(
gb
,
buf
,
s
->
buf_bit_size
);
packet_sequence_number
=
get_bits
(
gb
,
4
);
packet_sequence_number
=
get_bits
(
gb
,
4
);
skip_bits
(
gb
,
2
);
skip_bits
(
gb
,
2
);
/** get number of bits that need to be added to the previous frame */
/** get number of bits that need to be added to the previous frame */
num_bits_prev_frame
=
get_bits
(
gb
,
s
->
log2_frame_size
);
num_bits_prev_frame
=
get_bits
(
gb
,
s
->
log2_frame_size
);
dprintf
(
avctx
,
"packet[%d]: nbpf %x
\n
"
,
avctx
->
frame_number
,
dprintf
(
avctx
,
"packet[%d]: nbpf %x
\n
"
,
avctx
->
frame_number
,
num_bits_prev_frame
);
num_bits_prev_frame
);
/** check for packet loss */
/** check for packet loss */
if
(
!
s
->
packet_loss
&&
if
(
!
s
->
packet_loss
&&
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
s
->
packet_loss
=
1
;
s
->
packet_loss
=
1
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %x vs %x
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %x vs %x
\n
"
,
s
->
packet_sequence_number
,
packet_sequence_number
);
s
->
packet_sequence_number
,
packet_sequence_number
);
}
}
s
->
packet_sequence_number
=
packet_sequence_number
;
s
->
packet_sequence_number
=
packet_sequence_number
;
if
(
num_bits_prev_frame
>
0
)
{
if
(
num_bits_prev_frame
>
0
)
{
/** append the previous frame data to the remaining data from the
/** append the previous frame data to the remaining data from the
previous packet to create a full frame */
previous packet to create a full frame */
save_bits
(
s
,
gb
,
num_bits_prev_frame
,
1
);
save_bits
(
s
,
gb
,
num_bits_prev_frame
,
1
);
dprintf
(
avctx
,
"accumulated %x bits of frame data
\n
"
,
dprintf
(
avctx
,
"accumulated %x bits of frame data
\n
"
,
s
->
num_saved_bits
-
s
->
frame_offset
);
s
->
num_saved_bits
-
s
->
frame_offset
);
/** decode the cross packet frame if it is valid */
/** decode the cross packet frame if it is valid */
if
(
!
s
->
packet_loss
)
if
(
!
s
->
packet_loss
)
decode_frame
(
s
);
decode_frame
(
s
);
}
else
if
(
s
->
num_saved_bits
-
s
->
frame_offset
)
{
}
else
if
(
s
->
num_saved_bits
-
s
->
frame_offset
)
{
dprintf
(
avctx
,
"ignoring %x previously saved bits
\n
"
,
dprintf
(
avctx
,
"ignoring %x previously saved bits
\n
"
,
s
->
num_saved_bits
-
s
->
frame_offset
);
s
->
num_saved_bits
-
s
->
frame_offset
);
}
}
s
->
packet_loss
=
0
;
s
->
packet_loss
=
0
;
}
else
{
}
else
{
/** continue decoding */
/** continue decoding */
...
...
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