Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e1b883b2
Commit
e1b883b2
authored
Apr 05, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle I/O errors properly
(disk full?)
parent
f46a9806
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/input/meta.c
src/input/meta.c
+17
-6
No files found.
src/input/meta.c
View file @
e1b883b2
...
...
@@ -39,6 +39,7 @@ int input_FindArtInCache( playlist_t *p_playlist, input_item_t *p_item );
vlc_bool_t
input_MetaSatisfied
(
playlist_t
*
p_playlist
,
input_item_t
*
p_item
,
uint32_t
*
pi_mandatory
,
uint32_t
*
pi_optional
)
{
(
void
)
p_playlist
;
*
pi_mandatory
=
VLC_META_ENGINE_TITLE
|
VLC_META_ENGINE_ARTIST
;
assert
(
p_item
->
p_meta
);
...
...
@@ -250,18 +251,28 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
p_stream
=
stream_UrlNew
(
p_playlist
,
p_item
->
p_meta
->
psz_arturl
);
if
(
p_stream
)
{
void
*
p_buffer
=
malloc
(
1
<<
16
)
;
uint8_t
p_buffer
[
65536
]
;
long
int
l_read
;
FILE
*
p_file
=
utf8_fopen
(
psz_filename
+
7
,
"w"
);
while
(
(
l_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
16
)
)
)
int
err
=
0
;
while
(
(
l_read
=
stream_Read
(
p_stream
,
p_buffer
,
sizeof
(
p_buffer
)
)
)
)
{
fwrite
(
p_buffer
,
l_read
,
1
,
p_file
);
if
(
fwrite
(
p_buffer
,
l_read
,
1
,
p_file
)
!=
1
)
{
err
=
errno
;
break
;
}
}
free
(
p_buffer
);
fclose
(
p_file
)
;
if
(
fclose
(
p_file
)
&&
!
err
)
err
=
errno
;
stream_Delete
(
p_stream
);
msg_Dbg
(
p_playlist
,
"album art saved to %s
\n
"
,
psz_filename
);
free
(
p_item
->
p_meta
->
psz_arturl
);
if
(
err
)
msg_Err
(
p_playlist
,
"%s: %s"
,
psz_filename
,
strerror
(
err
)
);
else
msg_Dbg
(
p_playlist
,
"album art saved to %s
\n
"
,
psz_filename
);
p_item
->
p_meta
->
psz_arturl
=
strdup
(
psz_filename
);
i_status
=
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