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
f79cd98c
Commit
f79cd98c
authored
Apr 03, 2015
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/avio_list_dir: init/deinit network
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
a66dcfee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
avio_list_dir.c
doc/examples/avio_list_dir.c
+6
-3
No files found.
doc/examples/avio_list_dir.c
View file @
f79cd98c
...
@@ -74,17 +74,18 @@ int main(int argc, char *argv[])
...
@@ -74,17 +74,18 @@ int main(int argc, char *argv[])
/* register codecs and formats and other lavf/lavc components*/
/* register codecs and formats and other lavf/lavc components*/
av_register_all
();
av_register_all
();
avformat_network_init
();
if
((
ret
=
avio_open_dir
(
&
ctx
,
input_dir
,
NULL
))
<
0
)
{
if
((
ret
=
avio_open_dir
(
&
ctx
,
input_dir
,
NULL
))
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot open directory: %s.
\n
"
,
av_err2str
(
ret
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot open directory: %s.
\n
"
,
av_err2str
(
ret
));
return
1
;
goto
fail
;
}
}
cnt
=
0
;
cnt
=
0
;
for
(;;)
{
for
(;;)
{
if
((
ret
=
avio_read_dir
(
ctx
,
&
entry
))
<
0
)
{
if
((
ret
=
avio_read_dir
(
ctx
,
&
entry
))
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot list directory: %s.
\n
"
,
av_err2str
(
ret
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot list directory: %s.
\n
"
,
av_err2str
(
ret
));
return
1
;
goto
fail
;
}
}
if
(
!
entry
)
if
(
!
entry
)
break
;
break
;
...
@@ -111,7 +112,9 @@ int main(int argc, char *argv[])
...
@@ -111,7 +112,9 @@ int main(int argc, char *argv[])
cnt
++
;
cnt
++
;
};
};
fail:
avio_close_dir
(
&
ctx
);
avio_close_dir
(
&
ctx
);
avformat_network_deinit
();
return
0
;
return
ret
<
0
?
1
:
0
;
}
}
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