diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-04-06 11:55:47 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-04-06 11:55:47 +0000 |
commit | 547d9ed83adefc393db8bae90997edd47e32a726 (patch) | |
tree | 5fe35ba68c30641b92837b3ac4675846130f01ed | |
parent | a096d59bb120ae37e6ea11f7f304e17ee03c4be6 (diff) | |
download | xine-lib-547d9ed83adefc393db8bae90997edd47e32a726.tar.gz xine-lib-547d9ed83adefc393db8bae90997edd47e32a726.tar.bz2 |
sputext subtitles should work again
CVS patchset: 4545
CVS date: 2003/04/06 11:55:47
-rw-r--r-- | src/libsputext/demux_sputext.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 3be00173e..186590d24 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_sputext.c,v 1.14 2003/03/26 18:51:55 miguelfreitas Exp $ + * $Id: demux_sputext.c,v 1.15 2003/04/06 11:55:47 mroi Exp $ * * code based on old libsputext/xine_decoder.c * @@ -854,6 +854,7 @@ static int demux_sputext_seek (demux_plugin_t *this_gen, static void demux_sputext_send_headers(demux_plugin_t *this_gen) { demux_sputext_t *this = (demux_sputext_t*)this_gen; + buf_element_t *buf; #ifdef LOG printf("demux_sputext: send_headers() called\n"); @@ -862,6 +863,13 @@ static void demux_sputext_send_headers(demux_plugin_t *this_gen) { xine_demux_control_start(this->stream); this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 0; this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 0; + + /* enable the SPU channel */ + buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo); + buf->type = BUF_CONTROL_SPU_CHANNEL; + buf->decoder_info[0] = buf->decoder_info[1] = buf->decoder_info[2] = 0; + this->stream->video_fifo->put(this->stream->video_fifo, buf); + this->status = DEMUX_OK; } @@ -869,6 +877,21 @@ static uint32_t demux_sputext_get_capabilities(demux_plugin_t *this_gen) { return DEMUX_CAP_NOCAP; } +static int demux_sputext_get_optional_data(demux_plugin_t *this_gen, + void *data, int data_type) { + int channel = *((int *)data); + + switch (data_type) { + case DEMUX_OPTIONAL_DATA_SPULANG: + if (channel == -1 || channel == 0) { + sprintf(data, "%s", "sub"); + return INPUT_OPTIONAL_SUCCESS; + } + default: + return DEMUX_OPTIONAL_UNSUPPORTED; + } +} + static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input_gen) { @@ -892,7 +915,7 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ this->demux_plugin.get_video_frame = NULL; this->demux_plugin.got_video_frame_cb= NULL; this->demux_plugin.get_capabilities = demux_sputext_get_capabilities; - this->demux_plugin.get_optional_data = NULL; + this->demux_plugin.get_optional_data = demux_sputext_get_optional_data; this->demux_plugin.demux_class = class_gen; this->buflen = 0; |