Skip to content

Commit 7be2f22

Browse files
committed
Get the icy-title
1 parent ee7de7e commit 7be2f22

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/mpvprocess.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ void MPVProcess::initializeRX() {
180180
rx_endfile.setPattern("\"event\":\"end-file\",\"reason\":\"([a-z]+)\"");
181181
rx_dvdtitles.setPattern("\\[dvdnav\\] title:\\s+(\\d+)\\s+duration:\\s+(.*)");
182182
rx_brtitles.setPattern("\\[bd\\] idx:\\s+(\\d+)\\s+duration:\\s+([0-9:]+)");
183+
rx_stream_title.setPattern("(?:icy-title: |^ Title: )(.*)");
183184
rx_generic.setPattern("^([A-Z_]+)=(.*)");
184185
}
185186

@@ -308,6 +309,13 @@ void MPVProcess::parseLine(QByteArray ba) {
308309
qDebug() << "MPVProcess::parseLine: br title:" << ID << length;
309310
md.titles.addName(ID, length);
310311
}
312+
else
313+
if (rx_stream_title.indexIn(line) > -1) {
314+
QString s = rx_stream_title.cap(1);
315+
qDebug() << "MPVProcess::parseLine: stream_title:" << s;
316+
md.stream_title = s;
317+
emit receivedStreamTitle(s);
318+
}
311319
if (rx_generic.indexIn(line) > -1) {
312320
QString tag = rx_generic.cap(1);
313321
QString value = rx_generic.cap(2);

src/mpvprocess.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ protected slots:
311311
QRegExp rx_endfile;
312312
QRegExp rx_dvdtitles;
313313
QRegExp rx_brtitles;
314+
QRegExp rx_stream_title;
314315
QRegExp rx_generic;
315316

316317
void initializeRX();

0 commit comments

Comments
 (0)