mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
driver/audiodec: metadata fix
This commit is contained in:
@@ -147,6 +147,9 @@ void CBaseDec::ClearMetaData()
|
||||
|
||||
bool CBaseDec::GetMetaDataBase(CAudiofile* const in, const bool nice)
|
||||
{
|
||||
if (in->FileType == CFile::STREAM_AUDIO)
|
||||
return true;
|
||||
|
||||
if (LookupMetaData(in))
|
||||
return true;
|
||||
|
||||
|
@@ -431,14 +431,17 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CFile::FileType ft, CAudioMetaData* m)
|
||||
total_time = 8 * m->filesize / bitrate;
|
||||
|
||||
meta_data_valid = true;
|
||||
m->changed = true;
|
||||
}
|
||||
if (!is_stream) {
|
||||
m->title = title;
|
||||
m->artist = artist;
|
||||
m->date = date;
|
||||
m->album = album;
|
||||
m->genre = genre;
|
||||
m->total_time = total_time;
|
||||
}
|
||||
m->title = title;
|
||||
m->artist = artist;
|
||||
m->date = date;
|
||||
m->album = album;
|
||||
m->genre = genre;
|
||||
m->type_info = type_info;
|
||||
m->total_time = total_time;
|
||||
m->bitrate = bitrate;
|
||||
m->samplerate = samplerate;
|
||||
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <neutrino.h>
|
||||
#include <driver/audioplay.h>
|
||||
#include <driver/netfile.h>
|
||||
#include <eitd/edvbstring.h> // UTF8
|
||||
|
||||
void CAudioPlayer::stop()
|
||||
{
|
||||
@@ -169,24 +170,30 @@ void CAudioPlayer::sc_callback(void *arg)
|
||||
{
|
||||
bool changed=false;
|
||||
CSTATE *stat = (CSTATE*)arg;
|
||||
if(m_Audiofile.MetaData.artist != stat->artist)
|
||||
|
||||
const std::string artist = convertLatin1UTF8(stat->artist);
|
||||
const std::string title = convertLatin1UTF8(stat->title);
|
||||
const std::string station = convertLatin1UTF8(stat->station);
|
||||
const std::string genre = convertLatin1UTF8(stat->genre);
|
||||
|
||||
if(m_Audiofile.MetaData.artist != artist)
|
||||
{
|
||||
m_Audiofile.MetaData.artist = stat->artist;
|
||||
m_Audiofile.MetaData.artist = artist;
|
||||
changed=true;
|
||||
}
|
||||
if (m_Audiofile.MetaData.title != stat->title)
|
||||
if (m_Audiofile.MetaData.title != title)
|
||||
{
|
||||
m_Audiofile.MetaData.title = stat->title;
|
||||
m_Audiofile.MetaData.title = title;
|
||||
changed=true;
|
||||
}
|
||||
if (m_Audiofile.MetaData.sc_station != stat->station)
|
||||
if (m_Audiofile.MetaData.sc_station != station)
|
||||
{
|
||||
m_Audiofile.MetaData.sc_station = stat->station;
|
||||
m_Audiofile.MetaData.sc_station = station;
|
||||
changed=true;
|
||||
}
|
||||
if (m_Audiofile.MetaData.genre != stat->genre)
|
||||
if (m_Audiofile.MetaData.genre != genre)
|
||||
{
|
||||
m_Audiofile.MetaData.genre = stat->genre;
|
||||
m_Audiofile.MetaData.genre = genre;
|
||||
changed=true;
|
||||
}
|
||||
if(changed)
|
||||
|
Reference in New Issue
Block a user