From: Andreas Monzner Date: Mon, 6 Oct 2008 22:25:45 +0000 (+0000) Subject: fix compiler warnings X-Git-Tag: 2.6.0~803 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/230e936d158bc6375043a455857e36857a78dcea fix compiler warnings --- diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index df9bfe07..516ce6eb 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -814,19 +814,19 @@ RESULT eServiceMP3::getTrackInfo(struct iAudioTrackInfo &info, unsigned int i) // eDebug("eServiceMP3::getTrackInfo(&info, %i)",i); if (i >= m_audioStreams.size()) return -2; - if (m_audioStreams[i].type == audioStream::atMPEG) + if (m_audioStreams[i].type == atMPEG) info.m_description = "MPEG"; - else if (m_audioStreams[i].type == audioStream::atMP3) + else if (m_audioStreams[i].type == atMP3) info.m_description = "MP3"; - else if (m_audioStreams[i].type == audioStream::atAC3) + else if (m_audioStreams[i].type == atAC3) info.m_description = "AC3"; - else if (m_audioStreams[i].type == audioStream::atAAC) + else if (m_audioStreams[i].type == atAAC) info.m_description = "AAC"; - else if (m_audioStreams[i].type == audioStream::atDTS) + else if (m_audioStreams[i].type == atDTS) info.m_description = "DTS"; - else if (m_audioStreams[i].type == audioStream::atPCM) + else if (m_audioStreams[i].type == atPCM) info.m_description = "PCM"; - else if (m_audioStreams[i].type == audioStream::atOGG) + else if (m_audioStreams[i].type == atOGG) info.m_description = "OGG"; else info.m_description = "???"; @@ -949,7 +949,7 @@ GstBusSyncReply eServiceMP3::gstBusSyncHandler(GstBus *bus, GstMessage *message, return GST_BUS_PASS; } -int eServiceMP3::gstCheckAudioPad(GstStructure* structure) +audiotype_t eServiceMP3::gstCheckAudioPad(GstStructure* structure) { const gchar* type; type = gst_structure_get_name(structure); @@ -963,29 +963,29 @@ int eServiceMP3::gstCheckAudioPad(GstStructure* structure) case 1: { if ( layer == 3 ) - return audioStream::atMP3; + return atMP3; else - return audioStream::atMPEG; + return atMPEG; } case 2: - return audioStream::atMPEG; + return atMPEG; case 4: - return audioStream::atAAC; + return atAAC; default: - return audioStream::atUnknown; + return atUnknown; } } else { eDebug("mime %s", type); if (!strcmp(type, "audio/x-ac3") || !strcmp(type, "audio/ac3")) - return audioStream::atAC3; + return atAC3; else if (!strcmp(type, "audio/x-dts") || !strcmp(type, "audio/dts")) - return audioStream::atDTS; + return atDTS; else if (!strcmp(type, "audio/x-raw-int")) - return audioStream::atPCM; + return atPCM; } - return audioStream::atUnknown; + return atUnknown; } void eServiceMP3::gstCBpadAdded(GstElement *decodebin, GstPad *pad, gpointer user_data) diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index 2308fa87..fc3c85ff 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -43,6 +43,8 @@ public: typedef struct _GstElement GstElement; +typedef enum { atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG } audiotype_t; + class eServiceMP3: public iPlayableService, public iPauseableService, public iServiceInformation, public iSeekableService, public iAudioTrackSelection, public iAudioChannelSelection, public iSubtitleOutput, public Object { @@ -113,7 +115,7 @@ public: struct audioStream { GstPad* pad; - enum { atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG } type; + audiotype_t type; std::string language_code; /* iso-639, if available. */ audioStream() :pad(0), type(atUnknown) @@ -152,7 +154,7 @@ private: GstTagList *m_stream_tags; eFixedMessagePump m_pump; - int gstCheckAudioPad(GstStructure* structure); + audiotype_t gstCheckAudioPad(GstStructure* structure); void gstBusCall(GstBus *bus, GstMessage *msg); static GstBusSyncReply gstBusSyncHandler(GstBus *bus, GstMessage *message, gpointer user_data); static void gstCBpadAdded(GstElement *decodebin, GstPad *pad, gpointer data); /* for mpegdemux */