Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
20c4707d
Commit
20c4707d
authored
Feb 18, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do everything with the stream functions (no more fopen)
parent
9cbb86d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
34 deletions
+9
-34
src/misc/image.c
src/misc/image.c
+9
-34
No files found.
src/misc/image.c
View file @
20c4707d
...
...
@@ -205,48 +205,23 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
{
block_t
*
p_block
;
picture_t
*
p_pic
;
FILE
*
file
;
stream_t
*
p_stream
=
NULL
;
int
i_size
;
file
=
utf8_fopen
(
psz_url
,
"rb"
);
if
(
file
)
p_stream
=
stream_UrlNew
(
p_image
->
p_parent
,
psz_url
);
if
(
!
p_stream
)
{
fseek
(
file
,
0
,
SEEK_END
);
i_size
=
ftell
(
file
);
fseek
(
file
,
0
,
SEEK_SET
);
}
else
{
/*msg_Dbg( p_image->p_parent, "could not open file %s for reading",
psz_url );*/
/* if file couldn't be opened, try to open the url with the stream
* functions. Any url can be thus be opened. */
p_stream
=
stream_UrlNew
(
p_image
->
p_parent
,
psz_url
);
if
(
!
p_stream
)
{
msg_Dbg
(
p_image
->
p_parent
,
"could not open %s for reading"
,
psz_url
);
return
NULL
;
}
else
{
i_size
=
stream_Size
(
p_stream
);
}
msg_Dbg
(
p_image
->
p_parent
,
"could not open %s for reading"
,
psz_url
);
return
NULL
;
}
i_size
=
stream_Size
(
p_stream
);
p_block
=
block_New
(
p_image
->
p_parent
,
i_size
);
if
(
file
)
{
fread
(
p_block
->
p_buffer
,
sizeof
(
char
),
i_size
,
file
);
fclose
(
file
);
}
else
{
stream_Read
(
p_stream
,
p_block
->
p_buffer
,
i_size
);
stream_Delete
(
p_stream
);
}
stream_Read
(
p_stream
,
p_block
->
p_buffer
,
i_size
);
stream_Delete
(
p_stream
);
if
(
!
p_fmt_in
->
i_chroma
)
{
...
...
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