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
c3706bc2
Commit
c3706bc2
authored
Mar 28, 2017
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/examples/filtering_*: switch to codecpar
parent
c0628919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
filtering_audio.c
doc/examples/filtering_audio.c
+7
-2
filtering_video.c
doc/examples/filtering_video.c
+7
-2
No files found.
doc/examples/filtering_audio.c
View file @
c3706bc2
...
...
@@ -69,7 +69,12 @@ static int open_input_file(const char *filename)
return
ret
;
}
audio_stream_index
=
ret
;
dec_ctx
=
fmt_ctx
->
streams
[
audio_stream_index
]
->
codec
;
/* create decoding context */
dec_ctx
=
avcodec_alloc_context3
(
dec
);
if
(
!
dec_ctx
)
return
AVERROR
(
ENOMEM
);
avcodec_parameters_to_context
(
dec_ctx
,
fmt_ctx
->
streams
[
audio_stream_index
]
->
codecpar
);
av_opt_set_int
(
dec_ctx
,
"refcounted_frames"
,
1
,
0
);
/* init the audio decoder */
...
...
@@ -281,7 +286,7 @@ int main(int argc, char **argv)
}
end:
avfilter_graph_free
(
&
filter_graph
);
avcodec_
close
(
dec_ctx
);
avcodec_
free_context
(
&
dec_ctx
);
avformat_close_input
(
&
fmt_ctx
);
av_frame_free
(
&
frame
);
av_frame_free
(
&
filt_frame
);
...
...
doc/examples/filtering_video.c
View file @
c3706bc2
...
...
@@ -72,7 +72,12 @@ static int open_input_file(const char *filename)
return
ret
;
}
video_stream_index
=
ret
;
dec_ctx
=
fmt_ctx
->
streams
[
video_stream_index
]
->
codec
;
/* create decoding context */
dec_ctx
=
avcodec_alloc_context3
(
dec
);
if
(
!
dec_ctx
)
return
AVERROR
(
ENOMEM
);
avcodec_parameters_to_context
(
dec_ctx
,
fmt_ctx
->
streams
[
video_stream_index
]
->
codecpar
);
av_opt_set_int
(
dec_ctx
,
"refcounted_frames"
,
1
,
0
);
/* init the video decoder */
...
...
@@ -266,7 +271,7 @@ int main(int argc, char **argv)
}
end:
avfilter_graph_free
(
&
filter_graph
);
avcodec_
close
(
dec_ctx
);
avcodec_
free_context
(
&
dec_ctx
);
avformat_close_input
(
&
fmt_ctx
);
av_frame_free
(
&
frame
);
av_frame_free
(
&
filt_frame
);
...
...
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