From 671eef9b9d7116af3fc41e4b6838dffb56b45c77 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 16 Sep 2003 10:00:00 +0000 Subject: reverting error patch before making a branch. Original commit message from CVS: reverting error patch before making a branch. --- ext/audiofile/gstafsink.c | 12 +++--------- ext/audiofile/gstafsrc.c | 15 +++++++-------- ext/divx/gstdivxdec.c | 26 +++++++++++--------------- ext/divx/gstdivxenc.c | 14 ++++++-------- ext/ivorbis/vorbisfile.c | 8 ++------ ext/ladspa/gstladspa.c | 8 ++------ ext/lcs/gstcolorspace.c | 4 +--- ext/sdl/sdlvideosink.c | 35 ++++++++++++++--------------------- ext/sndfile/gstsf.c | 42 +++++++++++++++--------------------------- ext/tarkin/gsttarkindec.c | 8 ++------ ext/tarkin/gsttarkinenc.c | 4 +--- ext/xvid/gstxviddec.c | 19 ++++++++----------- ext/xvid/gstxvidenc.c | 14 ++++++-------- 13 files changed, 78 insertions(+), 131 deletions(-) (limited to 'ext') diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c index 3e27adbf..3392717c 100644 --- a/ext/audiofile/gstafsink.c +++ b/ext/audiofile/gstafsink.c @@ -294,9 +294,7 @@ gst_afsink_open_file (GstAFSink *sink) sink->file = fopen (sink->filename, "w"); if (sink->file == NULL) { perror ("open"); - gst_element_gerror(GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(NULL))); + gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL)); return FALSE; } */ @@ -353,9 +351,7 @@ gst_afsink_open_file (GstAFSink *sink) if (sink->file == AF_NULL_FILEHANDLE) { perror ("open"); - gst_element_gerror(GST_ELEMENT (sink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("error openning file %s", sink->filename)); + gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL)); return FALSE; } @@ -378,9 +374,7 @@ gst_afsink_close_file (GstAFSink *sink) { g_print ("WARNING: afsink: oops, error closing !\n"); perror ("close"); - gst_element_gerror(GST_ELEMENT (sink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("error closing file %s", sink->filename)); + gst_element_error (GST_ELEMENT (sink), g_strconcat("closing file \"", sink->filename, "\"", NULL)); } else { GST_FLAG_UNSET (sink, GST_AFSINK_OPEN); diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c index 71b85294..2b817310 100644 --- a/ext/audiofile/gstafsrc.c +++ b/ext/audiofile/gstafsrc.c @@ -306,9 +306,8 @@ gst_afsrc_open_file (GstAFSrc *src) { g_print ("ERROR: gstafsrc: Could not open file %s for reading\n", src->filename); - gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf ("error opening file %s", src->filename)); + gst_element_error (GST_ELEMENT (src), g_strconcat ("opening file \"", + src->filename, "\"", NULL)); return FALSE; } @@ -328,11 +327,13 @@ gst_afsrc_open_file (GstAFSrc *src) break; case AF_SAMPFMT_FLOAT: case AF_SAMPFMT_DOUBLE: - GST_DEBUG ("ERROR: float data not supported yet !\n"); + GST_DEBUG ( + "ERROR: float data not supported yet !\n"); } src->rate = (guint) afGetRate (src->file, AF_DEFAULT_TRACK); src->width = sampleWidth; - GST_DEBUG ("input file: %d channels, %d width, %d rate, signed %s\n", + GST_DEBUG ( + "input file: %d channels, %d width, %d rate, signed %s\n", src->channels, src->width, src->rate, src->is_signed ? "yes" : "no"); } @@ -368,9 +369,7 @@ gst_afsrc_close_file (GstAFSrc *src) { g_print ("WARNING: afsrc: oops, error closing !\n"); perror ("close"); - gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("error closing file %s", src->filename)); + gst_element_error (GST_ELEMENT (src), g_strconcat("closing file \"", src->filename, "\"", NULL)); } else { GST_FLAG_UNSET (src, GST_AFSRC_OPEN); diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c index 173ee75c..011836f9 100644 --- a/ext/divx/gstdivxdec.c +++ b/ext/divx/gstdivxdec.c @@ -221,10 +221,9 @@ gst_divxdec_setup (GstDivxDec *divxdec) /* initialize the handle */ memset(&xinit, 0, sizeof(DEC_INIT)); if ((ret = decore(&handle, DEC_OPT_INIT, &xinit, NULL)) != 0) { - gst_element_gerror(GST_ELEMENT(divxdec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error initializing divx decoding library: %s (%d)", - gst_divxdec_error(ret), ret)); + gst_element_error(GST_ELEMENT(divxdec), + "Error initializing divx decoding library: %s (%d)", + gst_divxdec_error(ret), ret); return FALSE; } @@ -241,10 +240,9 @@ gst_divxdec_setup (GstDivxDec *divxdec) if ((ret = decore(divxdec->handle, DEC_OPT_SETOUT, &output, NULL)) != 0) { - gst_element_gerror(GST_ELEMENT(divxdec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error setting output format: %s (%d)", - gst_divxdec_error(ret), ret)); + gst_element_error(GST_ELEMENT(divxdec), + "Error setting output format: %s (%d)", + gst_divxdec_error(ret), ret); gst_divxdec_unset(divxdec); return FALSE; } @@ -279,9 +277,8 @@ gst_divxdec_chain (GstPad *pad, if (!divxdec->handle) { if (gst_divxdec_negotiate(divxdec) <= 0) { - gst_element_gerror(GST_ELEMENT(divxdec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("No format set - aborting")); + gst_element_error(GST_ELEMENT(divxdec), + "No format set - aborting"); gst_buffer_unref(buf); return; } @@ -304,10 +301,9 @@ gst_divxdec_chain (GstPad *pad, if ((ret = decore(divxdec->handle, DEC_OPT_FRAME, &xframe, NULL))) { - gst_element_gerror(GST_ELEMENT(divxdec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error decoding divx frame: %s (%d)", - gst_divxdec_error(ret), ret)); + gst_element_error(GST_ELEMENT(divxdec), + "Error decoding divx frame: %s (%d)", + gst_divxdec_error(ret), ret); gst_buffer_unref(buf); return; } diff --git a/ext/divx/gstdivxenc.c b/ext/divx/gstdivxenc.c index cbd3159e..bd7547a1 100644 --- a/ext/divx/gstdivxenc.c +++ b/ext/divx/gstdivxenc.c @@ -302,10 +302,9 @@ gst_divxenc_setup (GstDivxEnc *divxenc) output.spatial_passes = 0; if ((ret = encore(&handle, ENC_OPT_INIT, &input, &output))) { - gst_element_gerror(GST_ELEMENT(divxenc), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error setting up divx encoder: %s (%d)", - gst_divxenc_error(ret), ret)); + gst_element_error(GST_ELEMENT(divxenc), + "Error setting up divx encoder: %s (%d)", + gst_divxenc_error(ret), ret); return FALSE; } @@ -364,10 +363,9 @@ gst_divxenc_chain (GstPad *pad, if ((ret = encore(divxenc->handle, ENC_OPT_ENCODE, &xframe, &xres))) { - gst_element_gerror(GST_ELEMENT(divxenc), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error encoding divx frame: %s (%d)", - gst_divxenc_error(ret), ret)); + gst_element_error(GST_ELEMENT(divxenc), + "Error encoding divx frame: %s (%d)", + gst_divxenc_error(ret), ret); gst_buffer_unref(buf); return; } diff --git a/ext/ivorbis/vorbisfile.c b/ext/ivorbis/vorbisfile.c index 125c44c9..86c7baf2 100644 --- a/ext/ivorbis/vorbisfile.c +++ b/ext/ivorbis/vorbisfile.c @@ -496,9 +496,7 @@ gst_ivorbisfile_loop (GstElement *element) /* open our custom ivorbisfile data object with the callbacks we provide */ if (ov_open_callbacks (ivorbisfile, &ivorbisfile->vf, NULL, 0, ivorbisfile_ov_callbacks) < 0) { - gst_element_gerror(element, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("this is not a vorbis file")); + gst_element_error (element, "this is not a vorbis file"); return; } ivorbisfile->need_discont = TRUE; @@ -562,9 +560,7 @@ gst_ivorbisfile_loop (GstElement *element) /* we update the caps for each logical stream */ if (ivorbisfile->vf.current_link != ivorbisfile->current_link) { if (!gst_ivorbisfile_new_link (ivorbisfile, ivorbisfile->vf.current_link)) { - gst_element_gerror(GST_ELEMENT (ivorbisfile), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("could not negotiate format")); + gst_element_error (GST_ELEMENT (ivorbisfile), "could not negotiate format"); } return; } diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c index 2611603f..460bdf12 100644 --- a/ext/ladspa/gstladspa.c +++ b/ext/ladspa/gstladspa.c @@ -701,9 +701,7 @@ gst_ladspa_loop (GstElement *element) } if (!ladspa->bufpool) { - gst_element_gerror(element, "Caps were never set, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(bailing...")); + gst_element_error (element, "Caps were never set, bailing..."); return; } @@ -793,9 +791,7 @@ gst_ladspa_chain (GstPad *pad, GstBuffer *buffer_in) g_return_if_fail (GST_IS_BUFFER (buffer_in)); if (!ladspa->bufpool) { - gst_element_gerror((GstElement*)ladspa, "Caps were never set, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(bailing...")); + gst_element_error ((GstElement*)ladspa, "Caps were never set, bailing..."); return; } diff --git a/ext/lcs/gstcolorspace.c b/ext/lcs/gstcolorspace.c index 00f61e43..0ed3b278 100644 --- a/ext/lcs/gstcolorspace.c +++ b/ext/lcs/gstcolorspace.c @@ -318,9 +318,7 @@ gst_colorspace_srcconnect_func (GstPad *pad, GstCaps *caps, gboolean newcaps) peercaps = peercaps->next; } - //gst_element_gerror(GST_ELEMENT (space), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("could not agree on caps with peer pads")); + //gst_element_error (GST_ELEMENT (space), "could not agree on caps with peer pads"); /* we disable ourself here */ space->disabled = TRUE; diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c index ff77ce15..1a8abafd 100644 --- a/ext/sdl/sdlvideosink.c +++ b/ext/sdl/sdlvideosink.c @@ -159,10 +159,9 @@ gst_sdlvideosink_get_sdl_from_fourcc (GstSDLVideoSink *sdlvideosink, case GST_MAKE_FOURCC('Y','V','Y','U'): return SDL_YVYU_OVERLAY; default: { - gst_element_gerror(GST_ELEMENT(sdlvideosink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Unsupported format %08lx (" GST_FOURCC_FORMAT ")", - code, GST_FOURCC_ARGS(code))); + gst_element_error(GST_ELEMENT(sdlvideosink), + "Unsupported format %08lx (" GST_FOURCC_FORMAT ")", + code, GST_FOURCC_ARGS(code)); return 0; } } @@ -177,17 +176,15 @@ gst_sdlvideosink_lock (GstSDLVideoSink *sdlvideosink) { if (SDL_LockSurface(sdlvideosink->screen) < 0) { - gst_element_gerror(GST_ELEMENT(sdlvideosink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("SDL: couldn\'t lock the SDL video window: %s", SDL_GetError())); + gst_element_error(GST_ELEMENT(sdlvideosink), + "SDL: couldn\'t lock the SDL video window: %s", SDL_GetError()); return FALSE; } } if (SDL_LockYUVOverlay(sdlvideosink->yuv_overlay) < 0) { - gst_element_gerror(GST_ELEMENT(sdlvideosink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError())); + gst_element_error(GST_ELEMENT(sdlvideosink), + "SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError()); return FALSE; } @@ -224,10 +221,9 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink, gboolean showlogo) GST_VIDEOSINK_HEIGHT (sdlvideosink), 0, SDL_SWSURFACE | SDL_RESIZABLE); if ( sdlvideosink->screen == NULL) { - gst_element_gerror(GST_ELEMENT(sdlvideosink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink), - GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError())); + gst_element_error(GST_ELEMENT(sdlvideosink), + "SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink), + GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError()); return FALSE; } @@ -238,11 +234,10 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink, gboolean showlogo) GST_VIDEOSINK_WIDTH (sdlvideosink), sdlvideosink->format, sdlvideosink->screen); if ( sdlvideosink->yuv_overlay == NULL ) { - gst_element_gerror(GST_ELEMENT(sdlvideosink), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("SDL: Couldn't create SDL_yuv_overlay (%dx%d \'" GST_FOURCC_FORMAT "\'): %s", + gst_element_error(GST_ELEMENT(sdlvideosink), + "SDL: Couldn't create SDL_yuv_overlay (%dx%d \'" GST_FOURCC_FORMAT "\'): %s", GST_VIDEOSINK_WIDTH (sdlvideosink), GST_VIDEOSINK_HEIGHT (sdlvideosink), - GST_FOURCC_ARGS(sdlvideosink->format), SDL_GetError())); + GST_FOURCC_ARGS(sdlvideosink->format), SDL_GetError()); return FALSE; } else @@ -488,9 +483,7 @@ gst_sdlvideosink_change_state (GstElement *element) } if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0 ) { - gst_element_gerror(element, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Couldn't initialize SDL: %s", SDL_GetError())); + gst_element_error(element, "Couldn't initialize SDL: %s", SDL_GetError()); return GST_STATE_FAILURE; } GST_FLAG_SET (sdlvideosink, GST_SDLVIDEOSINK_OPEN); diff --git a/ext/sndfile/gstsf.c b/ext/sndfile/gstsf.c index a24f933f..3d75087b 100644 --- a/ext/sndfile/gstsf.c +++ b/ext/sndfile/gstsf.c @@ -546,9 +546,7 @@ gst_sf_open_file (GstSF *this) this->time = 0; if (!this->filename) { - gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("sndfile: 'location' was not set")); + gst_element_error (GST_ELEMENT (this), "sndfile: 'location' was not set"); return FALSE; } @@ -574,9 +572,8 @@ gst_sf_open_file (GstSF *this) this->filename, info.samplerate, info.channels, info.format); if (!sf_format_check (&info)) { - gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Input parameters (rate:%d, channels:%d, format:0x%x) invalid", + gst_element_error (GST_ELEMENT (this), + g_strdup_printf ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid", info.samplerate, info.channels, info.format)); return FALSE; } @@ -585,10 +582,9 @@ gst_sf_open_file (GstSF *this) this->file = sf_open (this->filename, mode, &info); if (!this->file) { - gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf ("could not open file \"%s\": %s", - this->filename, sf_strerror (NULL))); + gst_element_error (GST_ELEMENT (this), + g_strdup_printf ("could not open file \"%s\": %s", + this->filename, sf_strerror (NULL))); return FALSE; } @@ -625,10 +621,9 @@ gst_sf_close_file (GstSF *this) INFO_OBJ (this, "Closing file %s", this->filename); if ((err = sf_close (this->file))) - gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(g_strdup_printf ("sndfile: could not close file \"%s\": %s", - this->filename, sf_error_number (err)))); + gst_element_error (GST_ELEMENT (this), + g_strdup_printf ("sndfile: could not close file \"%s\": %s", + this->filename, sf_error_number (err))); else GST_FLAG_UNSET (this, GST_SF_OPEN); @@ -647,9 +642,7 @@ gst_sf_loop (GstElement *element) this = (GstSF*)element; if (this->channels == NULL) { - gst_element_gerror(element, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("You must connect at least one pad to sndfile elements.")); + gst_element_error (element, "You must connect at least one pad to sndfile elements."); return; } @@ -697,10 +690,9 @@ gst_sf_loop (GstElement *element) gst_caps_set (caps, "rate", GST_PROPS_INT (this->rate), NULL); gst_caps_set (caps, "buffer-frames", GST_PROPS_INT (this->buffer_frames), NULL); if (!gst_pad_try_set_caps (GST_SF_CHANNEL (l)->pad, caps)) { - gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Opened file with sample rate %d, but could not set caps", - this->rate)); + gst_element_error (GST_ELEMENT (this), + g_strdup_printf ("Opened file with sample rate %d, but could not set caps", + this->rate)); gst_sf_close_file (this); return; } @@ -755,9 +747,7 @@ gst_sf_loop (GstElement *element) which then would set this->buffer_frames to a new value */ buffer_frames = this->buffer_frames; if (buffer_frames == 0) { - gst_element_gerror(element, "Caps were never set, GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(bailing...")); + gst_element_error (element, "Caps were never set, bailing..."); return; } buf = this->buffer; @@ -782,9 +772,7 @@ gst_sf_loop (GstElement *element) if (num_to_write) { written = sf_writef_float (this->file, buf, num_to_write); if (written != num_to_write) - gst_element_gerror(element, "Error writing file: %s", GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf(sf_strerror (this->file))); + gst_element_error (element, "Error writing file: %s", sf_strerror (this->file)); } this->time += num_to_write * (GST_SECOND / this->rate); diff --git a/ext/tarkin/gsttarkindec.c b/ext/tarkin/gsttarkindec.c index d8efb616..f77e5c8f 100644 --- a/ext/tarkin/gsttarkindec.c +++ b/ext/tarkin/gsttarkindec.c @@ -156,9 +156,7 @@ gst_tarkindec_chain (GstPad *pad, GstBuffer *buf) tarkindec = GST_TARKINDEC (gst_pad_get_parent (pad)); if (!tarkindec->setup) { - gst_element_gerror(GST_ELEMENT (tarkindec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("decoder not initialized (input is not audio?)")); + gst_element_error (GST_ELEMENT (tarkindec), "decoder not initialized (input is not audio?)"); if (GST_IS_BUFFER (buf)) gst_buffer_unref (buf); else @@ -227,9 +225,7 @@ gst_tarkindec_chain (GstPad *pad, GstBuffer *buf) "framerate", GST_PROPS_FLOAT (0.) /* FIXME!!! */ )) <= 0) { - gst_element_gerror(GST_ELEMENT (tarkindec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("could not output format")); + gst_element_error (GST_ELEMENT (tarkindec), "could not output format"); gst_buffer_unref (buf); return; } diff --git a/ext/tarkin/gsttarkinenc.c b/ext/tarkin/gsttarkinenc.c index 78cc6f27..ff3d295e 100644 --- a/ext/tarkin/gsttarkinenc.c +++ b/ext/tarkin/gsttarkinenc.c @@ -266,9 +266,7 @@ gst_tarkinenc_chain (GstPad *pad, GstBuffer *buf) tarkinenc = GST_TARKINENC (gst_pad_get_parent (pad)); if (!tarkinenc->setup) { - gst_element_gerror(GST_ELEMENT (tarkinenc), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("encoder not initialized (input is not audio?)")); + gst_element_error (GST_ELEMENT (tarkinenc), "encoder not initialized (input is not audio?)"); if (GST_IS_BUFFER (buf)) gst_buffer_unref (buf); else diff --git a/ext/xvid/gstxviddec.c b/ext/xvid/gstxviddec.c index 5bdcea34..50e72a3c 100644 --- a/ext/xvid/gstxviddec.c +++ b/ext/xvid/gstxviddec.c @@ -192,11 +192,10 @@ gst_xviddec_setup (GstXvidDec *xviddec) if ((ret = xvid_decore(NULL, XVID_DEC_CREATE, &xdec, NULL)) != XVID_ERR_OK) { - gst_element_gerror(GST_ELEMENT(xviddec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Setting parameters %dx%d@%d failed: %s (%d)", + gst_element_error(GST_ELEMENT(xviddec), + "Setting parameters %dx%d@%d failed: %s (%d)", xviddec->width, xviddec->height, xviddec->csp, - gst_xvid_error(ret), ret)); + gst_xvid_error(ret), ret); return FALSE; } @@ -232,9 +231,8 @@ gst_xviddec_chain (GstPad *pad, if (!xviddec->handle) { if (!gst_xviddec_negotiate(xviddec)) { - gst_element_gerror(GST_ELEMENT(xviddec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("No format set - aborting")); + gst_element_error(GST_ELEMENT(xviddec), + "No format set - aborting"); gst_buffer_unref(buf); return; } @@ -257,10 +255,9 @@ gst_xviddec_chain (GstPad *pad, if ((ret = xvid_decore(xviddec->handle, XVID_DEC_DECODE, &xframe, NULL))) { - gst_element_gerror(GST_ELEMENT(xviddec), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error decoding xvid frame: %s (%d)\n", - gst_xvid_error(ret), ret)); + gst_element_error(GST_ELEMENT(xviddec), + "Error decoding xvid frame: %s (%d)\n", + gst_xvid_error(ret), ret); gst_buffer_unref(buf); return; } diff --git a/ext/xvid/gstxvidenc.c b/ext/xvid/gstxvidenc.c index 7561848f..b217b652 100644 --- a/ext/xvid/gstxvidenc.c +++ b/ext/xvid/gstxvidenc.c @@ -237,10 +237,9 @@ gst_xvidenc_setup (GstXvidEnc *xvidenc) if ((ret = xvid_encore(NULL, XVID_ENC_CREATE, &xenc, NULL)) != XVID_ERR_OK) { - gst_element_gerror(GST_ELEMENT(xvidenc), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error setting up xvid encoder: %s (%d)", - gst_xvid_error(ret), ret)); + gst_element_error(GST_ELEMENT(xvidenc), + "Error setting up xvid encoder: %s (%d)", + gst_xvid_error(ret), ret); return FALSE; } @@ -286,10 +285,9 @@ gst_xvidenc_chain (GstPad *pad, if ((ret = xvid_encore(xvidenc->handle, XVID_ENC_ENCODE, &xframe, NULL)) != XVID_ERR_OK) { - gst_element_gerror(GST_ELEMENT(xvidenc), GST_ERROR_UNKNOWN, - g_strdup ("unconverted error, file a bug"), - g_strdup_printf("Error encoding xvid frame: %s (%d)", - gst_xvid_error(ret), ret)); + gst_element_error(GST_ELEMENT(xvidenc), + "Error encoding xvid frame: %s (%d)", + gst_xvid_error(ret), ret); gst_buffer_unref(buf); return; } -- cgit v1.2.1