From patchwork Wed Mar 24 21:58:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jose Alberto Reguero X-Patchwork-Id: 12797 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1NuYau-0000DO-BT for vdr@linuxtv.org; Wed, 24 Mar 2010 22:58:33 +0100 X-tubIT-Incoming-IP: 213.4.138.4 Received: from impaqm4.telefonica.net ([213.4.138.4]) by mail.tu-berlin.de (exim-4.69/mailfrontend-c) with esmtp for id 1NuYat-0003uw-Lo; Wed, 24 Mar 2010 22:58:32 +0100 Received: from IMPmailhost5.adm.correo ([10.20.102.126]) by IMPaqm4.telefonica.net with bizsmtp id x96x1d00C2jdgqJ3Q9yWhx; Wed, 24 Mar 2010 22:58:30 +0100 Received: from jar.dominio ([80.25.230.35]) by IMPmailhost5.adm.correo with BIZ IMP id x9yW1d0010mULeg1l9yWra; Wed, 24 Mar 2010 22:58:30 +0100 X-TE-authinfo: authemail="jareguero$telefonica.net" |auth_email="jareguero@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: Jose Alberto Reguero To: VDR Mailing List Date: Wed, 24 Mar 2010 22:58:29 +0100 User-Agent: KMail/1.13.1 (Linux/2.6.32.9-70.fc12.x86_64; KDE/4.4.1; x86_64; ; ) References: <4BAA4EBA.4030406@free.fr> <201003241941.43539.jareguero@telefonica.net> <4BAA6DF0.7070002@free.fr> In-Reply-To: <4BAA6DF0.7070002@free.fr> MIME-Version: 1.0 Message-Id: <201003242258.29438.jareguero@telefonica.net> X-tubIT-Score: 0.0 () X-PMX-Version: 5.5.4.371499, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.3.24.214819 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MIME_TEXT_ONLY_MP_MIXED 0.05, WEBMAIL_RCVD 0, WEBMAIL_SOURCE 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-LSpam-Score: -3.3 (---) X-LSpam-Report: No, score=-3.3 required=5.0 tests=AWL=0.321, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 autolearn=ham Subject: Re: [vdr] vdr xine-lib eac3 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: Wed, 24 Mar 2010 21:58:33 -0000 Status: O X-Status: X-Keywords: X-UID: 22653 I attached a second version of the first patch. I make the same changes that in the second patch, but maintaining the logic of the first patch. Also I commented the line: +// this->context->request_channels = 2; because your example has 5 channels. If you have trouble with that you can comment the line again. Which typo error has the second patch? Jose Alberto El Miércoles, 24 de Marzo de 2010, zaverel escribió: > i 've patched pat.c and now remux.c > and with use xine-lib-1.2 with your second patch (who has typo error) > and that doesn't work. > > corrected remux.c > > line 533 > case SI::AC3DescriptorTag: > +case SI::EnhancedAC3DescriptorTag: > > > and in line 191: > > -Target[i++] = SI::AC3DescriptorTag; > +Target[i++] = SI::EnhancedAC3DescriptorTag; > > > > with your previously patch and just pat.c patched with > line 402 > > case SI::AC3DescriptorTag: > +case SI:EnhancedAC3DescriptorTag: > > that worked but not stable. > > Is your sample eac3 has |"Spectral extension" ? > because in france dvb-t with eac3 has it > and need a ffmpeg patched for that. > And i test with that sound. > > Le 24/03/2010 19:41, Jose Alberto Reguero a écrit : > > It works here with a old sample of tdt with eac3. Have you patch also > > remux.c? You need to change in line 533: > > > > case SI::AC3DescriptorTag: > > +case SI:EnhancedAC3DescriptorTag: > > > > and in line 191: > > > > -Target[i++] = SI::AC3DescriptorTag; > > +Target[i++] = SI::EnhancedAC3DescriptorTag > > > > Jose Alberto > > > > El Miércoles, 24 de Marzo de 2010, dplu escribió: > >> Hi > >> > >> I have made previous test with the version release by Petri Hintukainen > >> > >> And I notice this part is not working like it should > >> > >> - if((m->descriptor_tag == STREAM_AUDIO_AC3) || /* ac3 - raw */ > >> + if(m->descriptor_tag == HDMV_AUDIO_84_EAC3) { > >> + m->content = p; > >> + m->size = packet_len; > >> + m->type |= BUF_AUDIO_EAC3; > >> + return 1; > >> + > >> + } else if((m->descriptor_tag == STREAM_AUDIO_AC3) || /* ac3 - > >> raw */ > >> > >> unfortunaletly, in AC3 or E-AC3 , the descriptor tag is > >> STREAM_AUDIO_AC3, so the program never run the first if (installed a > >> debug printf here) > >> > >> It seems that your first approach (at least what I understood) by > >> forcing the decoding of all AC-3 stream by ffmepg instead of internal > >> lib was nice but generate violent segfault on libavcodec > >> > >> Hope this help you > >> > >> Best regards > >> > >> PS : Sorry to pollute the vdr mailing list (not subscribed to ffmpeg or > >> xine-lib....) > >> > >> Le Wednesday 24 March 2010 18:41:14 zaverel, vous avez écrit : > >>> hello > >>> > >>> your second patch doesn't work : no sound on eac3 channel > >>> > >>> if you want there is a sample of vdr hd-eac3 recording here: > >>> > >>> http://dl.free.fr/ew4rJddM8 > >>> > >>> 103mo > >>> > >>> else , i don't know what mailing-list is the more indicate for debuging > >>> > >>> the vdr or xine-dev mailing-list ? > >>> > >>> _______________________________________________ > >>> vdr mailing list > >>> vdr@linuxtv.org > >>> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr > >> > >> _______________________________________________ > >> vdr mailing list > >> vdr@linuxtv.org > >> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr > > > > _______________________________________________ > > vdr mailing list > > vdr@linuxtv.org > > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr diff -r a6a25ea3e2c8 src/combined/ffmpeg/ff_audio_decoder.c --- a/src/combined/ffmpeg/ff_audio_decoder.c Sun Mar 14 15:12:25 2010 +0000 +++ b/src/combined/ffmpeg/ff_audio_decoder.c Wed Mar 24 22:44:29 2010 +0100 @@ -257,10 +257,44 @@ if( !this->decoder_ok ) { if ( ! this->context || ! this->codec ) { - xprintf (this->stream->xine, XINE_VERBOSITY_LOG, - _("ffmpeg_audio_dec: trying to open null codec\n")); - _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); - return; + if ( (buf->type & 0xFFFF0000) == BUF_AUDIO_A52 ) { + pthread_mutex_lock (&ffmpeg_lock); + this->codec = avcodec_find_decoder(CODEC_ID_AC3); + pthread_mutex_unlock (&ffmpeg_lock); + _x_meta_info_set(this->stream, XINE_META_INFO_AUDIOCODEC, + "AC3 coque (ffmpeg)"); + + if (!this->codec) { + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, + _("ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"), + buf->type); + _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); + return; + } + + this->context = avcodec_alloc_context(); + + this->audio_bits = 16; +// this->audio_sample_rate = 48000; +// this->audio_channels = 6; +// this->context->request_channels = 2; + + this->context->bits_per_sample = this->audio_bits; + this->context->sample_rate = this->audio_sample_rate; + this->context->channels = this->audio_channels; + this->context->codec_id = this->codec->id; + this->context->codec_type = this->codec->type; + this->context->codec_tag = _x_stream_info_get(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC); + + this->size = 0; + + this->decode_buffer = calloc(1, AVCODEC_MAX_AUDIO_FRAME_SIZE); + } else { + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, + _("ffmpeg_audio_dec: trying to open null codec\n")); + _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); + return; + } } pthread_mutex_lock (&ffmpeg_lock); @@ -284,11 +318,14 @@ if (!this->output_open) { if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) { - avcodec_decode_audio2 (this->context, + decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; + bytes_consumed = avcodec_decode_audio2 (this->context, (int16_t *)this->decode_buffer, &decode_buffer_size, &this->buf[0], this->size); + this->size -= bytes_consumed; + memmove(this->buf, &this->buf[bytes_consumed], this->size); this->audio_bits = this->context->bits_per_sample; this->audio_sample_rate = this->context->sample_rate; this->audio_channels = this->context->channels; diff -r a6a25ea3e2c8 src/combined/ffmpeg/xine_audio.list --- a/src/combined/ffmpeg/xine_audio.list Sun Mar 14 15:12:25 2010 +0000 +++ b/src/combined/ffmpeg/xine_audio.list Wed Mar 24 22:44:29 2010 +0100 @@ -40,10 +40,10 @@ WAVPACK WAVPACK WavPack AMR_NB AMR_NB AMR narrow band AMR_WB AMR_WB AMR wide band +A52 AC3 AC3 coque # disabled codecs (ref. configure.ac) ! AAC -! AC3 ! ADPCM_ADX ! ADPCM_G726 ! DSICINAUDIO diff -r a6a25ea3e2c8 src/demuxers/demux_ts.c --- a/src/demuxers/demux_ts.c Sun Mar 14 15:12:25 2010 +0000 +++ b/src/demuxers/demux_ts.c Wed Mar 24 22:44:29 2010 +0100 @@ -1415,9 +1415,9 @@ break; case ISO_13818_PES_PRIVATE: for (i = 5; i < coded_length; i += stream[i+1] + 2) { - if ((stream[i] == 0x6a) && (this->audio_tracks_count < MAX_AUDIO_TRACKS)) { - int i, found = 0; - for(i = 0; i < this->audio_tracks_count; i++) { + if (((stream[i] == 0x6a) || (stream[i] == 0x7a)) && (this->audio_tracks_count < MAX_AUDIO_TRACKS)) { + int j, found = 0; + for(j = 0; j < this->audio_tracks_count; j++) { if(this->audio_tracks[i].pid == pid) { found = 1; break; @@ -1427,8 +1427,12 @@ #ifdef TS_PMT_LOG printf ("demux_ts: PMT AC3 audio pid 0x%.4x type %2.2x\n", pid, stream[0]); #endif - demux_ts_pes_new(this, this->media_num, pid, - this->audio_fifo, STREAM_AUDIO_AC3); + if (stream[i] == 0x6a) + demux_ts_pes_new(this, this->media_num, pid, + this->audio_fifo, STREAM_AUDIO_AC3); + else + demux_ts_pes_new(this, this->media_num, pid, + this->audio_fifo, HDMV_AUDIO_84_EAC3); this->audio_tracks[this->audio_tracks_count].pid = pid; this->audio_tracks[this->audio_tracks_count].media_index = this->media_num;