diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-11-26 19:43:26 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-11-26 19:43:26 +0000 |
commit | 3050d97eb83cfdfb4d04a51231acba47e6addf1c (patch) | |
tree | 4337d69086ce7d870214e7e5f6a028f8b417521e /src/libsputext | |
parent | ae2a2a8e08ab3140d5c7ee3a5f33e7db81f76b09 (diff) | |
download | xine-lib-3050d97eb83cfdfb4d04a51231acba47e6addf1c.tar.gz xine-lib-3050d97eb83cfdfb4d04a51231acba47e6addf1c.tar.bz2 |
lprintf cleanup, pass I.
CVS patchset: 5796
CVS date: 2003/11/26 19:43:26
Diffstat (limited to 'src/libsputext')
-rw-r--r-- | src/libsputext/demux_sputext.c | 20 | ||||
-rw-r--r-- | src/libsputext/xine_decoder.c | 58 | ||||
-rw-r--r-- | src/libsputext/xine_decoder_ogm.c | 56 |
3 files changed, 58 insertions, 76 deletions
diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 770368e5b..6a1b1692d 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.29 2003/11/16 23:33:47 f1rmb Exp $ + * $Id: demux_sputext.c,v 1.30 2003/11/26 19:43:36 f1rmb Exp $ * * code based on old libsputext/xine_decoder.c * @@ -43,14 +43,16 @@ #include <fcntl.h> #include <ctype.h> +#define LOG_MODULE "demux_sputext" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "xine_internal.h" #include "xineutils.h" #include "../demuxers/demux.h" -/* -#define LOG 1 -*/ - #define ERR (void *)-1 #define SUB_MAX_TEXT 5 #define SUB_BUFSIZE 1024 @@ -871,7 +873,7 @@ static int demux_sputext_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) { demux_sputext_t *this = (demux_sputext_t*)this_gen; - lprintf("demux_sputext: seek() called\n"); + lprintf("seek() called\n"); /* simple seeking approach: just go back to start. * decoder will discard subtitles until the desired position. @@ -890,7 +892,7 @@ static void demux_sputext_send_headers(demux_plugin_t *this_gen) { buf_element_t *buf; - lprintf("demux_sputext: send_headers() called\n"); + lprintf("send_headers() called\n"); _x_demux_control_start(this->stream); _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0); @@ -930,7 +932,7 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ input_plugin_t *input = (input_plugin_t *) input_gen; demux_sputext_t *this; - lprintf("demux_sputext: open_plugin() called\n"); + lprintf("open_plugin() called\n"); this = xine_xmalloc (sizeof (demux_sputext_t)); this->stream = stream; @@ -1028,7 +1030,7 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { demux_sputext_class_t *this ; - lprintf("demux_sputext: initializing\n"); + lprintf("initializing\n"); this = xine_xmalloc (sizeof (demux_sputext_class_t)); diff --git a/src/libsputext/xine_decoder.c b/src/libsputext/xine_decoder.c index c856dd827..1bfe66aed 100644 --- a/src/libsputext/xine_decoder.c +++ b/src/libsputext/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.66 2003/11/26 01:03:32 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.67 2003/11/26 19:43:36 f1rmb Exp $ * */ @@ -30,15 +30,17 @@ #include <fcntl.h> #include <ctype.h> +#define LOG_MODULE "sputext_decoder" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "buffer.h" #include "xine_internal.h" #include "xineutils.h" #include "osd.h" -/* -#define LOG 1 -*/ - #define SUB_MAX_TEXT 5 #define SUB_BUFSIZE 1024 @@ -244,11 +246,9 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su this->renderer->show (this->osd, sub_start); this->renderer->hide (this->osd, sub_end); -#ifdef LOG - printf ("sputext: scheduling subtitle >%s< at %lld until %lld, current time is %lld\n", - this->text[0], sub_start, sub_end, - this->stream->xine->clock->get_current_time (this->stream->xine->clock)); -#endif + lprintf ("scheduling subtitle >%s< at %lld until %lld, current time is %lld\n", + this->text[0], sub_start, sub_end, + this->stream->xine->clock->get_current_time (this->stream->xine->clock)); } @@ -281,16 +281,13 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { strcpy( this->text[i], str ); } -#ifdef LOG - printf("libsputext: decoder data [%s]\n", this->text[0]); - printf("libsputext: mode %d timing %d->%d\n", uses_time, start, end); -#endif + lprintf("decoder data [%s]\n", this->text[0]); + lprintf("mode %d timing %d->%d\n", uses_time, start, end); - if( end <= start ) { #ifdef LOG + if( end <= start ) printf("libsputext: discarding subtitle with invalid timing\n"); #endif - } spu_offset = this->stream->master->metronom->get_option (this->stream->master->metronom, METRONOM_SPU_OFFSET); @@ -316,9 +313,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { /* discard old subtitles */ if( diff < 0 ) { -#ifdef LOG - printf("libsputext: discarding old\n"); -#endif + lprintf("discarding old\n"); + return; } @@ -345,9 +341,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { /* discard old subtitles */ if( diff < 0 ) { -#ifdef LOG - printf("libsputext: discarding old\n"); -#endif + lprintf("discarding old\n"); + return; } @@ -368,9 +363,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { if( this->master_started && (status == XINE_STATUS_QUIT || status == XINE_STATUS_STOP) ) { -#ifdef LOG - printf("libsputext: master stopped\n"); -#endif + lprintf("master stopped\n"); + this->width = this->height = 0; return; } @@ -381,9 +375,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { if( this->slave_started && (status == XINE_STATUS_QUIT || status == XINE_STATUS_STOP) ) { -#ifdef LOG - printf("libsputext: slave stopped\n"); -#endif + lprintf("slave stopped\n"); + this->width = this->height = 0; return; } @@ -394,9 +387,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { _x_get_current_info (this->stream->master, &extra_info, sizeof(extra_info) ); } -#ifdef LOG - printf("libsputext: seek_count mismatch\n"); -#endif + + lprintf("seek_count mismatch\n"); } @@ -500,9 +492,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { }; sputext_class_t *this ; -#ifdef LOG - printf("libsputext: init class\n"); -#endif + lprintf("init class\n"); this = (sputext_class_t *) xine_xmalloc (sizeof (sputext_class_t)); diff --git a/src/libsputext/xine_decoder_ogm.c b/src/libsputext/xine_decoder_ogm.c index 98cee9746..21ad356b6 100644 --- a/src/libsputext/xine_decoder_ogm.c +++ b/src/libsputext/xine_decoder_ogm.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_ogm.c,v 1.7 2003/11/11 18:44:55 f1rmb Exp $ + * $Id: xine_decoder_ogm.c,v 1.8 2003/11/26 19:43:36 f1rmb Exp $ * */ @@ -30,15 +30,17 @@ #include <fcntl.h> #include <ctype.h> +#define LOG_MODULE "sputext_ogm_decoder" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "buffer.h" #include "xine_internal.h" #include "xineutils.h" #include "osd.h" -/* -#define LOG 1 -*/ - #define SUB_MAX_TEXT 5 @@ -260,11 +262,9 @@ static void draw_subtitle(spuogm_decoder_t *this, int64_t sub_start, int64_t sub this->renderer->show (this->osd, sub_start); this->renderer->hide (this->osd, sub_end); -#ifdef LOG - printf ("spuogm: scheduling subtitle >%s< at %lld until %lld, current time is %lld\n", - this->text[0], sub_start, sub_end, - this->stream->xine->clock->get_current_time (this->stream->xine->clock)); -#endif + lprintf ("scheduling subtitle >%s< at %lld until %lld, current time is %lld\n", + this->text[0], sub_start, sub_end, + this->stream->xine->clock->get_current_time (this->stream->xine->clock)); } @@ -313,18 +313,17 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { this->lines++; } + lprintf("lines %d\n", this->lines); #ifdef LOG - printf("libspuogm: lines %d\n", this->lines); for(i=0;i<this->lines;i++) - printf("libspuogm: decoder data [%s]\n", this->text[i]); - printf("libspuogm: timing %d->%d\n", start, end); + lprintf("libspuogm: decoder data [%s]\n", this->text[i]); #endif + lprintf("timing %d->%d\n", start, end); - if( end <= start ) { #ifdef LOG + if( end <= start ) printf("libspuogm: discarding subtitle with invalid timing\n"); #endif - } spu_offset = this->stream->master->metronom->get_option (this->stream->master->metronom, METRONOM_SPU_OFFSET); @@ -359,9 +358,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { /* discard old subtitles */ if( diff < 0 ) { -#ifdef LOG - printf("libspuogm: discarding old\n"); -#endif + lprintf("discarding old\n"); return; } @@ -381,9 +378,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { if( this->master_started && (status == XINE_STATUS_QUIT || status == XINE_STATUS_STOP) ) { -#ifdef LOG - printf("libspuogm: master stopped\n"); -#endif + lprintf("master stopped\n"); + this->width = this->height = 0; return; } @@ -394,9 +390,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { if( this->slave_started && (status == XINE_STATUS_QUIT || status == XINE_STATUS_STOP) ) { -#ifdef LOG - printf("libspuogm: slave stopped\n"); -#endif + lprintf("slave stopped\n"); + this->width = this->height = 0; return; } @@ -407,9 +402,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { _x_get_current_info (this->stream->master, &extra_info, sizeof(extra_info) ); } -#ifdef LOG - printf("libspuogm: seek_count mismatch\n"); -#endif + + lprintf("seek_count mismatch\n"); } @@ -470,9 +464,7 @@ static spu_decoder_t *spuogm_class_open_plugin (spu_decoder_class_t *class_gen, spuogm_decoder_t *this ; static char *subtitle_size_strings[] = { "small", "normal", "large", NULL }; -#ifdef LOG - printf ("libspuogm: plugin opened\n"); -#endif + lprintf ("plugin opened\n"); this = (spuogm_decoder_t *) xine_xmalloc (sizeof (spuogm_decoder_t)); @@ -532,9 +524,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { spuogm_class_t *this ; -#ifdef LOG - printf("libspuogm: init class\n"); -#endif + lprintf("init class\n"); this = (spuogm_class_t *) xine_xmalloc (sizeof (spuogm_class_t)); |