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
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 )
...
@@ -2822,26 +2822,26 @@ static void InputUpdateMeta( input_thread_t *p_input, vlc_meta_t *p_meta )
if
(
!
psz_arturl
||
*
psz_arturl
==
'\0'
)
if
(
!
psz_arturl
||
*
psz_arturl
==
'\0'
)
{
{
psz_arturl
=
vlc_meta_Get
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
);
const
char
*
psz_tmp
=
vlc_meta_Get
(
p_item
->
p_meta
,
vlc_meta_ArtworkURL
);
if
(
psz_
arturl
)
if
(
psz_
tmp
)
psz_arturl
=
strdup
(
psz_
arturl
);
psz_arturl
=
strdup
(
psz_
tmp
);
}
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
if
(
psz_arturl
&&
*
psz_arturl
)
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"
)
)
)
if
(
!
strncmp
(
psz_arturl
,
"attachment://"
,
strlen
(
"attachment"
)
)
)
{
{
/* Don't look for art cover if sout
/* Don't look for art cover if sout
* XXX It can change when sout has meta data support */
* XXX It can change when sout has meta data support */
if
(
p_input
->
p
->
p_sout
&&
!
p_input
->
b_preparsing
)
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
else
input_ExtractAttachmentAndCacheArt
(
p_input
);
input_ExtractAttachmentAndCacheArt
(
p_input
);
}
}
}
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
free
(
psz_arturl
);
free
(
psz_arturl
);
if
(
psz_title
)
if
(
psz_title
)
...
...
src/input/meta.c
View file @
8093b7f2
...
@@ -63,16 +63,20 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
...
@@ -63,16 +63,20 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
input_item_t
*
p_item
=
p_input
->
p
->
p_item
;
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://"
)
)
)
if
(
!
psz_arturl
||
strncmp
(
psz_arturl
,
"attachment://"
,
strlen
(
"attachment://"
)
)
)
{
{
msg_Err
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
msg_Err
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
free
(
psz_arturl
);
return
;
return
;
}
}
playlist_t
*
p_playlist
=
pl_Hold
(
p_input
);
playlist_t
*
p_playlist
=
pl_Hold
(
p_input
);
if
(
!
p_playlist
)
if
(
!
p_playlist
)
{
free
(
psz_arturl
);
return
;
return
;
}
if
(
input_item_IsArtFetched
(
p_item
)
)
if
(
input_item_IsArtFetched
(
p_item
)
)
...
@@ -81,26 +85,30 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
...
@@ -81,26 +85,30 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
* condition */
* condition */
msg_Warn
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
msg_Warn
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
playlist_FindArtInCache
(
p_item
);
playlist_FindArtInCache
(
p_item
);
pl_Release
(
p_playlist
);
goto
exit
;
return
;
}
}
/* */
/* */
input_attachment_t
*
p_attachment
=
NULL
;
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
++
)
for
(
int
i_idx
=
0
;
i_idx
<
p_input
->
p
->
i_attachment
;
i_idx
++
)
{
{
if
(
!
strcmp
(
p_input
->
p
->
attachment
[
i_idx
]
->
psz_name
,
if
(
!
strcmp
(
p_input
->
p
->
attachment
[
i_idx
]
->
psz_name
,
&
psz_arturl
[
strlen
(
"attachment://"
)]
)
)
&
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
;
break
;
}
}
}
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
if
(
!
p_attachment
||
p_attachment
->
i_data
<=
0
)
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"
);
msg_Warn
(
p_input
,
"internal input error with input_ExtractAttachmentAndCacheArt"
);
pl_Release
(
p_playlist
);
goto
exit
;
return
;
}
}
/* */
/* */
...
@@ -114,6 +122,10 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
...
@@ -114,6 +122,10 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
playlist_SaveArt
(
p_playlist
,
p_item
,
playlist_SaveArt
(
p_playlist
,
p_item
,
p_attachment
->
p_data
,
p_attachment
->
i_data
,
psz_type
);
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,
...
@@ -221,7 +221,7 @@ int playlist_SaveArt( playlist_t *p_playlist, input_item_t *p_item,
}
}
/* Dump it otherwise */
/* Dump it otherwise */
FILE
*
f
=
utf8_fopen
(
psz_filename
+
7
,
"w"
);
FILE
*
f
=
utf8_fopen
(
psz_filename
+
7
,
"w
b
"
);
if
(
f
)
if
(
f
)
{
{
if
(
fwrite
(
p_buffer
,
i_buffer
,
1
,
f
)
!=
1
)
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