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
b4c56206
Commit
b4c56206
authored
Oct 31, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export: add support for normal M3U, move
UTF-8
mode to M3U8
parent
9d88d50a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
modules/misc/playlist/export.c
modules/misc/playlist/export.c
+7
-0
modules/misc/playlist/m3u.c
modules/misc/playlist/m3u.c
+28
-12
No files found.
modules/misc/playlist/export.c
View file @
b4c56206
...
...
@@ -35,6 +35,7 @@
* Prototypes
***************************************************************************/
int
Export_M3U
(
vlc_object_t
*
p_intf
);
int
Export_M3U8
(
vlc_object_t
*
p_intf
);
int
Export_Old
(
vlc_object_t
*
p_intf
);
int
Export_HTML
(
vlc_object_t
*
p_intf
);
int
xspf_export_playlist
(
vlc_object_t
*
p_intf
);
...
...
@@ -52,6 +53,12 @@ vlc_module_begin ()
set_capability
(
"playlist export"
,
0
)
set_callbacks
(
Export_M3U
,
NULL
)
add_submodule
()
set_description
(
N_
(
"M3U8 playlist export"
)
)
add_shortcut
(
"export-m3u8"
)
set_capability
(
"playlist export"
,
0
)
set_callbacks
(
Export_M3U
,
NULL
)
add_submodule
()
set_description
(
N_
(
"Old playlist export"
)
)
add_shortcut
(
"export-old"
)
...
...
modules/misc/playlist/m3u.c
View file @
b4c56206
...
...
@@ -33,6 +33,7 @@
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_charset.h>
#include <assert.h>
...
...
@@ -40,11 +41,13 @@
* Local prototypes
*****************************************************************************/
int
Export_M3U
(
vlc_object_t
*
);
int
Export_M3U8
(
vlc_object_t
*
);
/*****************************************************************************
* Export_M3U: main export function
*****************************************************************************/
static
void
DoChildren
(
playlist_export_t
*
p_export
,
playlist_item_t
*
p_root
)
static
void
DoChildren
(
playlist_export_t
*
p_export
,
playlist_item_t
*
p_root
,
int
(
*
pf_fprintf
)
(
FILE
*
,
const
char
*
,
...)
)
{
int
i
,
j
;
...
...
@@ -59,7 +62,7 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
if
(
p_current
->
i_children
>=
0
)
{
DoChildren
(
p_export
,
p_current
);
DoChildren
(
p_export
,
p_current
,
pf_fprintf
);
continue
;
}
...
...
@@ -78,14 +81,14 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
if
(
psz_artist
&&
*
psz_artist
)
{
/* write EXTINF with artist */
fprintf
(
p_export
->
p_file
,
"#EXTINF:%i
,%s - %s
\n
"
,
(
int
)(
i_duration
/
1000000
)
,
psz_artist
,
psz_name
);
pf_fprintf
(
p_export
->
p_file
,
"#EXTINF:%"
PRIu64
"
,%s - %s
\n
"
,
i_duration
/
CLOCK_FREQ
,
psz_artist
,
psz_name
);
}
else
{
/* write EXTINF without artist */
fprintf
(
p_export
->
p_file
,
"#EXTINF:%i
,%s
\n
"
,
(
int
)(
i_duration
/
1000000
)
,
psz_name
);
pf_fprintf
(
p_export
->
p_file
,
"#EXTINF:%"
PRIu64
"
,%s
\n
"
,
i_duration
/
CLOCK_FREQ
,
psz_name
);
}
free
(
psz_artist
);
}
...
...
@@ -95,10 +98,10 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
vlc_mutex_lock
(
&
p_current
->
p_input
->
lock
);
for
(
j
=
0
;
j
<
p_current
->
p_input
->
i_options
;
j
++
)
{
fprintf
(
p_export
->
p_file
,
"#EXTVLCOPT:%s
\n
"
,
p_current
->
p_input
->
ppsz_options
[
j
][
0
]
==
':'
?
p_current
->
p_input
->
ppsz_options
[
j
]
+
1
:
p_current
->
p_input
->
ppsz_options
[
j
]
);
pf_
fprintf
(
p_export
->
p_file
,
"#EXTVLCOPT:%s
\n
"
,
p_current
->
p_input
->
ppsz_options
[
j
][
0
]
==
':'
?
p_current
->
p_input
->
ppsz_options
[
j
]
+
1
:
p_current
->
p_input
->
ppsz_options
[
j
]
);
}
vlc_mutex_unlock
(
&
p_current
->
p_input
->
lock
);
...
...
@@ -114,8 +117,21 @@ int Export_M3U( vlc_object_t *p_this )
msg_Dbg
(
p_export
,
"saving using M3U format"
);
/* Write header */
fp
rintf
(
p_export
->
p_file
,
"#EXTM3U
\n
"
);
fp
uts
(
"#EXTM3U
\n
"
,
p_export
->
p_file
);
DoChildren
(
p_export
,
p_export
->
p_root
);
DoChildren
(
p_export
,
p_export
->
p_root
,
utf8_fprintf
);
return
VLC_SUCCESS
;
}
int
Export_M3U8
(
vlc_object_t
*
p_this
)
{
playlist_export_t
*
p_export
=
(
playlist_export_t
*
)
p_this
;
msg_Dbg
(
p_export
,
"saving using M3U8 format"
);
/* Write header */
fputs
(
"#EXTM3U
\n
"
,
p_export
->
p_file
);
DoChildren
(
p_export
,
p_export
->
p_root
,
fprintf
);
return
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