diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-12-05 15:54:56 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-12-05 15:54:56 +0000 |
commit | 7958ce62d6ae127ee9b8664c8afae5754063389f (patch) | |
tree | 658e11edf004b0ae3ac3114ffe8ed5f8604ccefd /src/libffmpeg | |
parent | b529e4b1f1668c03d3cb35c0c742f301b8c415db (diff) | |
download | xine-lib-7958ce62d6ae127ee9b8664c8afae5754063389f.tar.gz xine-lib-7958ce62d6ae127ee9b8664c8afae5754063389f.tar.bz2 |
cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
CVS patchset: 5844
CVS date: 2003/12/05 15:54:56
Diffstat (limited to 'src/libffmpeg')
-rw-r--r-- | src/libffmpeg/libavcodec/h263.c | 2 | ||||
-rw-r--r-- | src/libffmpeg/xine_decoder.c | 48 | ||||
-rw-r--r-- | src/libffmpeg/xine_encoder.c | 5 |
3 files changed, 27 insertions, 28 deletions
diff --git a/src/libffmpeg/libavcodec/h263.c b/src/libffmpeg/libavcodec/h263.c index 1c18ea743..2d53547ac 100644 --- a/src/libffmpeg/libavcodec/h263.c +++ b/src/libffmpeg/libavcodec/h263.c @@ -5097,7 +5097,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ /* detect buggy encoders which dont set the low_delay flag (divx4/xvid/opendivx)*/ // note we cannot detect divx5 without b-frames easyly (allthough its buggy too) if(s->vo_type==0 && s->vol_control_parameters==0 && s->divx_version==0 && s->picture_number==0){ - printf("looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); + //printf("looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); s->low_delay=1; } diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 99333bd85..3d0b7d98e 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.143 2003/11/29 13:47:26 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.144 2003/12/05 15:54:59 f1rmb Exp $ * * xine decoder plugin using ffmpeg * @@ -157,7 +157,7 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){ if( (this->context->pix_fmt != PIX_FMT_YUV420P) || (width != context->width) || (height != context->height) ) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "ffmpeg: unsupported frame format, DR1 disabled.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: unsupported frame format, DR1 disabled.\n")); this->context->get_buffer = avcodec_default_get_buffer; this->context->release_buffer = avcodec_default_release_buffer; @@ -250,7 +250,7 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) { this->context->flags |= CODEC_FLAG_EMU_EDGE; if (avcodec_open (this->context, this->codec) < 0) { - printf ("ffmpeg: couldn't open decoder\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: couldn't open decoder\n")); free(this->context); this->context = NULL; _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0); @@ -286,7 +286,7 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) { this->codec->capabilities & CODEC_CAP_DR1 ) { this->context->get_buffer = get_buffer; this->context->release_buffer = release_buffer; - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "ffmpeg: direct rendering enabled\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: direct rendering enabled\n")); } #endif } @@ -474,7 +474,7 @@ static void find_sequence_header (ff_video_decoder_t *this, this->video_step = 1500; break; default: - printf ("ffmpeg: invalid/unknown frame rate code : %d \n", + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: invalid/unknown frame rate code : %d \n"), frame_rate_code); this->video_step = 0; } @@ -488,7 +488,7 @@ static void find_sequence_header (ff_video_decoder_t *this, this->codec = avcodec_find_decoder (CODEC_ID_MPEG1VIDEO); if (!this->codec) { - printf ("avcodec_find_decoder (CODEC_ID_MPEG1VIDEO) failed.\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("avcodec_find_decoder (CODEC_ID_MPEG1VIDEO) failed.\n")); abort(); } @@ -906,14 +906,14 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { "Interplay MVE (ffmpeg)"); break; default: - printf ("ffmpeg: unknown video format (buftype: 0x%08X)\n", - buf->type & 0xFFFF0000); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: unknown video format (buftype: 0x%08X)\n"), + buf->type & 0xFFFF0000); _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, - "unknown (ffmpeg)"); + "unknown (ffmpeg)"); } if (!this->codec) { - printf ("ffmpeg: couldn't find decoder\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: couldn't find decoder\n")); return; } @@ -954,8 +954,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if( this->size + buf->size > this->bufsize ) { this->bufsize = this->size + 2 * buf->size; xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - "ffmpeg: increasing source buffer to %d to avoid overflow.\n", - this->bufsize); + _("ffmpeg: increasing source buffer to %d to avoid overflow.\n"), this->bufsize); this->buf = realloc( this->buf, this->bufsize ); } @@ -1018,7 +1017,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { &got_picture, &this->buf[offset], this->size); if (len<0) { - printf ("ffmpeg: error decompressing frame\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "ffmpeg: error decompressing frame\n"); this->size=0; return; } @@ -1027,7 +1026,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { offset += len; if (!got_picture || !this->av_frame->data[0]) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "ffmpeg: didn't get a picture, got %d bytes left\n", this->size); if (this->size>0) @@ -1056,7 +1055,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (len<0 || this->skipframes) { if( !this->skipframes ) - printf ("ffmpeg: error decompressing frame\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "ffmpeg: error decompressing frame\n"); img->bad_frame = 1; } else { img->bad_frame = 0; @@ -1308,7 +1307,7 @@ static void *init_video_plugin (xine_t *xine, void *data) { ff_video_class_t *this; config_values_t *config; - this = (ff_video_class_t *) malloc (sizeof (ff_video_class_t)); + this = (ff_video_class_t *) xine_xmalloc (sizeof (ff_video_class_t)); this->decoder_class.open_plugin = ff_video_open_plugin; this->decoder_class.get_identifier = ff_video_get_identifier; @@ -1443,7 +1442,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) } if (!this->codec) { - printf (" could not open ffmpeg decoder for buf type 0x%X\n", + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "could not open ffmpeg decoder for buf type 0x%X\n", codec_type); return; } @@ -1472,7 +1471,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->decode_buffer = xine_xmalloc(AVCODEC_MAX_AUDIO_FRAME_SIZE); if (avcodec_open (this->context, this->codec) < 0) { - printf ("ffmpeg: couldn't open decoder\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg: couldn't open decoder\n")); _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); return; } @@ -1507,7 +1506,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if( this->size + buf->size > this->bufsize ) { this->bufsize = this->size + 2 * buf->size; xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - "ffmpeg: increasing source buffer to %d to avoid overflow.\n", this->bufsize); + _("ffmpeg: increasing source buffer to %d to avoid overflow.\n"), this->bufsize); this->buf = realloc( this->buf, this->bufsize ); } @@ -1525,7 +1524,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->size); if (bytes_consumed<0) { - printf ("ffmpeg: error decompressing audio frame\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "ffmpeg: error decompressing audio frame\n"); this->size=0; return; } @@ -1536,7 +1535,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out); if (audio_buffer->mem_size == 0) { - printf ("ffmpeg: Help! Allocated audio buffer with nothing in it!\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg: Help! Allocated audio buffer with nothing in it!\n"); return; } @@ -1563,8 +1563,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) offset += bytes_consumed; if (!decode_buffer_size) { - printf ("ffmpeg: didn't get an audio frame, got %d bytes left\n", - this->size); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg: didn't get an audio frame, got %d bytes left\n", this->size); if (this->size>0) memmove (this->buf, &this->buf[offset], this->size); @@ -1655,7 +1655,7 @@ static void *init_audio_plugin (xine_t *xine, void *data) { ff_audio_class_t *this ; - this = (ff_audio_class_t *) malloc (sizeof (ff_audio_class_t)); + this = (ff_audio_class_t *) xine_xmalloc (sizeof (ff_audio_class_t)); this->decoder_class.open_plugin = ff_audio_open_plugin; this->decoder_class.get_identifier = ff_audio_get_identifier; diff --git a/src/libffmpeg/xine_encoder.c b/src/libffmpeg/xine_encoder.c index da8dde351..7c92223e4 100644 --- a/src/libffmpeg/xine_encoder.c +++ b/src/libffmpeg/xine_encoder.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_encoder.c,v 1.8 2003/11/04 20:49:45 mroi Exp $ + * $Id: xine_encoder.c,v 1.9 2003/12/05 15:54:59 f1rmb Exp $ */ /* mpeg encoders for the dxr3 video out plugin. */ @@ -68,9 +68,8 @@ int dxr3_encoder_init(dxr3_driver_t *drv) #if LOG_ENC printf("dxr3_mpeg_encoder: lavc init , version %x\n", avcodec_version()); #endif - this = malloc(sizeof(lavc_data_t)); + this = xine_xmalloc(sizeof(lavc_data_t)); if (!this) return 0; - memset(this, 0, sizeof(lavc_data_t)); this->encoder_data.type = ENC_LAVC; this->encoder_data.on_update_format = lavc_on_update_format; |