X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9359d0c5d6d7b9f3413adfd00582febf8aea5d40..307b1a3a29f51944baf8866292f6150f6aa8ca62:/lib/service/servicemp3.cpp diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 5c982aa1..19b7735b 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -27,6 +27,7 @@ eServiceFactoryMP3::eServiceFactoryMP3() if (sc) { std::list extensions; + extensions.push_back("mp2"); extensions.push_back("mp3"); extensions.push_back("ogg"); extensions.push_back("mpg"); @@ -226,11 +227,29 @@ eServiceMP3::eServiceMP3(const char *filename): m_filename(filename), m_pump(eAp if (!m_gst_pipeline) m_error_message = "failed to create GStreamer pipeline!\n"; - if ( sourceinfo.containertype == ctCDA ) + if ( sourceinfo.is_streaming ) + { + eDebug("play webradio!"); + source = gst_element_factory_make ("neonhttpsrc", "http-source"); + if (source) + { + g_object_set (G_OBJECT (source), "location", filename, NULL); + g_object_set (G_OBJECT (source), "automatic-redirect", TRUE, NULL); + } + else + m_error_message = "GStreamer plugin neonhttpsrc not available!\n"; + } + else if ( sourceinfo.containertype == ctCDA ) { source = gst_element_factory_make ("cdiocddasrc", "cda-source"); if (source) + { g_object_set (G_OBJECT (source), "device", "/dev/cdroms/cdrom0", NULL); + int track = atoi(filename+18); + eDebug("play audio CD track #%i",track); + if (track > 0) + g_object_set (G_OBJECT (source), "track", track, NULL); + } else sourceinfo.containertype = ctNone; } @@ -242,21 +261,6 @@ eServiceMP3::eServiceMP3(const char *filename): m_filename(filename), m_pump(eAp else m_error_message = "GStreamer can't open filesrc " + (std::string)filename + "!\n"; } - else if ( sourceinfo.is_streaming ) - { - source = gst_element_factory_make ("neonhttpsrc", "http-source"); - if (source) - g_object_set (G_OBJECT (source), "automatic-redirect", TRUE, NULL); - else - m_error_message = "GStreamer plugin neonhttpsrc not available!\n"; - } - else - { - int track = atoi(filename+18); - eDebug("play audio CD track #%i",track); - if (track > 0) - g_object_set (G_OBJECT (source), "track", track, NULL); - } if ( sourceinfo.is_video ) { /* filesrc -> mpegdemux -> | queue_audio -> dvbaudiosink