diff options
35 files changed, 263 insertions, 139 deletions
diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c index 2bbc7030d..6775a37d3 100644 --- a/src/liba52/xine_decoder.c +++ b/src/liba52/xine_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: xine_decoder.c,v 1.38 2002/10/27 18:02:52 tmmm Exp $ + * $Id: xine_decoder.c,v 1.39 2002/11/12 18:40:50 miguelfreitas Exp $ * * stuff needed to turn liba52 into a xine decoder plugin */ @@ -143,6 +143,13 @@ void a52dec_reset (audio_decoder_t *this_gen) { this->pts = 0; } +void a52dec_discontinuity (audio_decoder_t *this_gen) { + + a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen; + + this->pts = 0; +} + static inline int16_t blah (int32_t i) { if (i > 0x43c07fff) @@ -474,6 +481,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = a52dec_decode_data; this->audio_decoder.reset = a52dec_reset; + this->audio_decoder.discontinuity = a52dec_discontinuity; this->audio_decoder.dispose = a52dec_dispose; this->stream = stream; this->class = (a52dec_class_t *) class_gen; @@ -634,6 +642,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index ceb5a9121..78b52a8b8 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_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: xine_decoder.c,v 1.65 2002/11/11 16:22:58 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.66 2002/11/12 18:40:51 miguelfreitas Exp $ * * xine decoder plugin using ffmpeg * @@ -598,6 +598,12 @@ static void ff_reset (video_decoder_t *this_gen) { #endif } +static void ff_discontinuity (video_decoder_t *this_gen) { +#ifdef LOG + printf ("ffmpeg: ff_discontinuity\n"); +#endif +} + void avcodec_register_all(void) { static int inited = 0; @@ -663,6 +669,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen, this->video_decoder.decode_data = ff_decode_data; this->video_decoder.flush = ff_flush; this->video_decoder.reset = ff_reset; + this->video_decoder.discontinuity = ff_discontinuity; this->video_decoder.dispose = ff_dispose; this->size = 0; @@ -897,6 +904,9 @@ printf(" 2) bytes/send = %d\n", bytes_to_send); static void ff_audio_reset (audio_decoder_t *this_gen) { } +static void ff_audio_discontinuity (audio_decoder_t *this_gen) { +} + static void ff_audio_dispose (audio_decoder_t *this_gen) { ff_audio_decoder_t *this = (ff_audio_decoder_t *) this_gen; @@ -925,6 +935,7 @@ static audio_decoder_t *ff_audio_open_plugin (audio_decoder_class_t *class_gen, this->audio_decoder.decode_data = ff_audio_decode_data; this->audio_decoder.reset = ff_audio_reset; + this->audio_decoder.discontinuity = ff_audio_discontinuity; this->audio_decoder.dispose = ff_audio_dispose; this->output_open = 0; @@ -1006,7 +1017,7 @@ static decoder_info_t dec_info_ffmpeg_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin }, - { PLUGIN_AUDIO_DECODER, 10, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c index b95278316..547b4329d 100644 --- a/src/liblpcm/xine_decoder.c +++ b/src/liblpcm/xine_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: xine_decoder.c,v 1.36 2002/11/11 05:51:14 tmmm Exp $ + * $Id: xine_decoder.c,v 1.37 2002/11/12 18:40:51 miguelfreitas Exp $ * * 31-8-2001 Added LPCM rate sensing. * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -63,6 +63,9 @@ void lpcm_reset (audio_decoder_t *this_gen) { } +void lpcm_discontinuity (audio_decoder_t *this_gen) { +} + void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen; @@ -192,6 +195,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = lpcm_decode_data; this->audio_decoder.reset = lpcm_reset; + this->audio_decoder.discontinuity = lpcm_discontinuity; this->audio_decoder.dispose = lpcm_dispose; this->output_open = 0; @@ -243,6 +247,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c index cd1010273..0433a3243 100644 --- a/src/libmad/xine_decoder.c +++ b/src/libmad/xine_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: xine_decoder.c,v 1.33 2002/10/21 23:22:29 tmattern Exp $ + * $Id: xine_decoder.c,v 1.34 2002/11/12 18:40:51 miguelfreitas Exp $ * * stuff needed to turn libmad into a xine decoder plugin */ @@ -75,6 +75,13 @@ static void mad_reset (audio_decoder_t *this_gen) { } +static void mad_discontinuity (audio_decoder_t *this_gen) { + + mad_decoder_t *this = (mad_decoder_t *) this_gen; + + this->pts = 0; +} + /* utility to scale and round samples to 16 bits */ static inline @@ -276,6 +283,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = mad_decode_data; this->audio_decoder.reset = mad_reset; + this->audio_decoder.discontinuity = mad_discontinuity; this->audio_decoder.dispose = mad_dispose; this->output_open = 0; @@ -335,6 +343,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 6fc38d98a..f0674512f 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -557,6 +557,21 @@ int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end, return ret; } +void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec) { + picture_t *picture = mpeg2dec->picture; + + if( !picture ) + return; + + mpeg2dec->pts = 0; + if ( picture->current_frame ) + picture->current_frame->pts = 0; + if ( picture->forward_reference_frame ) + picture->forward_reference_frame->pts = 0; + if ( picture->backward_reference_frame ) + picture->backward_reference_frame->pts = 0; +} + void mpeg2_reset (mpeg2dec_t * mpeg2dec) { picture_t *picture = mpeg2dec->picture; @@ -564,7 +579,7 @@ void mpeg2_reset (mpeg2dec_t * mpeg2dec) { if( !picture ) return; - mpeg2dec->pts = 0; + mpeg2_discontinuity(mpeg2dec); if( !picture->mpeg1 ) mpeg2dec->is_sequence_needed = 1; diff --git a/src/libmpeg2/mpeg2.h b/src/libmpeg2/mpeg2.h index 2c3bd4799..38e868919 100644 --- a/src/libmpeg2/mpeg2.h +++ b/src/libmpeg2/mpeg2.h @@ -66,6 +66,7 @@ void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec, void mpeg2_flush (mpeg2dec_t * mpeg2dec); void mpeg2_reset (mpeg2dec_t * mpeg2dec); +void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec); /* Not needed, it is defined as static in decode.c, and no-one else called it * currently diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c index 9aa5cf7ab..07034af72 100644 --- a/src/libmpeg2/xine_decoder.c +++ b/src/libmpeg2/xine_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: xine_decoder.c,v 1.42 2002/10/29 01:29:46 guenter Exp $ + * $Id: xine_decoder.c,v 1.43 2002/11/12 18:40:52 miguelfreitas Exp $ * * stuff needed to turn libmpeg2 into a xine decoder plugin */ @@ -113,6 +113,15 @@ static void mpeg2dec_reset (video_decoder_t *this_gen) { pthread_mutex_unlock (&this->lock); } +static void mpeg2dec_discontinuity (video_decoder_t *this_gen) { + mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen; + + pthread_mutex_lock (&this->lock); + + mpeg2_discontinuity (&this->mpeg2); + + pthread_mutex_unlock (&this->lock); +} static void mpeg2dec_dispose (video_decoder_t *this_gen) { @@ -143,6 +152,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = mpeg2dec_decode_data; this->video_decoder.flush = mpeg2dec_flush; this->video_decoder.reset = mpeg2dec_reset; + this->video_decoder.discontinuity = mpeg2dec_discontinuity; this->video_decoder.dispose = mpeg2dec_dispose; this->stream = stream; this->class = (mpeg2_class_t *) class_gen; @@ -203,6 +213,6 @@ static decoder_info_t dec_info_mpeg2 = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libvorbis/xine_decoder.c b/src/libvorbis/xine_decoder.c index cceffc391..bc0bb779f 100644 --- a/src/libvorbis/xine_decoder.c +++ b/src/libvorbis/xine_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: xine_decoder.c,v 1.20 2002/10/27 01:52:15 guenter Exp $ + * $Id: xine_decoder.c,v 1.21 2002/11/12 18:40:52 miguelfreitas Exp $ * * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine */ @@ -79,6 +79,9 @@ static void vorbis_reset (audio_decoder_t *this_gen) { vorbis_block_init(&this->vd,&this->vb); } +static void vorbis_discontinuity (audio_decoder_t *this_gen) { +} + /* Known vorbis comment keys from ogg123 sources*/ static struct { char *key; /* includes the '=' for programming convenience */ @@ -274,6 +277,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, this->audio_decoder.decode_data = vorbis_decode_data; this->audio_decoder.reset = vorbis_reset; + this->audio_decoder.discontinuity = vorbis_discontinuity; this->audio_decoder.dispose = vorbis_dispose; this->stream = stream; @@ -328,6 +332,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 7a6c27206..9b3eee023 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.99 2002/10/31 05:23:02 tmmm Exp $ + * $Id: w32codec.c,v 1.100 2002/11/12 18:40:52 miguelfreitas Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -873,6 +873,9 @@ static void w32v_reset (video_decoder_t *this_gen) { pthread_mutex_unlock(&win32_codec_mutex); } +static void w32v_discontinuity (video_decoder_t *this_gen) { +} + static void w32v_dispose (video_decoder_t *this_gen) { @@ -981,6 +984,12 @@ static void w32a_reset (audio_decoder_t *this_gen) { this->size = 0; } +static void w32a_discontinuity (audio_decoder_t *this_gen) { + + w32a_decoder_t *this = (w32a_decoder_t *) this_gen; + + this->pts = 0; +} static int w32a_init_audio (w32a_decoder_t *this, buf_element_t *buf ) { @@ -1330,6 +1339,7 @@ static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_ this->video_decoder.decode_data = w32v_decode_data; this->video_decoder.flush = w32v_flush; this->video_decoder.reset = w32v_reset; + this->video_decoder.discontinuity = w32v_discontinuity; this->video_decoder.dispose = w32v_dispose; this->stream = stream; @@ -1402,6 +1412,7 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_ this->audio_decoder.decode_data = w32a_decode_data; this->audio_decoder.reset = w32a_reset; + this->audio_decoder.discontinuity = w32a_discontinuity; this->audio_decoder.dispose = w32a_dispose; this->stream = stream; @@ -1491,7 +1502,7 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, - { PLUGIN_AUDIO_DECODER, 10, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, + { PLUGIN_VIDEO_DECODER, 12, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, + { PLUGIN_AUDIO_DECODER, 11, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index f5c86a461..9bbf6fb69 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -24,7 +24,7 @@ * formats can be found here: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: adpcm.c,v 1.22 2002/11/11 05:01:31 tmmm Exp $ + * $Id: adpcm.c,v 1.23 2002/11/12 18:40:53 miguelfreitas Exp $ */ #include <stdio.h> @@ -1253,6 +1253,12 @@ static void adpcm_reset (audio_decoder_t *this_gen) { } +static void adpcm_discontinuity (audio_decoder_t *this_gen) { + + /* adpcm_decoder_t *this = (adpcm_decoder_t *) this_gen; */ + +} + static void adpcm_dispose (audio_decoder_t *this_gen) { adpcm_decoder_t *this = (adpcm_decoder_t *) this_gen; @@ -1281,6 +1287,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = adpcm_decode_data; this->audio_decoder.reset = adpcm_reset; + this->audio_decoder.discontinuity = adpcm_discontinuity; this->audio_decoder.dispose = adpcm_dispose; this->output_open = 0; @@ -1335,6 +1342,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "adpcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "adpcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index 5368d6b5f..f8b9d938f 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -21,7 +21,7 @@ * player. It really works too! It will output a continuous sine wave in * place of the data it should actually send. * - * $Id: fooaudio.c,v 1.2 2002/11/11 05:01:35 tmmm Exp $ + * $Id: fooaudio.c,v 1.3 2002/11/12 18:40:53 miguelfreitas Exp $ */ #include <stdio.h> @@ -225,6 +225,15 @@ static void fooaudio_reset (audio_decoder_t *this_gen) { this->last_pts = -1; } +/* This function resets the last pts value of the audio decoder. */ +static void fooaudio_discontinuity (audio_decoder_t *this_gen) { + + fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen; + + /* this is specific to fooaudio */ + this->last_pts = -1; +} + /* This function closes the audio output and frees the private audio decoder * structure. */ static void fooaudio_dispose (audio_decoder_t *this_gen) { @@ -252,6 +261,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre /* connect the member functions */ this->audio_decoder.decode_data = fooaudio_decode_data; this->audio_decoder.reset = fooaudio_reset; + this->audio_decoder.discontinuity = fooaudio_discontinuity; this->audio_decoder.dispose = fooaudio_dispose; /* connect the stream */ @@ -333,7 +343,7 @@ static decoder_info_t dec_info_audio = { * will export to the public. */ plugin_info_t xine_plugin_info[] = { /* { type, API version, "name", version, special_info, init_function }, */ - { PLUGIN_AUDIO_DECODER, 10, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index c4b286919..902081574 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -44,7 +44,7 @@ * Carsten Bormann * -------------------------------------------------------------------- * - * $Id: gsm610.c,v 1.4 2002/11/11 05:01:32 tmmm Exp $ + * $Id: gsm610.c,v 1.5 2002/11/12 18:40:53 miguelfreitas Exp $ * */ @@ -212,6 +212,9 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { static void gsm610_reset (audio_decoder_t *this_gen) { } +static void gsm610_discontinuity (audio_decoder_t *this_gen) { +} + static void gsm610_dispose (audio_decoder_t *this_gen) { gsm610_decoder_t *this = (gsm610_decoder_t *) this_gen; @@ -237,6 +240,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = gsm610_decode_data; this->audio_decoder.reset = gsm610_reset; + this->audio_decoder.discontinuity = gsm610_discontinuity; this->audio_decoder.dispose = gsm610_dispose; this->output_open = 0; @@ -287,6 +291,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c index a8671c9db..ce6366833 100644 --- a/src/libxineadec/logpcm.c +++ b/src/libxineadec/logpcm.c @@ -30,7 +30,7 @@ * http://sox.sourceforge.net/ * which listed the code as being lifted from Sun Microsystems. * - * $Id: logpcm.c,v 1.8 2002/11/11 05:01:32 tmmm Exp $ + * $Id: logpcm.c,v 1.9 2002/11/12 18:40:53 miguelfreitas Exp $ * */ @@ -232,6 +232,12 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { static void logpcm_reset (audio_decoder_t *this_gen) { } +static void logpcm_discontinuity (audio_decoder_t *this_gen) { + logpcm_decoder_t *this = (logpcm_decoder_t *) this_gen; + + this->pts = 0; +} + static void logpcm_dispose (audio_decoder_t *this_gen) { logpcm_decoder_t *this = (logpcm_decoder_t *) this_gen; @@ -254,6 +260,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = logpcm_decode_data; this->audio_decoder.reset = logpcm_reset; + this->audio_decoder.discontinuity = logpcm_discontinuity; this->audio_decoder.dispose = logpcm_dispose; this->output_open = 0; @@ -300,6 +307,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "logpcm", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "logpcm", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index 71e07d1e3..001349242 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.11 2002/11/11 05:01:33 tmmm Exp $ + * $Id: roqaudio.c,v 1.12 2002/11/12 18:40:53 miguelfreitas Exp $ * */ @@ -150,6 +150,13 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) static void roqaudio_reset (audio_decoder_t *this_gen) { } +static void roqaudio_discontinuity (audio_decoder_t *this_gen) { + + roqaudio_decoder_t *this = (roqaudio_decoder_t *) this_gen; + + this->pts = 0; +} + static void roqaudio_dispose (audio_decoder_t *this_gen) { roqaudio_decoder_t *this = (roqaudio_decoder_t *) this_gen; @@ -174,6 +181,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre this->audio_decoder.decode_data = roqaudio_decode_data; this->audio_decoder.reset = roqaudio_reset; + this->audio_decoder.discontinuity = roqaudio_discontinuity; this->audio_decoder.dispose = roqaudio_dispose; this->size = 0; @@ -230,6 +238,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "roqaudio", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 11, "roqaudio", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index 5ba91eb1d..298e01154 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.19 2002/11/11 05:55:51 tmmm Exp $ + * $Id: cinepak.c,v 1.20 2002/11/12 18:40:53 miguelfreitas Exp $ */ #include <stdlib.h> @@ -464,6 +464,9 @@ static void cvid_reset (video_decoder_t *this_gen) { this->size = 0; } +static void cvid_discontinuity (video_decoder_t *this_gen) { +} + static void cvid_dispose (video_decoder_t *this_gen) { cvid_decoder_t *this = (cvid_decoder_t *) this_gen; @@ -494,6 +497,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = cvid_decode_data; this->video_decoder.flush = cvid_flush; this->video_decoder.reset = cvid_reset; + this->video_decoder.discontinuity = cvid_discontinuity; this->video_decoder.dispose = cvid_dispose; this->size = 0; @@ -549,6 +553,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "cinepak", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "cinepak", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index ac8ae0eeb..1daf75a17 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.c @@ -18,7 +18,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: cyuv.c,v 1.10 2002/11/11 05:55:51 tmmm Exp $ + * $Id: cyuv.c,v 1.11 2002/11/12 18:40:53 miguelfreitas Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -219,6 +219,9 @@ static void cyuv_flush (video_decoder_t *this_gen) { static void cyuv_reset (video_decoder_t *this_gen) { } +static void cyuv_discontinuity (video_decoder_t *this_gen) { +} + static void cyuv_dispose (video_decoder_t *this_gen) { cyuv_decoder_t *this = (cyuv_decoder_t *) this_gen; @@ -237,6 +240,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = cyuv_decode_data; this->video_decoder.flush = cyuv_flush; this->video_decoder.reset = cyuv_reset; + this->video_decoder.discontinuity = cyuv_discontinuity; this->video_decoder.dispose = cyuv_dispose; this->size = 0; @@ -290,6 +294,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "cyuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "cyuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 47cb8028d..6c898093b 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.8 2002/10/23 03:21:20 tmmm Exp $ + * $Id: fli.c,v 1.9 2002/11/12 18:40:53 miguelfreitas Exp $ */ #include <stdio.h> @@ -506,6 +506,9 @@ static void fli_reset (video_decoder_t *this_gen) { this->size = 0; } +static void fli_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -538,6 +541,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = fli_decode_data; this->video_decoder.flush = fli_flush; this->video_decoder.reset = fli_reset; + this->video_decoder.discontinuity = fli_discontinuity; this->video_decoder.dispose = fli_dispose; this->size = 0; @@ -592,7 +596,7 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "fli", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "fli", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 412f5ac86..2ca96e8d9 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -23,7 +23,7 @@ * value from the last frame. This creates a slowly rotating solid color * frame when the frames are played in succession. * - * $Id: foovideo.c,v 1.9 2002/11/11 05:55:51 tmmm Exp $ + * $Id: foovideo.c,v 1.10 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -183,6 +183,11 @@ static void foovideo_reset (video_decoder_t *this_gen) { this->size = 0; } +static void foovideo_discontinuity (video_decoder_t *this_gen) { + foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen; + +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -216,6 +221,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = foovideo_decode_data; this->video_decoder.flush = foovideo_flush; this->video_decoder.reset = foovideo_reset; + this->video_decoder.discontinuity = foovideo_discontinuity; this->video_decoder.dispose = foovideo_dispose; this->size = 0; @@ -300,6 +306,6 @@ static decoder_info_t dec_info_video = { */ plugin_info_t xine_plugin_info[] = { /* { type, API, "name", version, special_info, init_function } */ - { PLUGIN_VIDEO_DECODER, 11, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index c49ebff84..6ebfa1f07 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.7 2002/11/11 05:55:51 tmmm Exp $ + * $Id: idcinvideo.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -334,6 +334,9 @@ static void idcinvideo_reset (video_decoder_t *this_gen) { this->size = 0; } +static void idcinvideo_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -363,6 +366,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = idcinvideo_decode_data; this->video_decoder.flush = idcinvideo_flush; this->video_decoder.reset = idcinvideo_reset; + this->video_decoder.discontinuity = idcinvideo_discontinuity; this->video_decoder.dispose = idcinvideo_dispose; this->size = 0; @@ -411,6 +415,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "idcinvideo", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "idcinvideo", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index 543b704ad..c2fd5d033 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.9 2002/11/11 05:55:51 tmmm Exp $ + * $Id: msrle.c,v 1.10 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -292,6 +292,9 @@ static void msrle_reset (video_decoder_t *this_gen) { this->size = 0; } +static void msrle_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -320,6 +323,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = msrle_decode_data; this->video_decoder.flush = msrle_flush; this->video_decoder.reset = msrle_reset; + this->video_decoder.discontinuity = msrle_discontinuity; this->video_decoder.dispose = msrle_dispose; this->size = 0; @@ -374,6 +378,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "msrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "msrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c index 47de2eb00..598259654 100644 --- a/src/libxinevdec/msvc.c +++ b/src/libxinevdec/msvc.c @@ -22,7 +22,7 @@ * based on overview of Microsoft Video-1 algorithm * by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt * - * $Id: msvc.c,v 1.14 2002/11/11 05:55:51 tmmm Exp $ + * $Id: msvc.c,v 1.15 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdlib.h> @@ -320,6 +320,9 @@ static void msvc_reset (video_decoder_t *this_gen) { this->size = 0; } +static void msvc_discontinuity (video_decoder_t *this_gen) { +} + static void msvc_dispose (video_decoder_t *this_gen) { msvc_decoder_t *this = (msvc_decoder_t *) this_gen; @@ -351,6 +354,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = msvc_decode_data; this->video_decoder.flush = msvc_flush; this->video_decoder.reset = msvc_reset; + this->video_decoder.discontinuity = msvc_discontinuity; this->video_decoder.dispose = msvc_dispose; this->size = 0; @@ -405,6 +409,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "msvc", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "msvc", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index 4130b7184..6382e888d 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.5 2002/11/11 05:55:51 tmmm Exp $ + * $Id: qtrle.c,v 1.6 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -827,6 +827,9 @@ static void qtrle_reset (video_decoder_t *this_gen) { this->size = 0; } +static void qtrle_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -856,6 +859,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = qtrle_decode_data; this->video_decoder.flush = qtrle_flush; this->video_decoder.reset = qtrle_reset; + this->video_decoder.discontinuity = qtrle_discontinuity; this->video_decoder.dispose = qtrle_dispose; this->size = 0; @@ -909,6 +913,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "qtrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "qtrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index ac01e992f..5e215acab 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.7 2002/11/11 05:55:51 tmmm Exp $ + * $Id: qtrpza.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -386,6 +386,9 @@ static void qtrpza_reset (video_decoder_t *this_gen) { this->size = 0; } +static void qtrpza_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -415,6 +418,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = qtrpza_decode_data; this->video_decoder.flush = qtrpza_flush; this->video_decoder.reset = qtrpza_reset; + this->video_decoder.discontinuity = qtrpza_discontinuity; this->video_decoder.dispose = qtrpza_dispose; this->size = 0; @@ -463,6 +467,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "rpza", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "rpza", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index 76c99e5ed..a3ded3765 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.7 2002/11/11 05:55:51 tmmm Exp $ + * $Id: qtsmc.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -618,6 +618,9 @@ static void qtsmc_reset (video_decoder_t *this_gen) { this->size = 0; } +static void qtsmc_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -647,6 +650,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = qtsmc_decode_data; this->video_decoder.flush = qtsmc_flush; this->video_decoder.reset = qtsmc_reset; + this->video_decoder.discontinuity = qtsmc_discontinuity; this->video_decoder.dispose = qtsmc_dispose; this->size = 0; @@ -695,7 +699,7 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "smc", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "smc", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 736efad71..ff7ba044c 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.10 2002/11/11 05:55:52 tmmm Exp $ + * $Id: rgb.c,v 1.11 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -237,6 +237,9 @@ static void rgb_reset (video_decoder_t *this_gen) { this->size = 0; } +static void rgb_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -265,6 +268,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = rgb_decode_data; this->video_decoder.flush = rgb_flush; this->video_decoder.reset = rgb_reset; + this->video_decoder.discontinuity = rgb_discontinuity; this->video_decoder.dispose = rgb_dispose; this->size = 0; @@ -319,6 +323,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/roqvideo.c b/src/libxinevdec/roqvideo.c index bc5245ae2..2c164dae7 100644 --- a/src/libxinevdec/roqvideo.c +++ b/src/libxinevdec/roqvideo.c @@ -18,7 +18,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: roqvideo.c,v 1.13 2002/11/11 05:55:52 tmmm Exp $ + * $Id: roqvideo.c,v 1.14 2002/11/12 18:40:54 miguelfreitas Exp $ */ /* And this is the header that came with the RoQ video decoder: */ @@ -504,6 +504,9 @@ static void roqvideo_flush (video_decoder_t *this_gen) { static void roqvideo_reset (video_decoder_t *this_gen) { } +static void roqvideo_discontinuity (video_decoder_t *this_gen) { +} + static void roqvideo_dispose (video_decoder_t *this_gen) { roqvideo_decoder_t *this = (roqvideo_decoder_t *) this_gen; @@ -529,6 +532,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = roqvideo_decode_data; this->video_decoder.flush = roqvideo_flush; this->video_decoder.reset = roqvideo_reset; + this->video_decoder.discontinuity = roqvideo_discontinuity; this->video_decoder.dispose = roqvideo_dispose; this->size = 0; @@ -582,6 +586,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "roq", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "roq", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/svq1.c b/src/libxinevdec/svq1.c index 4ea3eeaa7..161bd84d2 100644 --- a/src/libxinevdec/svq1.c +++ b/src/libxinevdec/svq1.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: svq1.c,v 1.12 2002/11/11 05:55:52 tmmm Exp $ + * $Id: svq1.c,v 1.13 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -1468,6 +1468,9 @@ static void svq1dec_reset (video_decoder_t *this_gen) { this->size = 0; } +static void svq1dec_discontinuity (video_decoder_t *this_gen) { +} + static void svq1dec_dispose (video_decoder_t *this_gen) { svq1dec_decoder_t *this = (svq1dec_decoder_t *) this_gen; @@ -1502,6 +1505,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = svq1dec_decode_data; this->video_decoder.flush = svq1dec_flush; this->video_decoder.reset = svq1dec_reset; + this->video_decoder.discontinuity = svq1dec_discontinuity; this->video_decoder.dispose = svq1dec_dispose; this->size = 0; @@ -1558,6 +1562,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "svq1", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "svq1", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/wc3video.c b/src/libxinevdec/wc3video.c index 35c5d4052..44fb4bf2a 100644 --- a/src/libxinevdec/wc3video.c +++ b/src/libxinevdec/wc3video.c @@ -22,7 +22,7 @@ * For more information on the WC3 Movie format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: wc3video.c,v 1.8 2002/11/11 05:55:52 tmmm Exp $ + * $Id: wc3video.c,v 1.9 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -463,6 +463,9 @@ static void wc3video_reset (video_decoder_t *this_gen) { this->size = 0; } +static void wc3video_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -492,6 +495,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = wc3video_decode_data; this->video_decoder.flush = wc3video_flush; this->video_decoder.reset = wc3video_reset; + this->video_decoder.discontinuity = wc3video_discontinuity; this->video_decoder.dispose = wc3video_dispose; this->size = 0; @@ -540,6 +544,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "wc3video", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "wc3video", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 358291fe0..a73289f05 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.10 2002/11/11 05:55:52 tmmm Exp $ + * $Id: yuv.c,v 1.11 2002/11/12 18:40:54 miguelfreitas Exp $ */ #include <stdio.h> @@ -263,6 +263,9 @@ static void yuv_reset (video_decoder_t *this_gen) { this->size = 0; } +static void yuv_discontinuity (video_decoder_t *this_gen) { +} + /* * This function frees the video decoder instance allocated to the decoder. */ @@ -293,6 +296,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->video_decoder.decode_data = yuv_decode_data; this->video_decoder.flush = yuv_flush; this->video_decoder.reset = yuv_reset; + this->video_decoder.discontinuity = yuv_discontinuity; this->video_decoder.dispose = yuv_dispose; this->size = 0; @@ -349,6 +353,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 12, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 82dc22baf..a7258618e 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.88 2002/10/31 16:58:14 mroi Exp $ + * $Id: audio_decoder.c,v 1.89 2002/11/12 18:40:54 miguelfreitas Exp $ * * * functions that implement audio decoding @@ -152,10 +152,14 @@ void *audio_decoder_loop (void *stream_gen) { break; case BUF_CONTROL_DISCONTINUITY: + if (stream->audio_decoder_plugin) + stream->audio_decoder_plugin->discontinuity (stream->audio_decoder_plugin); stream->metronom->handle_audio_discontinuity (stream->metronom, DISC_RELATIVE, buf->disc_off); break; case BUF_CONTROL_NEWPTS: + if (stream->audio_decoder_plugin) + stream->audio_decoder_plugin->discontinuity (stream->audio_decoder_plugin); if (buf->decoder_flags && BUF_FLAG_SEEK) { stream->metronom->handle_audio_discontinuity (stream->metronom, DISC_STREAMSEEK, buf->disc_off); } else { diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h index fff415312..847ff9736 100644 --- a/src/xine-engine/audio_decoder.h +++ b/src/xine-engine/audio_decoder.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: audio_decoder.h,v 1.5 2002/10/17 17:43:44 mroi Exp $ + * $Id: audio_decoder.h,v 1.6 2002/11/12 18:40:54 miguelfreitas Exp $ * * xine audio decoder plugin interface * @@ -29,7 +29,7 @@ #include <inttypes.h> #include "buffer.h" -#define AUDIO_DECODER_IFACE_VERSION 10 +#define AUDIO_DECODER_IFACE_VERSION 11 /* * generic xine audio decoder plugin interface @@ -79,6 +79,12 @@ struct audio_decoder_s { void (*reset) (audio_decoder_t *this); /* + * inform decoder that a time reference discontinuity has happened. + * that is, it must forget any currently held pts value + */ + void (*discontinuity) (audio_decoder_t *this); + + /* * close down, free all resources */ void (*dispose) (audio_decoder_t *this); diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index b8f750540..78b044b05 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.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: metronom.c,v 1.99 2002/11/10 13:33:16 mroi Exp $ + * $Id: metronom.c,v 1.100 2002/11/12 18:40:54 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -260,24 +260,15 @@ static void metronom_set_audio_rate (metronom_t *this, int64_t pts_per_smpls) { } static int64_t metronom_got_spu_packet (metronom_t *this, int64_t pts) { - int64_t vpts, video_vpts, vpts_old, vpts_new; + int64_t vpts; pthread_mutex_lock (&this->lock); - vpts_old = pts + this->old_vpts_offset; - vpts_new = pts + this->vpts_offset; - video_vpts = this->video_vpts; if (pts >= 0 ) { - if ( abs(vpts_old - video_vpts) > abs(vpts_new - video_vpts) ) { - vpts = vpts_new; - } else { - vpts = vpts_old; - } - /* printf ("metronom: WARNING:got_spu_packet: vpts=%lld, old offset=%lld, new offset=%lld, video_vpts=%lld\n", vpts, vpts_old, vpts_new, video_vpts); */ + vpts = pts + this->vpts_offset; } else { /* pts < 0 */ vpts = this->vpts_offset; - /* printf ("metronom: WARNING:got_spu_packet: vpts_offset=%lld\n", vpts); */ } pthread_mutex_unlock (&this->lock); @@ -325,30 +316,12 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, printf ("metronom: video_vpts: %lld, audio_vpts: %lld\n", this->video_vpts, this->audio_vpts); #endif -/* What does this stuff ? - diff = this->video_vpts - this->audio_vpts; - if (abs(diff) > AV_DIFF_TOLERANCE) { - if (this->video_vpts > this->audio_vpts) - this->audio_vpts = this->video_vpts; - else - this->video_vpts = this->audio_vpts; - } else { - this->video_drift = diff; - this->video_drift_step = diff / 30; - } -*/ - this->old_vpts_offset = this->vpts_offset; - switch (type) { case DISC_STREAMSTART: #ifdef LOG printf ("metronom: DISC_STREAMSTART\n"); #endif this->vpts_offset = this->video_vpts; - this->video_discontinuity_pts = disc_off; - this->audio_discontinuity_pts = disc_off; - this->in_video_discontinuity = 0; - this->in_audio_discontinuity = 0; this->force_audio_jump = 1; this->force_video_jump = 1; this->video_drift = 0; @@ -358,10 +331,6 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, printf ("metronom: DISC_ABSOLUTE\n"); #endif this->vpts_offset = this->video_vpts - disc_off; - this->video_discontinuity_pts = disc_off; - this->audio_discontinuity_pts = disc_off; - this->in_video_discontinuity = 30; - this->in_audio_discontinuity = 30; this->force_audio_jump = 0; this->force_video_jump = 0; break; @@ -370,10 +339,6 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, printf ("metronom: DISC_RELATIVE\n"); #endif this->vpts_offset = this->vpts_offset - disc_off; - this->video_discontinuity_pts = this->video_vpts - this->vpts_offset; - this->audio_discontinuity_pts = this->audio_vpts - this->vpts_offset; - this->in_video_discontinuity = 30; - this->in_audio_discontinuity = 30; this->force_audio_jump = 0; this->force_video_jump = 0; break; @@ -382,10 +347,6 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, printf ("metronom: DISC_STREAMSEEK\n"); #endif this->vpts_offset = this->video_vpts - disc_off; - this->video_discontinuity_pts = disc_off; - this->audio_discontinuity_pts = disc_off; - this->in_video_discontinuity = 30; - this->in_audio_discontinuity = 30; this->force_audio_jump = 1; this->force_video_jump = 1; this->video_drift = 0; @@ -411,16 +372,6 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { printf("metronom: got_video_frame pts = %lld\n", pts ); #endif - if (this->in_video_discontinuity) { - this->in_video_discontinuity--; - - if (pts && (pts > this->video_discontinuity_pts)) { - this->in_video_discontinuity = 0; - } else { - pts = 0; /* ignore pts during discontinuities */ - } - } - this->img_cpt++; if (pts) { @@ -542,16 +493,6 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, pthread_mutex_lock (&this->lock); - if (this->in_audio_discontinuity) { - this->in_audio_discontinuity--; - - if (pts && (pts > this->audio_discontinuity_pts)) { - this->in_audio_discontinuity = 0; - } else { - pts = 0; /* ignore pts during discontinuities */ - } - } - if (pts) { vpts = pts + this->vpts_offset; diff = this->audio_vpts - vpts; @@ -785,7 +726,6 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { this->av_offset = 0; this->vpts_offset = 0; - this->old_vpts_offset = 0; /* initialize video stuff */ @@ -793,7 +733,6 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { this->video_drift = 0; this->video_drift_step = 0; this->video_discontinuity_count = 0; - this->in_video_discontinuity = 0; this->discontinuity_handled_count = 0; pthread_cond_init (&this->video_discontinuity_reached, NULL); this->img_duration = 3000; @@ -805,7 +744,6 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { this->have_audio = have_audio; this->audio_vpts = PREBUFFER_PTS_OFFSET; - this->in_audio_discontinuity = 0; this->audio_discontinuity_count = 0; pthread_cond_init (&this->audio_discontinuity_reached, NULL); diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h index 85d0c5eb6..0471d1209 100644 --- a/src/xine-engine/metronom.h +++ b/src/xine-engine/metronom.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: metronom.h,v 1.39 2002/10/29 16:02:49 mroi Exp $ + * $Id: metronom.h,v 1.40 2002/11/12 18:40:55 miguelfreitas Exp $ * * metronom: general pts => virtual calculation/assoc * @@ -217,7 +217,6 @@ struct metronom_s { int64_t audio_vpts; int64_t vpts_offset; - int64_t old_vpts_offset; int64_t video_drift; int64_t video_drift_step; @@ -245,12 +244,6 @@ struct metronom_s { int force_video_jump; int force_audio_jump; - int64_t video_discontinuity_pts; - int64_t audio_discontinuity_pts; - - int in_video_discontinuity; - int in_audio_discontinuity; - int64_t img_duration; int img_cpt; int64_t last_video_pts; diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 23a4a17eb..7252818b5 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.108 2002/11/02 15:18:40 mroi Exp $ + * $Id: video_decoder.c,v 1.109 2002/11/12 18:40:55 miguelfreitas Exp $ * */ @@ -244,18 +244,25 @@ void *video_decoder_loop (void *stream_gen) { #ifdef LOG printf ("video_decoder: discontinuity ahead\n"); #endif - + if (stream->video_decoder_plugin) { + stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin); + } + stream->video_in_discontinuity = 1; stream->metronom->handle_video_discontinuity (stream->metronom, DISC_RELATIVE, buf->disc_off); stream->video_in_discontinuity = 0; + break; case BUF_CONTROL_NEWPTS: #ifdef LOG printf ("video_decoder: new pts %lld\n", buf->disc_off); #endif + if (stream->video_decoder_plugin) { + stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin); + } stream->video_in_discontinuity = 1; @@ -265,7 +272,7 @@ void *video_decoder_loop (void *stream_gen) { stream->metronom->handle_video_discontinuity (stream->metronom, DISC_ABSOLUTE, buf->disc_off); } stream->video_in_discontinuity = 0; - + break; case BUF_CONTROL_AUDIO_CHANNEL: diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h index 24a5f650d..022371128 100644 --- a/src/xine-engine/video_decoder.h +++ b/src/xine-engine/video_decoder.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: video_decoder.h,v 1.5 2002/10/17 17:43:44 mroi Exp $ + * $Id: video_decoder.h,v 1.6 2002/11/12 18:40:55 miguelfreitas Exp $ * * xine video decoder plugin interface * @@ -29,7 +29,7 @@ #include <inttypes.h> #include "buffer.h" -#define VIDEO_DECODER_IFACE_VERSION 11 +#define VIDEO_DECODER_IFACE_VERSION 12 /* * generic xine video decoder plugin interface @@ -79,6 +79,12 @@ struct video_decoder_s { void (*reset) (video_decoder_t *this); /* + * inform decoder that a time reference discontinuity has happened. + * that is, it must forget any currently held pts value + */ + void (*discontinuity) (video_decoder_t *this); + + /* * flush out any frames that are still stored in the decoder */ void (*flush) (video_decoder_t *this); @@ -86,7 +92,7 @@ struct video_decoder_s { /* * close down, free all resources */ - void (*dispose) (video_decoder_t *this); + void (*dispose) (video_decoder_t *this); void *node; /*used by plugin loader */ |