mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
parent
c2b61876c4
commit
8e82a64f56
@ -20,6 +20,7 @@ Interface changes
|
||||
::
|
||||
|
||||
--- mpv 0.10.0 will be released ---
|
||||
- add "playlist/N/title" property
|
||||
- add --video-stereo-mode=no to disable auto-conversions
|
||||
- add --force-seekable, and change default seekability in some cases
|
||||
- add vf yadif/vavpp/vdpaupp interlaced-only suboptions
|
||||
|
@ -1530,6 +1530,11 @@ Property list
|
||||
been unloaded yet; in this case, ``current`` refers to the new
|
||||
selection. (Since mpv 0.7.0.)
|
||||
|
||||
``playlist/N/title``
|
||||
Name of the Nth entry. Only available if the playlist file contains
|
||||
such fields, and only if mpv's parser supports it for the given
|
||||
playlist format.
|
||||
|
||||
When querying the property with the client API using ``MPV_FORMAT_NODE``,
|
||||
or with Lua ``mp.get_property_native``, this will return a mpv_node with
|
||||
the following contents:
|
||||
@ -1541,6 +1546,7 @@ Property list
|
||||
"filename" MPV_FORMAT_STRING
|
||||
"current" MPV_FORMAT_FLAG (might be missing; since mpv 0.7.0)
|
||||
"playing" MPV_FORMAT_FLAG (same)
|
||||
"title" MPV_FORMAT_STRING (optional)
|
||||
|
||||
``track-list``
|
||||
List of audio/video/sub tracks, current entry marked. Currently, the raw
|
||||
|
@ -34,6 +34,8 @@ struct playlist_entry {
|
||||
struct playlist_param *params;
|
||||
int num_params;
|
||||
|
||||
char *title;
|
||||
|
||||
// Set to true if playback didn't seem to work, or if the file could be
|
||||
// played only for a very short time. This is used to make playlist
|
||||
// navigation just work in case the user has unplayable files in the
|
||||
|
@ -112,11 +112,25 @@ static int parse_m3u(struct pl_parser *p)
|
||||
ok:
|
||||
if (p->probing)
|
||||
return 0;
|
||||
char *title = NULL;
|
||||
while (line.len || !pl_eof(p)) {
|
||||
if (line.len > 0 && !bstr_startswith0(line, "#"))
|
||||
pl_add(p, line);
|
||||
if (bstr_eatstart0(&line, "#EXTINF:")) {
|
||||
bstr duration, btitle;
|
||||
if (bstr_split_tok(line, ",", &duration, &btitle) && btitle.len) {
|
||||
talloc_free(title);
|
||||
title = bstrto0(NULL, btitle);
|
||||
}
|
||||
} else if (line.len > 0 && !bstr_startswith0(line, "#")) {
|
||||
char *fn = bstrto0(NULL, line);
|
||||
struct playlist_entry *e = playlist_entry_new(fn);
|
||||
talloc_free(fn);
|
||||
e->title = talloc_steal(e, title);
|
||||
title = NULL;
|
||||
playlist_add(p->pl, e);
|
||||
}
|
||||
line = bstr_strip(pl_get_line(p));
|
||||
}
|
||||
talloc_free(title);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -363,8 +363,6 @@ static int mp_property_media_title(void *ctx, struct m_property *prop,
|
||||
name = mpctx->opts->media_title;
|
||||
if (name && name[0])
|
||||
return m_property_strdup_ro(action, arg, name);
|
||||
if (name && name[0])
|
||||
return m_property_strdup_ro(action, arg, name);
|
||||
if (mpctx->master_demuxer) {
|
||||
name = mp_tags_get_str(mpctx->master_demuxer->metadata, "title");
|
||||
if (name && name[0])
|
||||
@ -373,6 +371,8 @@ static int mp_property_media_title(void *ctx, struct m_property *prop,
|
||||
if (name && name[0])
|
||||
return m_property_strdup_ro(action, arg, name);
|
||||
}
|
||||
if (mpctx->playing && mpctx->playing->title)
|
||||
return m_property_strdup_ro(action, arg, mpctx->playing->title);
|
||||
return mp_property_filename(ctx, prop, action, arg);
|
||||
}
|
||||
|
||||
@ -2923,6 +2923,7 @@ static int get_playlist_entry(int item, int action, void *arg, void *ctx)
|
||||
{"filename", SUB_PROP_STR(e->filename)},
|
||||
{"current", SUB_PROP_FLAG(1), .unavailable = !current},
|
||||
{"playing", SUB_PROP_FLAG(1), .unavailable = !playing},
|
||||
{"title", SUB_PROP_STR(e->title), .unavailable = !e->title},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user