From: Good Guy Date: Mon, 24 Aug 2015 15:19:47 +0000 (-0600) Subject: sync to last commit on google_code X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=955d712ff475171e99d7910ead049a9342ca8b21;p=goodguy%2Fhistory.git sync to last commit on google_code --- diff --git a/cinelerra-5.0/cinelerra/ffmpeg.C b/cinelerra-5.0/cinelerra/ffmpeg.C index decb3d00..89175ff7 100644 --- a/cinelerra-5.0/cinelerra/ffmpeg.C +++ b/cinelerra-5.0/cinelerra/ffmpeg.C @@ -941,8 +941,8 @@ FFMPEG::~FFMPEG() delete flow_lock; delete mux_lock; av_dict_free(&opts); - delete opt_video_filter; - delete opt_audio_filter; + delete [] opt_video_filter; + delete [] opt_audio_filter; } int FFMPEG::check_sample_rate(AVCodec *codec, int sample_rate) @@ -2070,6 +2070,11 @@ int FFVideoStream::create_filter(const char *filter_spec, AVCodecContext *src_ctx, AVCodecContext *sink_ctx) { avfilter_register_all(); + AVFilter *filter = avfilter_get_by_name(filter_spec); + if( !filter || filter->inputs->type != AVMEDIA_TYPE_VIDEO ) { + ff_err(AVERROR(EINVAL), "FFVideoStream::create_filter: %s\n", filter_spec); + return -1; + } filter_graph = avfilter_graph_alloc(); AVFilter *buffersrc = avfilter_get_by_name("buffer"); AVFilter *buffersink = avfilter_get_by_name("buffersink"); @@ -2101,6 +2106,11 @@ int FFAudioStream::create_filter(const char *filter_spec, AVCodecContext *src_ctx, AVCodecContext *sink_ctx) { avfilter_register_all(); + AVFilter *filter = avfilter_get_by_name(filter_spec); + if( !filter || filter->inputs->type != AVMEDIA_TYPE_AUDIO ) { + ff_err(AVERROR(EINVAL), "FFAudioStream::create_filter: %s\n", filter_spec); + return -1; + } filter_graph = avfilter_graph_alloc(); AVFilter *buffersrc = avfilter_get_by_name("abuffer"); AVFilter *buffersink = avfilter_get_by_name("abuffersink"); diff --git a/cinelerra-5.0/guicast/bcwindowbase.C b/cinelerra-5.0/guicast/bcwindowbase.C index 841d6c54..32547118 100644 --- a/cinelerra-5.0/guicast/bcwindowbase.C +++ b/cinelerra-5.0/guicast/bcwindowbase.C @@ -408,7 +408,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, else this->display_name[0] = 0; - strcpy(this->title, _(title)); + put_title(_(title)); if(bg_pixmap) shared_bg_pixmap = 1; subwindows = new BC_SubWindowList; @@ -3994,15 +3994,30 @@ void BC_WindowBase::set_background(VFrame *bitmap) draw_background(0, 0, w, h); } +void BC_WindowBase::put_title(const char *text) +{ + if( BC_Resources::locale_utf8 ) { + char *bp=this->title, *ep = bp+sizeof(this->title)-1; + for( const char *cp=text; *cp!=0 && bptitle, text); +} + void BC_WindowBase::set_title(const char *text) { - XTextProperty titleprop; - char *txlist[2]; + put_title(_(text)); - strcpy(this->title, _(text)); + char *txlist[2]; txlist[0] = this->title; txlist[1] = 0; + XTextProperty titleprop; XmbTextListToTextProperty(top_level->display, txlist, 1, XStdICCTextStyle, &titleprop); XSetWMName(top_level->display, top_level->win, &titleprop); diff --git a/cinelerra-5.0/guicast/bcwindowbase.h b/cinelerra-5.0/guicast/bcwindowbase.h index b1261e23..f2314753 100644 --- a/cinelerra-5.0/guicast/bcwindowbase.h +++ b/cinelerra-5.0/guicast/bcwindowbase.h @@ -443,6 +443,7 @@ public: void set_inverse(); void set_background(VFrame *bitmap); // Change the window title. + void put_title(const char *text); void set_title(const char *text); const char *get_title(); void set_utf8title(const char *text); diff --git a/cinelerra-5.0/plugins/titler/title.C b/cinelerra-5.0/plugins/titler/title.C index 66755018..6155d20b 100644 --- a/cinelerra-5.0/plugins/titler/title.C +++ b/cinelerra-5.0/plugins/titler/title.C @@ -86,7 +86,7 @@ TitleConfig::TitleConfig() fade_out = 0.0; x = 0.0; y = 0.0; - dropshadow = 10; + dropshadow = 2; sprintf(font, "fixed"); sprintf(encoding, DEFAULT_ENCODING); timecode_format = DEFAULT_TIMECODEFORMAT; @@ -204,8 +204,8 @@ void TitleConfig::interpolate(TitleConfig &prev, // this->y = prev.y; timecode = prev.timecode; timecode_format = prev.timecode_format; -// this->dropshadow = (int)(prev.dropshadow * prev_scale + next.dropshadow * next_scale); - this->dropshadow = prev.dropshadow; + this->dropshadow = prev.dropshadow * prev_scale + next.dropshadow * next_scale; +// this->dropshadow = prev.dropshadow; } void TitleConfig::limits() @@ -539,10 +539,14 @@ void TitleUnit::draw_glyph(VFrame *output, VFrame *data, TitleGlyph *glyph, int unsigned char **out_rows = output->get_rows(); int baseline = plugin->get_char_height(); - if(engine->do_dropshadow) { + if( engine->do_dropshadow ) { x += plugin->config.dropshadow; y += plugin->config.dropshadow; } + else if( plugin->config.dropshadow < 0 ) { + x -= plugin->config.dropshadow; + y -= plugin->config.dropshadow; + } int x_in = 0, y_in = 0; int x_out = x + glyph->left; @@ -1734,8 +1738,8 @@ int TitleMain::draw_mask() extent.x1 -= config.outline_size*2; extent.y1 -= config.outline_size*2; - extent.x2 += config.dropshadow + config.outline_size*2; - extent.y2 += config.dropshadow + config.outline_size*2; + extent.x2 += abs(config.dropshadow) + config.outline_size*2; + extent.y2 += abs(config.dropshadow) + config.outline_size*2; // Determine mask geometry mask_w = extent.x2 - extent.x1; @@ -1759,7 +1763,7 @@ int TitleMain::draw_mask() text_mask = new VFrame; text_mask->set_use_shm(0); text_mask->reallocate(0, -1, 0, 0, 0, mask_w, mask_h, color_model, -1); - int drop = !config.dropshadow ? 0 : config.dropshadow; + float drop = abs(config.dropshadow); int drop_w = mask_w + drop; int drop_h = mask_h + drop; text_mask_stroke = new VFrame; diff --git a/cinelerra-5.0/plugins/titler/titlewindow.C b/cinelerra-5.0/plugins/titler/titlewindow.C index b481f7b0..a2ad2cf7 100644 --- a/cinelerra-5.0/plugins/titler/titlewindow.C +++ b/cinelerra-5.0/plugins/titler/titlewindow.C @@ -852,7 +852,7 @@ int TitleText::handle_event() TitleDropShadow::TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, (int64_t)client->config.dropshadow, - (int64_t)0, + (int64_t)-1000, (int64_t)1000, x, y,