Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
efd771ed
Commit
efd771ed
authored
Aug 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist art: use vlc_object_t instead of playlist_t
parent
29542f01
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
src/input/meta.c
src/input/meta.c
+1
-1
src/playlist/art.c
src/playlist/art.c
+6
-6
src/playlist/art.h
src/playlist/art.h
+2
-1
src/playlist/fetcher.c
src/playlist/fetcher.c
+2
-1
No files found.
src/input/meta.c
View file @
efd771ed
...
@@ -251,7 +251,7 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
...
@@ -251,7 +251,7 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
psz_type
=
".png"
;
psz_type
=
".png"
;
/* */
/* */
playlist_SaveArt
(
p_playlist
,
p_item
,
playlist_SaveArt
(
VLC_OBJECT
(
p_playlist
)
,
p_item
,
p_attachment
->
p_data
,
p_attachment
->
i_data
,
psz_type
);
p_attachment
->
p_data
,
p_attachment
->
i_data
,
psz_type
);
vlc_input_attachment_Delete
(
p_attachment
);
vlc_input_attachment_Delete
(
p_attachment
);
...
...
src/playlist/art.c
View file @
efd771ed
...
@@ -266,8 +266,8 @@ int playlist_FindArtInCacheUsingItemUID( input_item_t *p_item )
...
@@ -266,8 +266,8 @@ int playlist_FindArtInCacheUsingItemUID( input_item_t *p_item )
}
}
/* */
/* */
int
playlist_SaveArt
(
playlist_t
*
p_playlist
,
input_item_t
*
p_item
,
int
playlist_SaveArt
(
vlc_object_t
*
obj
,
input_item_t
*
p_item
,
const
uint8_t
*
p_buffer
,
int
i_buffer
,
const
char
*
psz_type
)
const
void
*
data
,
size_t
length
,
const
char
*
psz_type
)
{
{
char
*
psz_filename
=
ArtCacheName
(
p_item
,
psz_type
);
char
*
psz_filename
=
ArtCacheName
(
p_item
,
psz_type
);
...
@@ -295,13 +295,13 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
...
@@ -295,13 +295,13 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
FILE
*
f
=
vlc_fopen
(
psz_filename
,
"wb"
);
FILE
*
f
=
vlc_fopen
(
psz_filename
,
"wb"
);
if
(
f
)
if
(
f
)
{
{
if
(
fwrite
(
p_buffer
,
i_buffer
,
1
,
f
)
!=
1
)
if
(
fwrite
(
data
,
1
,
length
,
f
)
!=
length
)
{
{
msg_Err
(
p_playlist
,
"%s: %m"
,
psz_filename
);
msg_Err
(
obj
,
"%s: %m"
,
psz_filename
);
}
}
else
else
{
{
msg_Dbg
(
p_playlist
,
"album art saved to %s"
,
psz_filename
);
msg_Dbg
(
obj
,
"album art saved to %s"
,
psz_filename
);
input_item_SetArtURL
(
p_item
,
psz_uri
);
input_item_SetArtURL
(
p_item
,
psz_uri
);
}
}
fclose
(
f
);
fclose
(
f
);
...
@@ -327,7 +327,7 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
...
@@ -327,7 +327,7 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
if
(
f
)
if
(
f
)
{
{
if
(
fputs
(
"file://"
,
f
)
<
0
||
fputs
(
psz_filename
,
f
)
<
0
)
if
(
fputs
(
"file://"
,
f
)
<
0
||
fputs
(
psz_filename
,
f
)
<
0
)
msg_Err
(
p_playlist
,
"Error writing %s: %m"
,
psz_byuidfile
);
msg_Err
(
obj
,
"Error writing %s: %m"
,
psz_byuidfile
);
fclose
(
f
);
fclose
(
f
);
}
}
free
(
psz_byuidfile
);
free
(
psz_byuidfile
);
...
...
src/playlist/art.h
View file @
efd771ed
...
@@ -37,7 +37,8 @@ typedef struct
...
@@ -37,7 +37,8 @@ typedef struct
int
playlist_FindArtInCache
(
input_item_t
*
);
int
playlist_FindArtInCache
(
input_item_t
*
);
int
playlist_FindArtInCacheUsingItemUID
(
input_item_t
*
);
int
playlist_FindArtInCacheUsingItemUID
(
input_item_t
*
);
int
playlist_SaveArt
(
playlist_t
*
,
input_item_t
*
,
const
uint8_t
*
p_buffer
,
int
i_buffer
,
const
char
*
psz_type
);
int
playlist_SaveArt
(
vlc_object_t
*
,
input_item_t
*
,
const
void
*
,
size_t
,
const
char
*
psz_type
);
#endif
#endif
src/playlist/fetcher.c
View file @
efd771ed
...
@@ -314,7 +314,8 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
...
@@ -314,7 +314,8 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
if
(
psz_type
&&
strlen
(
psz_type
)
>
5
)
if
(
psz_type
&&
strlen
(
psz_type
)
>
5
)
psz_type
=
NULL
;
/* remove extension if it's > to 4 characters */
psz_type
=
NULL
;
/* remove extension if it's > to 4 characters */
playlist_SaveArt
(
p_fetcher
->
p_playlist
,
p_item
,
p_data
,
i_data
,
psz_type
);
playlist_SaveArt
(
VLC_OBJECT
(
p_fetcher
->
p_playlist
),
p_item
,
p_data
,
i_data
,
psz_type
);
}
}
free
(
p_data
);
free
(
p_data
);
...
...
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