From 2a6944aa21b4184d8174b74d9c0fbff807c16c4e Mon Sep 17 00:00:00 2001 From: Rich J Wareham Date: Fri, 14 Sep 2001 21:25:55 +0000 Subject: Added some stuff to make still-frame menus work a bit better, allowed events for UI to find language of audio/spu track CVS patchset: 636 CVS date: 2001/09/14 21:25:55 --- src/libmpeg2/decode.c | 14 ++++++++++++++ src/xine-engine/audio_decoder.c | 11 +++++++++-- src/xine-engine/events.h | 26 ++++++++++++++++++++++++++ src/xine-engine/video_decoder.c | 11 +++++++++-- src/xine-engine/video_out.c | 7 ++++--- src/xine-engine/xine_internal.h | 11 ++++++++++- 6 files changed, 72 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 632440a5f..4dd7e60a2 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -371,6 +371,20 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec) } */ + /* Ensure that the last decoded frame is drawn */ + picture->current_frame->bFrameBad |= mpeg2dec->drop_frame; + + if (picture->picture_coding_type == B_TYPE) { + if (picture->mpeg1) + picture->current_frame->PTS = 0; + mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame); + picture->current_frame->free (picture->current_frame); + picture->current_frame = NULL; + picture->throwaway_frame = NULL; + } else { + mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame); + } + if (picture->throwaway_frame) { picture->throwaway_frame->displayed (picture->throwaway_frame); diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 74a88c2df..eb4761616 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.39 2001/09/12 22:18:47 guenter Exp $ + * $Id: audio_decoder.c,v 1.40 2001/09/14 21:25:55 richwareham Exp $ * * * functions that implement audio decoding @@ -192,8 +192,15 @@ void *audio_decoder_loop (void *this_gen) { if (decoder) { if (this->cur_audio_decoder_plugin != decoder) { - if (this->cur_audio_decoder_plugin) + if (this->cur_audio_decoder_plugin) { this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin); + + /* Since we are changing decoders, warn metronom of a possible + * PTS discontinuity */ + + this->metronom->expect_audio_discontinuity (this->metronom); + this->metronom->expect_video_discontinuity (this->metronom); + } this->cur_audio_decoder_plugin = decoder; this->cur_audio_decoder_plugin->init (this->cur_audio_decoder_plugin, this->audio_out); diff --git a/src/xine-engine/events.h b/src/xine-engine/events.h index a1ec552f5..bcf4eeef7 100644 --- a/src/xine-engine/events.h +++ b/src/xine-engine/events.h @@ -73,6 +73,32 @@ typedef struct spu_event_s { void *data; } spu_event_t; +/** + * UI event - send information to/from UI. + */ +#define XINE_UI_EVENT 0x0004 +typedef struct ui_event_s { + event_t event; + int sub_type; + void *data; + uint32_t data_len; + int handled; +} ui_event_t; + +/* UI sub-types */ + +/* Warn Xine UI that spu/audio stream has changed and to + * update accordingly, data is unused. */ +#define XINE_UI_UPDATE_CHANNEL 0x0001 +/* UI asks for conversion of spu stream number into language. + * if the listener can do it, it sets handled to 1 and writes + * the string into data. data_len is how big this buffer is*/ +#define XINE_UI_GET_SPU_LANG 0x0002 +/* As above but for audio streams */ +#define XINE_UI_GET_AUDIO_LANG 0x0003 + +/* EOF UI sub-types */ + #ifdef __cplusplus } #endif diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index d88f1656c..c03030b31 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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: video_decoder.c,v 1.50 2001/09/12 22:18:47 guenter Exp $ + * $Id: video_decoder.c,v 1.51 2001/09/14 21:25:55 richwareham Exp $ * */ @@ -197,8 +197,15 @@ void *video_decoder_loop (void *this_gen) { if (this->cur_video_decoder_plugin != decoder) { - if (this->cur_video_decoder_plugin) + if (this->cur_video_decoder_plugin) { this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin); + + /* Since we are changing decoders, warn metronom of a possible + * PTS discontinuity */ + + this->metronom->expect_video_discontinuity (this->metronom); + this->metronom->expect_audio_discontinuity (this->metronom); + } this->cur_video_decoder_plugin = decoder; this->cur_video_decoder_plugin->init (this->cur_video_decoder_plugin, this->video_out); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 368f06a58..ad8887e26 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.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: video_out.c,v 1.45 2001/09/12 19:50:41 guenter Exp $ + * $Id: video_out.c,v 1.46 2001/09/14 21:25:55 richwareham Exp $ * */ @@ -183,8 +183,9 @@ static void *video_out_loop (void *this_gen) { vo_set_timer (video_step); - while (this->video_loop_running) { - + while ((this->video_loop_running) || + (!this->video_loop_running && this->display_img_buf_queue->first)) { + /* sigwait(&vo_mask, &dummysignum); */ /* wait for next timer tick */ pause (); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 33af5169d..10aaf0c02 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -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: xine_internal.h,v 1.43 2001/09/01 14:33:00 guenter Exp $ + * $Id: xine_internal.h,v 1.44 2001/09/14 21:25:55 richwareham Exp $ * */ @@ -30,14 +30,23 @@ extern "C" { #include +#ifdef XINE_COMPILE #include "input/input_plugin.h" #include "demuxers/demux.h" +#else +#include "input_plugin.h" +#include "demux.h" +#endif #include "video_out.h" #include "audio_out.h" #include "metronom.h" #include "spu_decoder.h" #include "events.h" +#ifdef XINE_COMPILE #include "libspudec/spu_decoder_api.h" +#else +#include "spu_decoder_api.h" +#endif #define INPUT_PLUGIN_MAX 50 #define DEMUXER_PLUGIN_MAX 50 -- cgit v1.2.3