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
5ade6bfb
Commit
5ade6bfb
authored
Mar 01, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/examples/demuxing: use AVFrame accessor functions
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
bf90ef03
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
demuxing.c
doc/examples/demuxing.c
+3
-3
No files found.
doc/examples/demuxing.c
View file @
5ade6bfb
...
@@ -98,7 +98,7 @@ static int decode_packet(int *got_frame, int cached)
...
@@ -98,7 +98,7 @@ static int decode_packet(int *got_frame, int cached)
audio_frame_count
++
,
frame
->
nb_samples
,
audio_frame_count
++
,
frame
->
nb_samples
,
av_ts2timestr
(
frame
->
pts
,
&
audio_dec_ctx
->
time_base
));
av_ts2timestr
(
frame
->
pts
,
&
audio_dec_ctx
->
time_base
));
ret
=
av_samples_alloc
(
audio_dst_data
,
&
audio_dst_linesize
,
frame
->
channels
,
ret
=
av_samples_alloc
(
audio_dst_data
,
&
audio_dst_linesize
,
av_frame_get_channels
(
frame
)
,
frame
->
nb_samples
,
frame
->
format
,
1
);
frame
->
nb_samples
,
frame
->
format
,
1
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Could not allocate audio buffer
\n
"
);
fprintf
(
stderr
,
"Could not allocate audio buffer
\n
"
);
...
@@ -107,13 +107,13 @@ static int decode_packet(int *got_frame, int cached)
...
@@ -107,13 +107,13 @@ static int decode_packet(int *got_frame, int cached)
/* TODO: extend return code of the av_samples_* functions so that this call is not needed */
/* TODO: extend return code of the av_samples_* functions so that this call is not needed */
audio_dst_bufsize
=
audio_dst_bufsize
=
av_samples_get_buffer_size
(
NULL
,
frame
->
channels
,
av_samples_get_buffer_size
(
NULL
,
av_frame_get_channels
(
frame
)
,
frame
->
nb_samples
,
frame
->
format
,
1
);
frame
->
nb_samples
,
frame
->
format
,
1
);
/* copy audio data to destination buffer:
/* copy audio data to destination buffer:
* this is required since rawaudio expects non aligned data */
* this is required since rawaudio expects non aligned data */
av_samples_copy
(
audio_dst_data
,
frame
->
data
,
0
,
0
,
av_samples_copy
(
audio_dst_data
,
frame
->
data
,
0
,
0
,
frame
->
nb_samples
,
frame
->
channels
,
frame
->
format
);
frame
->
nb_samples
,
av_frame_get_channels
(
frame
)
,
frame
->
format
);
/* write to rawaudio file */
/* write to rawaudio file */
fwrite
(
audio_dst_data
[
0
],
1
,
audio_dst_bufsize
,
audio_dst_file
);
fwrite
(
audio_dst_data
[
0
],
1
,
audio_dst_bufsize
,
audio_dst_file
);
...
...
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