Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
acf912ad
Commit
acf912ad
authored
Jan 31, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio output: flush after writes
detect errors and abort writing if they happen
parent
97111d1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
modules/access/avio.c
modules/access/avio.c
+18
-3
No files found.
modules/access/avio.c
View file @
acf912ad
...
...
@@ -293,13 +293,23 @@ static ssize_t Write(sout_access_out_t *p_access, block_t *p_buffer)
size_t
i_write
=
0
;
while
(
p_buffer
!=
NULL
)
{
block_t
*
p_next
=
p_buffer
->
p_next
;
;
block_t
*
p_next
=
p_buffer
->
p_next
;
#if LIBAVFORMAT_VERSION_MAJOR < 54
i_write
+=
url_write
(
p_sys
->
context
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
int
written
=
url_write
(
p_sys
->
context
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
if
(
written
<
0
)
{
errno
=
AVUNERROR
(
written
);
goto
error
;
}
i_write
+=
written
;
#else
/* FIXME : how are errors notified ?? */
avio_write
(
p_sys
->
context
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
avio_flush
(
p_sys
->
context
);
if
(
p_sys
->
context
->
error
)
{
errno
=
AVUNERROR
(
p_sys
->
context
->
error
);
p_sys
->
context
->
error
=
0
;
/* FIXME? */
goto
error
;
}
i_write
+=
p_buffer
->
i_buffer
;
#endif
...
...
@@ -309,6 +319,11 @@ static ssize_t Write(sout_access_out_t *p_access, block_t *p_buffer)
}
return
i_write
;
error:
msg_Err
(
p_access
,
"Wrote only %zu bytes (%m)"
,
i_write
);
block_ChainRelease
(
p_buffer
);
return
i_write
;
}
static
int
Seek
(
access_t
*
access
,
uint64_t
position
)
...
...
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