pcm_codec->SetMimeParams(strContent);
return pcm_codec;
}
- else if( strContent.Equals("audio/aac")
- || strContent.Equals("audio/aacp") )
+ else if( strContent.Equals("audio/aac") || strContent.Equals("audio/aacp") ||
+ strContent.Equals("audio/x-ms-wma") ||
+ strContent.Equals("audio/x-ape") || strContent.Equals("audio/ape"))
{
DVDPlayerCodec *pCodec = new DVDPlayerCodec;
- if (urlFile.GetProtocol() == "shout" )
- pCodec->SetContentType(strContent);
+ pCodec->SetContentType(strContent);
return pCodec;
}
- else if( strContent.Equals("audio/x-ms-wma") )
- return new DVDPlayerCodec();
- else if( strContent.Equals("audio/x-ape") || strContent.Equals("audio/ape") )
- return new DVDPlayerCodec();
else if( strContent.Equals("application/ogg") || strContent.Equals("audio/ogg"))
return CreateOGGCodec(strFile,filecache);
else if (strContent.Equals("audio/x-xbmc-pcm"))
#include "cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.h"
#include "cores/dvdplayer/DVDStreamInfo.h"
#include "cores/dvdplayer/DVDCodecs/DVDFactoryCodec.h"
+#include "music/tags/TagLoaderTagLib.h"
#include "utils/log.h"
#include "settings/Settings.h"
#include "URL.h"
return false;
}
+ // Extract ReplayGain info
+ // tagLoaderTagLib.Load will try to determine tag type by file extension, so set fallback by contentType
+ CStdString strFallbackFileExtension = "";
+ if (m_strContentType.Equals("audio/aacp") || m_strContentType.Equals("audio/aacp" "audio/aac"))
+ strFallbackFileExtension = "m4a";
+ else if (m_strContentType.Equals("audio/x-ms-wma"))
+ strFallbackFileExtension = "wma";
+ else if (m_strContentType.Equals("audio/x-ape") || m_strContentType.Equals("audio/ape"))
+ strFallbackFileExtension = "ape";
+ CTagLoaderTagLib tagLoaderTagLib;
+ tagLoaderTagLib.Load(strFile, m_tag, strFallbackFileExtension);
+
// we have to decode initial data in order to get channels/samplerate
// for sanity - we read no more than 10 packets
int nErrors = 0;
else if (it->first == "trkn") tag.SetTrackNumber(it->second.toIntPair().first);
else if (it->first == "disk") tag.SetPartOfSet(it->second.toIntPair().first);
else if (it->first == "\251day") tag.SetYear(it->second.toStringList().front().toInt());
+ else if (it->first == "----:com.apple.iTunes:replaygain_track_gain")
+ tag.SetReplayGainTrackGain((int)(atof(it->second.toStringList().front().toCString()) * 100 + 0.5));
+ else if (it->first == "----:com.apple.iTunes:replaygain_album_gain")
+ tag.SetReplayGainAlbumGain((int)(atof(it->second.toStringList().front().toCString()) * 100 + 0.5));
+ else if (it->first == "----:com.apple.iTunes:replaygain_track_peak")
+ tag.SetReplayGainTrackPeak((float)(atof(it->second.toStringList().front().toCString())));
+ else if (it->first == "----:com.apple.iTunes:replaygain_album_peak")
+ tag.SetReplayGainAlbumPeak((float)(atof(it->second.toStringList().front().toCString())));
else if (it->first == "----:com.apple.iTunes:MusicBrainz Artist Id")
tag.SetMusicBrainzArtistID(StringListToVectorString(it->second.toStringList()));
else if (it->first == "----:com.apple.iTunes:MusicBrainz Album Artist Id")