-#ifdef HAVE_GSTREAMER
-
/* note: this requires gstreamer 0.10.x and a big list of plugins. */
/* it's currently hardcoded to use a big-endian alsasink as sink. */
#include <lib/base/ebase.h>
extensions.push_back("mp4");
extensions.push_back("mov");
extensions.push_back("m4a");
- extensions.push_back("m2ts");
sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
}
m_stream_tags = 0;
m_currentAudioStream = -1;
m_currentSubtitleStream = 0;
+ m_audioStream_manually_changed = FALSE;
m_subtitle_widget = 0;
m_currentTrickRatio = 0;
m_subs_to_pull = 0;
{
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
{
if (ppos < 0)
ppos = 0;
+ m_audioStream_manually_changed = TRUE;
int ret = selectAudioStream(i);
if (!ret) {
/* flush */
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));
if ( g_strrstr(sourceName, "videosink") )
m_event((iPlayableService*)this, evUser+11);
else if ( g_strrstr(sourceName, "audiosink") )
- m_event((iPlayableService*)this, evUser+10);
+ {
+ if ( getNumberOfTracks() == 1 || m_audioStream_manually_changed == TRUE )
+ {
+ m_event((iPlayableService*)this, evUser+10);
+ }
+ else
+ {
+ int next_track = getCurrentTrack() + 1;
+ if ( next_track >= getNumberOfTracks() )
+ next_track = 0;
+ selectAudioStream(next_track);
+ }
+ }
}
}
g_error_free(err);
m_audioStreams.clear();
m_subtitleStreams.clear();
+ m_audioStream_manually_changed = FALSE;
for (i = 0; i < n_audio; i++)
{
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);
if ( gst_is_missing_plugin_message(msg) )
{
gchar *description = gst_missing_plugin_message_get_description(msg);
+
if ( description )
{
m_error_message = "GStreamer plugin " + (std::string)description + " not available!\n";
for (std::vector<subtitleStream>::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");
}
}
-#else
-#warning gstreamer not available, not building media player
-#endif