From patchwork Sat Feb 13 13:16:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Halim Sahin X-Patchwork-Id: 12787 Received: from [130.149.205.37] (helo=mail.tu-berlin.de) by www.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1NgHsG-0004B0-3k for vdr@linuxtv.org; Sat, 13 Feb 2010 14:17:34 +0100 X-tubIT-Incoming-IP: 212.112.241.2 Received: from as-10.de ([212.112.241.2] helo=mail.as-10.de) by mail.tu-berlin.de (exim-4.69/mailfrontend-d) with esmtps [TLSv1:AES256-SHA:256] for id 1NgHsF-0002Pu-Aw; Sat, 13 Feb 2010 14:17:27 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.as-10.de (Postfix) with ESMTP id 89F6833A6FE for ; Sat, 13 Feb 2010 14:17:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.as-10.de Received: from mail.as-10.de ([127.0.0.1]) by localhost (as-10.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XhW6A+G3o3f4 for ; Sat, 13 Feb 2010 14:17:26 +0100 (CET) Received: from gentoo.local (pD9E3DDAE.dip.t-dialin.net [217.227.221.174]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: web11p28) by mail.as-10.de (Postfix) with ESMTPSA id 4965B33A673 for ; Sat, 13 Feb 2010 14:17:26 +0100 (CET) Received: by gentoo.local (Postfix, from userid 1000) id 4702FF88CB; Sat, 13 Feb 2010 14:16:50 +0100 (CET) Date: Sat, 13 Feb 2010 14:16:50 +0100 From: Halim Sahin To: vdr@linuxtv.org Message-ID: <20100213131650.GA24809@gentoo.local> References: <20100212163630.GA6310@gentoo.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100212163630.GA6310@gentoo.local> User-Agent: Mutt/1.5.20 (2009-06-14) X-tubIT-Score: 0.0 () X-PMX-Version: 5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.2.13.130331 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_5000_5999 0, BODY_SIZE_7000_LESS 0, TO_NO_NAME 0, __CD 0, __CP_MEDIA_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_BLIZZARD_RCVD 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_24 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-LSpam-Score: -2.8 (--) X-LSpam-Report: No, score=-2.8 required=5.0 tests=AWL=-0.288, BAYES_00=-2.599, RDNS_NONE=0.1 autolearn=no Subject: [vdr] found the problem (in xineliboutput) Re: vdr-sxfe segfaults when listening to radiochannles (vdr-1.7.9/1.7.12) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 13:17:34 -0000 Status: O X-Status: X-Keywords: X-UID: 22341 Hi folks, The segfault was introduced in xineliboutput's cvs between 28.01.2010 and 29.01.2010 The following change produces it: BR. --- xine_input_vdr.c.old 2010-02-13 14:13:48.670894516 +0100 +++ xine_input_vdr.c 2010-02-13 14:13:56.246141788 +0100 @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.289 2010/01/18 20:39:36 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.291 2010/01/28 11:50:07 phintuka Exp $ * */ @@ -62,6 +62,7 @@ #include "xine/adjustable_scr.h" #include "xine/osd_manager.h" +#include "xine/xvdr_metronom.h" #include "xine_input_vdr.h" #include "xine_input_vdr_net.h" @@ -127,7 +128,7 @@ # include /* syscall(__NR_gettid) */ #endif -static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.289 2010/01/18 20:39:36 phintuka Exp $"; +static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.291 2010/01/28 11:50:07 phintuka Exp $"; static const char log_module_input_vdr[] = "[input_vdr] "; #define LOG_MODULENAME log_module_input_vdr #define SysLogLevel iSysLogLevel @@ -313,6 +314,9 @@ uint8_t hd_stream : 1; /* true if current stream is HD */ uint8_t sw_volume_control : 1; + /* metronom */ + xvdr_metronom_t *metronom; + /* SCR */ adjustable_scr_t *scr; int speed_before_pause; @@ -1813,7 +1817,7 @@ this->class->xine->config->update_num(this->class->xine->config, "video.output.xv_deinterlace_method", method >= 0 ? method : 0); - xine_set_param(this->stream, XINE_PARAM_VO_DEINTERLACE, method ? 1 : 0); + xine_set_param(this->stream, XINE_PARAM_VO_DEINTERLACE, !!method); return 0; } @@ -1935,7 +1939,7 @@ return 0; } -static int set_playback_speed(vdr_input_plugin_t *this, int speed) +static int set_trick_speed(vdr_input_plugin_t *this, int speed, int backwards) { /* speed: <0 - show each abs(n)'th frame (drop other frames) @@ -1955,6 +1959,8 @@ return -2; } + this->metronom->set_trickspeed(this->metronom, backwards ? speed : 0); + if(speed > 1 || speed < -1) { reset_scr_tuning(this, -1); this->is_trickspeed = 1; @@ -1981,6 +1987,11 @@ return 0; } +static int reset_trick_speed(vdr_input_plugin_t *this) +{ + return set_trick_speed(this, 1, 0); +} + static void send_meta_info(vdr_input_plugin_t *this) { if(this->slave_stream) { @@ -2263,10 +2274,10 @@ xine_usec_sleep(50*1000); /* keep our own demux happy while playing another stream */ - set_playback_speed(this, 1); + reset_trick_speed(this); this->live_mode = 1; set_live_mode(this, 0); - set_playback_speed(this, 1); + reset_trick_speed(this); reset_scr_tuning(this, this->speed_before_pause = XINE_FINE_SPEED_NORMAL); this->slave_stream->metronom->set_option(this->slave_stream->metronom, METRONOM_PREBUFFER, 90000); @@ -2902,7 +2913,7 @@ } else if(!strncasecmp(cmd, "TRICKSPEED ", 11)) { err = (1 == sscanf(cmd+11, "%d", &tmp32)) ? - set_playback_speed(this, tmp32) : + set_trick_speed(this, tmp32, !!strstr(cmd+13, "Back")) : CONTROL_PARAM_ERROR; } else if(!strncasecmp(cmd, "STILL ", 6)) { @@ -2938,13 +2949,13 @@ } else if(!strncasecmp(cmd, "MASTER ", 7)) { if(1 == sscanf(cmd+7, "%d", &tmp32)) - this->fixed_scr = tmp32 ? 1 : 0; + this->fixed_scr = !!tmp32; else err = CONTROL_PARAM_ERROR; } else if(!strncasecmp(cmd, "VOLUME ", 7)) { if(1 == sscanf(cmd+7, "%d", &tmp32)) { - int sw = strstr(cmd, "SW") ? 1 : 0; + int sw = !!strstr(cmd, "SW"); if(!sw) { xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, tmp32); xine_set_param(stream, XINE_PARAM_AUDIO_MUTE, tmp32<=0 ? 1 : 0); @@ -2994,7 +3005,7 @@ } else if(!strncasecmp(cmd, "AUDIOSTREAM ", 12)) { if(!this->slave_stream) { #if 0 - int ac3 = strncmp(cmd+12, "AC3", 3) ? 0 : 1; + int ac3 = !strncmp(cmd+12, "AC3", 3); if(1 == sscanf(cmd+12 + 4*ac3, "%d", &tmp32)) { pthread_mutex_lock(&this->lock); this->audio_stream_id = tmp32; @@ -3016,7 +3027,7 @@ int old_ch = _x_get_spu_channel(stream); int max_ch = xine_get_stream_info(stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL); int ch = old_ch; - int ch_auto = strstr(cmd+10, "auto") ? 1 : 0; + int ch_auto = !!strstr(cmd+10, "auto"); int is_dvd = 0; if (this->slave_stream && this->slave_stream->input_plugin) { @@ -4512,7 +4523,7 @@ flush_all_fifos (this, 0); - set_playback_speed(this, 1); + reset_trick_speed(this); this->live_mode = 0; reset_scr_tuning(this, XINE_FINE_SPEED_NORMAL); this->stream->emergency_brake = 1; @@ -4697,7 +4708,7 @@ this->control_running = 0; - local = this->funcs.push_input_write ? 1 : 0; + local = !!this->funcs.push_input_write; memset(&this->funcs, 0, sizeof(this->funcs)); /* shutdown sockets */ @@ -4798,6 +4809,10 @@ if (this->scr) this->scr->dispose(this->scr); + /* metronom */ + if (this->metronom) + this->metronom->dispose(this->metronom); + free (this->mrl); if(this->udp_data) @@ -4863,6 +4878,9 @@ this->scr_tuning = SCR_TUNING_OFF; this->curpos = 0; + /* replace stream metronom */ + this->metronom = xvdr_metronom_init(this->stream); + /* buffer */ this->block_buffer = fifo_buffer_new(this->stream, 4, 0x10000+64); /* dummy buf to be used before first read and for big PES frames */ ny ideas howto solve this?