Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
dc33fbbf
Commit
dc33fbbf
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
mlp/truehd: decode directly to the user-provided AVFrame
parent
86bfcfcf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/mlpdec.c
+6
-11
6 additions, 11 deletions
libavcodec/mlpdec.c
with
6 additions
and
11 deletions
libavcodec/mlpdec.c
+
6
−
11
View file @
dc33fbbf
...
@@ -118,7 +118,6 @@ typedef struct SubStream {
...
@@ -118,7 +118,6 @@ typedef struct SubStream {
typedef
struct
MLPDecodeContext
{
typedef
struct
MLPDecodeContext
{
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
AVFrame
frame
;
/// Current access unit being read has a major sync.
/// Current access unit being read has a major sync.
int
is_major_sync_unit
;
int
is_major_sync_unit
;
...
@@ -268,9 +267,6 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
...
@@ -268,9 +267,6 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
m
->
substream
[
substr
].
lossless_check_data
=
0xffffffff
;
m
->
substream
[
substr
].
lossless_check_data
=
0xffffffff
;
ff_mlpdsp_init
(
&
m
->
dsp
);
ff_mlpdsp_init
(
&
m
->
dsp
);
avcodec_get_frame_defaults
(
&
m
->
frame
);
avctx
->
coded_frame
=
&
m
->
frame
;
return
0
;
return
0
;
}
}
...
@@ -973,7 +969,7 @@ static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
...
@@ -973,7 +969,7 @@ static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
/** Write the audio data into the output buffer. */
/** Write the audio data into the output buffer. */
static
int
output_data
(
MLPDecodeContext
*
m
,
unsigned
int
substr
,
static
int
output_data
(
MLPDecodeContext
*
m
,
unsigned
int
substr
,
void
*
data
,
int
*
got_frame_ptr
)
AVFrame
*
frame
,
int
*
got_frame_ptr
)
{
{
AVCodecContext
*
avctx
=
m
->
avctx
;
AVCodecContext
*
avctx
=
m
->
avctx
;
SubStream
*
s
=
&
m
->
substream
[
substr
];
SubStream
*
s
=
&
m
->
substream
[
substr
];
...
@@ -989,13 +985,13 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
...
@@ -989,13 +985,13 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
}
}
/* get output buffer */
/* get output buffer */
m
->
frame
.
nb_samples
=
s
->
blockpos
;
frame
->
nb_samples
=
s
->
blockpos
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
m
->
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
;
}
}
data_32
=
(
int32_t
*
)
m
->
frame
.
data
[
0
];
data_32
=
(
int32_t
*
)
frame
->
data
[
0
];
data_16
=
(
int16_t
*
)
m
->
frame
.
data
[
0
];
data_16
=
(
int16_t
*
)
frame
->
data
[
0
];
for
(
i
=
0
;
i
<
s
->
blockpos
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
blockpos
;
i
++
)
{
for
(
out_ch
=
0
;
out_ch
<=
s
->
max_matrix_channel
;
out_ch
++
)
{
for
(
out_ch
=
0
;
out_ch
<=
s
->
max_matrix_channel
;
out_ch
++
)
{
...
@@ -1008,8 +1004,7 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
...
@@ -1008,8 +1004,7 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
}
}
}
}
*
got_frame_ptr
=
1
;
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
m
->
frame
;
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment