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
a6361e58
Commit
a6361e58
authored
Apr 05, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle I/O errors
parent
446ff43d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/misc/image.c
src/misc/image.c
+13
-7
No files found.
src/misc/image.c
View file @
a6361e58
/*****************************************************************************
/*****************************************************************************
* image.c : wrapper for image reading/writing facilities
* image.c : wrapper for image reading/writing facilities
*****************************************************************************
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* Copyright (C) 2004
-2007
the VideoLAN team
* $Id$
* $Id$
*
*
* Author: Gildas Bazin <gbazin@videolan.org>
* Author: Gildas Bazin <gbazin@videolan.org>
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
* Preamble
* Preamble
*****************************************************************************/
*****************************************************************************/
#include <ctype.h>
#include <ctype.h>
#include <errno.h>
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include <vlc_codec.h>
#include <vlc_codec.h>
#include <vlc_filter.h>
#include <vlc_filter.h>
...
@@ -242,7 +243,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
...
@@ -242,7 +243,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
*
*
*/
*/
static
void
PicRelease
(
picture_t
*
p_pic
)
{};
static
void
PicRelease
(
picture_t
*
p_pic
)
{
(
void
)
p_pic
;
}
static
block_t
*
ImageWrite
(
image_handler_t
*
p_image
,
picture_t
*
p_pic
,
static
block_t
*
ImageWrite
(
image_handler_t
*
p_image
,
picture_t
*
p_pic
,
video_format_t
*
p_fmt_in
,
video_format_t
*
p_fmt_in
,
...
@@ -351,22 +352,27 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
...
@@ -351,22 +352,27 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
file
=
utf8_fopen
(
psz_url
,
"wb"
);
file
=
utf8_fopen
(
psz_url
,
"wb"
);
if
(
!
file
)
if
(
!
file
)
{
{
msg_Dbg
(
p_image
->
p_parent
,
"could not open file %s for writing"
,
msg_Err
(
p_image
->
p_parent
,
"%s: %s"
,
psz_url
,
strerror
(
errno
)
);
psz_url
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_block
=
ImageWrite
(
p_image
,
p_pic
,
p_fmt_in
,
p_fmt_out
);
p_block
=
ImageWrite
(
p_image
,
p_pic
,
p_fmt_in
,
p_fmt_out
);
int
err
=
0
;
if
(
p_block
)
if
(
p_block
)
{
{
fwrite
(
p_block
->
p_buffer
,
sizeof
(
char
),
p_block
->
i_buffer
,
file
);
if
(
fwrite
(
p_block
->
p_buffer
,
p_block
->
i_buffer
,
1
,
file
)
!=
1
)
err
=
errno
;
block_Release
(
p_block
);
block_Release
(
p_block
);
}
}
fclose
(
file
);
if
(
fclose
(
file
)
&&
!
err
)
err
=
errno
;
if
(
err
)
msg_Err
(
p_image
->
p_parent
,
"%s: %s"
,
psz_url
,
strerror
(
err
)
);
return
p_block
?
VLC_SUCCESS
:
VLC_EGENERIC
;
return
err
?
VLC_EGENERIC
:
VLC_SUCCESS
;
}
}
/**
/**
...
...
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