X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/f8203ea5c494f34cee4fb72fb99b5ca3e429c8a1..f2381d07785eb22548298f3b3b268c986ab1c882:/lib/service/servicemp3.cpp diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 31ae9573..dc84b428 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -362,10 +362,6 @@ eServiceMP3::eServiceMP3(eServiceReference ref) { eDebug("eServiceMP3::subtitle uri: %s", g_filename_to_uri(srt_filename, NULL, NULL)); g_object_set (G_OBJECT (m_gst_playbin), "suburi", g_filename_to_uri(srt_filename, NULL, NULL), NULL); - subtitleStream subs; - subs.type = stSRT; - subs.language_code = std::string("und"); - m_subtitleStreams.push_back(subs); } } else { @@ -1171,7 +1167,7 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) source = GST_MESSAGE_SRC(msg); sourceName = gst_object_get_name(source); -#if 1 +#if 0 if (gst_message_get_structure(msg)) { gchar *string = gst_structure_to_string(gst_message_get_structure(msg)); @@ -1374,8 +1370,7 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) g_signal_emit_by_name (m_gst_playbin, "get-text-pad", i, &pad); if ( pad ) g_signal_connect (G_OBJECT (pad), "notify::caps", G_CALLBACK (gstTextpadHasCAPS), this); - if ( subs.type != stSRT ) - subs.type = getSubtitleType(pad, g_codec); + subs.type = getSubtitleType(pad, g_codec); m_subtitleStreams.push_back(subs); g_free (g_lang); @@ -1811,15 +1806,25 @@ PyObject *eServiceMP3::getSubtitleList() for (std::vector::iterator IterSubtitleStream(m_subtitleStreams.begin()); IterSubtitleStream != m_subtitleStreams.end(); ++IterSubtitleStream) { subtype_t type = IterSubtitleStream->type; - ePyObject tuple = PyTuple_New(5); -// eDebug("eServiceMP3::getSubtitleList idx=%i type=%i, code=%s", stream_idx, int(type), (IterSubtitleStream->language_code).c_str()); - PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(2)); - PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(stream_idx)); - PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong(int(type))); - PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong(0)); - PyTuple_SET_ITEM(tuple, 4, PyString_FromString((IterSubtitleStream->language_code).c_str())); - PyList_Append(l, tuple); - Py_DECREF(tuple); + switch(type) + { + case stUnknown: + case stVOB: + case stPGS: + break; + default: + { + ePyObject tuple = PyTuple_New(5); +// eDebug("eServiceMP3::getSubtitleList idx=%i type=%i, code=%s", stream_idx, int(type), (IterSubtitleStream->language_code).c_str()); + PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(2)); + PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(stream_idx)); + PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong(int(type))); + PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong(0)); + PyTuple_SET_ITEM(tuple, 4, PyString_FromString((IterSubtitleStream->language_code).c_str())); + PyList_Append(l, tuple); + Py_DECREF(tuple); + } + } stream_idx++; } eDebug("eServiceMP3::getSubtitleList finished");