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
3bbe18fd
Commit
3bbe18fd
authored
Aug 08, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: refer to AVFrame as a pointer, non-functional change
parent
56655ea8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+14
-14
No files found.
modules/codec/avcodec/audio.c
View file @
3bbe18fd
...
@@ -270,8 +270,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -270,8 +270,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
p_block
->
i_flags
|=
BLOCK_FLAG_PRIVATE_REALLOCATED
;
p_block
->
i_flags
|=
BLOCK_FLAG_PRIVATE_REALLOCATED
;
}
}
AVFrame
frame
;
AVFrame
*
frame
=
&
(
AVFrame
)
{
};
memset
(
&
frame
,
0
,
sizeof
(
frame
)
);
for
(
int
got_frame
=
0
;
!
got_frame
;
)
for
(
int
got_frame
=
0
;
!
got_frame
;
)
{
{
...
@@ -283,7 +282,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -283,7 +282,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
pkt
.
data
=
p_block
->
p_buffer
;
pkt
.
data
=
p_block
->
p_buffer
;
pkt
.
size
=
p_block
->
i_buffer
;
pkt
.
size
=
p_block
->
i_buffer
;
int
used
=
avcodec_decode_audio4
(
ctx
,
&
frame
,
&
got_frame
,
&
pkt
);
int
used
=
avcodec_decode_audio4
(
ctx
,
frame
,
&
got_frame
,
&
pkt
);
if
(
used
<
0
)
if
(
used
<
0
)
{
{
msg_Warn
(
p_dec
,
"cannot decode one frame (%zu bytes)"
,
msg_Warn
(
p_dec
,
"cannot decode one frame (%zu bytes)"
,
...
@@ -319,7 +318,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -319,7 +318,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
}
}
/* NOTE WELL: Beyond this point, p_block refers to the DECODED block! */
/* NOTE WELL: Beyond this point, p_block refers to the DECODED block! */
p_block
=
frame
.
opaque
;
p_block
=
frame
->
opaque
;
SetupOutputFormat
(
p_dec
,
true
);
SetupOutputFormat
(
p_dec
,
true
);
if
(
decoder_UpdateAudioFormat
(
p_dec
)
)
if
(
decoder_UpdateAudioFormat
(
p_dec
)
)
goto
drop
;
goto
drop
;
...
@@ -331,7 +330,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -331,7 +330,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
p_sys
->
i_reject_count
--
;
p_sys
->
i_reject_count
--
;
}
}
assert
(
p_block
->
i_nb_samples
>=
(
unsigned
)
frame
.
nb_samples
);
assert
(
p_block
->
i_nb_samples
>=
(
unsigned
)
frame
->
nb_samples
);
/* Interleave audio if required */
/* Interleave audio if required */
if
(
av_sample_fmt_is_planar
(
ctx
->
sample_fmt
)
)
if
(
av_sample_fmt_is_planar
(
ctx
->
sample_fmt
)
)
...
@@ -342,37 +341,38 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -342,37 +341,38 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
const
void
*
planes
[
ctx
->
channels
];
const
void
*
planes
[
ctx
->
channels
];
for
(
int
i
=
0
;
i
<
ctx
->
channels
;
i
++
)
for
(
int
i
=
0
;
i
<
ctx
->
channels
;
i
++
)
planes
[
i
]
=
frame
.
extended_data
[
i
];
planes
[
i
]
=
frame
->
extended_data
[
i
];
aout_Interleave
(
p_buffer
->
p_buffer
,
planes
,
frame
.
nb_samples
,
aout_Interleave
(
p_buffer
->
p_buffer
,
planes
,
frame
->
nb_samples
,
ctx
->
channels
,
p_dec
->
fmt_out
.
audio
.
i_format
);
ctx
->
channels
,
p_dec
->
fmt_out
.
audio
.
i_format
);
if
(
ctx
->
channels
>
AV_NUM_DATA_POINTERS
)
if
(
ctx
->
channels
>
AV_NUM_DATA_POINTERS
)
free
(
frame
.
extended_data
);
free
(
frame
->
extended_data
);
block_Release
(
p_block
);
block_Release
(
p_block
);
p_block
=
p_buffer
;
p_block
=
p_buffer
;
}
}
p_block
->
i_nb_samples
=
frame
->
nb_samples
;
if
(
p_sys
->
b_extract
)
if
(
p_sys
->
b_extract
)
{
/* TODO: do not drop channels... at least not here */
{
/* TODO: do not drop channels... at least not here */
block_t
*
p_buffer
=
block_Alloc
(
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
block_t
*
p_buffer
=
block_Alloc
(
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
*
frame
.
nb_samples
);
*
p_block
->
i_
nb_samples
);
if
(
unlikely
(
p_buffer
==
NULL
)
)
if
(
unlikely
(
p_buffer
==
NULL
)
)
goto
drop
;
goto
drop
;
aout_ChannelExtract
(
p_buffer
->
p_buffer
,
aout_ChannelExtract
(
p_buffer
->
p_buffer
,
p_dec
->
fmt_out
.
audio
.
i_channels
,
p_dec
->
fmt_out
.
audio
.
i_channels
,
p_block
->
p_buffer
,
ctx
->
channels
,
p_block
->
p_buffer
,
ctx
->
channels
,
frame
.
nb_samples
,
p_sys
->
pi_extraction
,
p_block
->
i_
nb_samples
,
p_sys
->
pi_extraction
,
p_dec
->
fmt_out
.
audio
.
i_bitspersample
);
p_dec
->
fmt_out
.
audio
.
i_bitspersample
);
p_buffer
->
i_nb_samples
=
p_block
->
i_nb_samples
;
block_Release
(
p_block
);
block_Release
(
p_block
);
p_block
=
p_buffer
;
p_block
=
p_buffer
;
}
}
p_block
->
i_nb_samples
=
frame
.
nb_samples
;
p_block
->
i_buffer
=
p_block
->
i_nb_samples
p_block
->
i_buffer
=
frame
.
nb_samples
*
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
;
*
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
;
p_block
->
i_pts
=
date_Get
(
&
p_sys
->
end_date
);
p_block
->
i_pts
=
date_Get
(
&
p_sys
->
end_date
);
p_block
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
frame
.
nb_samples
)
p_block
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
-
p_block
->
i_pts
;
p_block
->
i_nb_samples
)
-
p_block
->
i_pts
;
return
p_block
;
return
p_block
;
end:
end:
...
...
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