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
8093b7f2
Commit
8093b7f2
authored
Jan 24, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed embedded art attachment support (close #2416)
parent
b514a038
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
src/input/input.c
src/input/input.c
+6
-6
src/input/meta.c
src/input/meta.c
+19
-7
src/playlist/art.c
src/playlist/art.c
+1
-1
No files found.
src/input/input.c
View file @
8093b7f2
...
...
@@ -2822,26 +2822,26 @@ static void InputUpdateMeta( input_thread_t *p_input, vlc_meta_t *p_meta )
if
(
!
psz_arturl
||
*
psz_arturl
==
'\0'
)
{
psz_arturl
=
vlc_meta_Get
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
);
if
(
psz_
arturl
)
psz_arturl
=
strdup
(
psz_
arturl
);
const
char
*
psz_tmp
=
vlc_meta_Get
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
);
if
(
psz_
tmp
)
psz_arturl
=
strdup
(
psz_
tmp
);
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
if
(
psz_arturl
&&
*
psz_arturl
)
{
vlc_meta_Set
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
,
psz_arturl
);
input_item_SetArtURL
(
p_item
,
psz_arturl
);
if
(
!
strncmp
(
psz_arturl
,
"attachment://"
,
strlen
(
"attachment"
)
)
)
{
/* Don't look for art cover if sout
* XXX It can change when sout has meta data support */
if
(
p_input
->
p
->
p_sout
&&
!
p_input
->
b_preparsing
)
vlc_meta_Set
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
,
""
);
input_item_SetArtURL
(
p_item
,
""
);
else
input_ExtractAttachmentAndCacheArt
(
p_input
);
}
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
free
(
psz_arturl
);
if
(
psz_title
)
...
...
src/input/meta.c
View file @
8093b7f2
...
...
@@ -63,16 +63,20 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
input_item_t
*
p_item
=
p_input
->
p
->
p_item
;
/* */
c
onst
char
*
psz_arturl
=
vlc_meta_Get
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
);
c
har
*
psz_arturl
=
input_item_GetArtURL
(
p_item
);
if
(
!
psz_arturl
||
strncmp
(
psz_arturl
,
"attachment://"
,
strlen
(
"attachment://"
)
)
)
{
msg_Err
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
free
(
psz_arturl
);
return
;
}
playlist_t
*
p_playlist
=
pl_Hold
(
p_input
);
if
(
!
p_playlist
)
{
free
(
psz_arturl
);
return
;
}
if
(
input_item_IsArtFetched
(
p_item
)
)
...
...
@@ -81,26 +85,30 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
* condition */
msg_Warn
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
playlist_FindArtInCache
(
p_item
);
pl_Release
(
p_playlist
);
return
;
goto
exit
;
}
/* */
input_attachment_t
*
p_attachment
=
NULL
;
vlc_mutex_lock
(
&
p_item
->
lock
);
for
(
int
i_idx
=
0
;
i_idx
<
p_input
->
p
->
i_attachment
;
i_idx
++
)
{
if
(
!
strcmp
(
p_input
->
p
->
attachment
[
i_idx
]
->
psz_name
,
&
psz_arturl
[
strlen
(
"attachment://"
)]
)
)
{
p_attachment
=
p_input
->
p
->
attachment
[
i_idx
]
;
p_attachment
=
vlc_input_attachment_Duplicate
(
p_input
->
p
->
attachment
[
i_idx
]
)
;
break
;
}
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
if
(
!
p_attachment
||
p_attachment
->
i_data
<=
0
)
{
if
(
p_attachment
)
vlc_input_attachment_Delete
(
p_attachment
);
msg_Warn
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
pl_Release
(
p_playlist
);
return
;
goto
exit
;
}
/* */
...
...
@@ -114,6 +122,10 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
playlist_SaveArt
(
p_playlist
,
p_item
,
p_attachment
->
p_data
,
p_attachment
->
i_data
,
psz_type
);
pl_Release
(
p_playlist
);
vlc_input_attachment_Delete
(
p_attachment
);
exit:
pl_Release
(
p_input
);
free
(
psz_arturl
);
}
src/playlist/art.c
View file @
8093b7f2
...
...
@@ -221,7 +221,7 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
}
/* Dump it otherwise */
FILE
*
f
=
utf8_fopen
(
psz_filename
+
7
,
"w"
);
FILE
*
f
=
utf8_fopen
(
psz_filename
+
7
,
"w
b
"
);
if
(
f
)
{
if
(
fwrite
(
p_buffer
,
i_buffer
,
1
,
f
)
!=
1
)
...
...
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