Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9873d71f
Commit
9873d71f
authored
Dec 24, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wavpack: decode directly to the user-provided AVFrame
parent
ee6ca11b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
wavpack.c
libavcodec/wavpack.c
+4
-10
No files found.
libavcodec/wavpack.c
View file @
9873d71f
...
@@ -127,7 +127,6 @@ typedef struct WavpackFrameContext {
...
@@ -127,7 +127,6 @@ typedef struct WavpackFrameContext {
typedef
struct
WavpackContext
{
typedef
struct
WavpackContext
{
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
AVFrame
frame
;
WavpackFrameContext
*
fdec
[
WV_MAX_FRAME_DECODERS
];
WavpackFrameContext
*
fdec
[
WV_MAX_FRAME_DECODERS
];
int
fdec_num
;
int
fdec_num
;
...
@@ -739,9 +738,6 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
...
@@ -739,9 +738,6 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
s
->
fdec_num
=
0
;
s
->
fdec_num
=
0
;
avcodec_get_frame_defaults
(
&
s
->
frame
);
avctx
->
coded_frame
=
&
s
->
frame
;
return
0
;
return
0
;
}
}
...
@@ -1172,6 +1168,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1172,6 +1168,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
WavpackContext
*
s
=
avctx
->
priv_data
;
WavpackContext
*
s
=
avctx
->
priv_data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
AVFrame
*
frame
=
data
;
int
frame_size
,
ret
,
frame_flags
;
int
frame_size
,
ret
,
frame_flags
;
int
samplecount
=
0
;
int
samplecount
=
0
;
...
@@ -1207,8 +1204,8 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1207,8 +1204,8 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
}
}
/* get output buffer */
/* get output buffer */
s
->
frame
.
nb_samples
=
s
->
samples
;
frame
->
nb_samples
=
s
->
samples
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
s
->
frame
))
<
0
)
{
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
return
ret
;
}
}
...
@@ -1232,7 +1229,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1232,7 +1229,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
return
-
1
;
return
-
1
;
}
}
if
((
samplecount
=
wavpack_decode_block
(
avctx
,
s
->
block
,
if
((
samplecount
=
wavpack_decode_block
(
avctx
,
s
->
block
,
s
->
frame
.
data
[
0
],
got_frame_ptr
,
frame
->
data
[
0
],
got_frame_ptr
,
buf
,
frame_size
))
<
0
)
{
buf
,
frame_size
))
<
0
)
{
wavpack_decode_flush
(
avctx
);
wavpack_decode_flush
(
avctx
);
return
-
1
;
return
-
1
;
...
@@ -1241,9 +1238,6 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1241,9 +1238,6 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
buf
+=
frame_size
;
buf_size
-=
frame_size
;
buf
+=
frame_size
;
buf_size
-=
frame_size
;
}
}
if
(
*
got_frame_ptr
)
*
(
AVFrame
*
)
data
=
s
->
frame
;
return
avpkt
->
size
;
return
avpkt
->
size
;
}
}
...
...
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