Re: Fix problem with EAC3 audio

Jose Alberto Reguero <[email protected]> Thu, 09 Aug 2012 01:13:42 +0200
Newsgroups gmane.comp.video.xine.devel
Message-ID <[email protected]>
On Sábado, 21 de julio de 2012 01:57:49 Jose Alberto Reguero escribió:
> On Miércoles, 18 de julio de 2012 15:07:46 Petri Hintukainen escribió:
> > On ma, 2012-06-18 at 17:24 +0200, Jose Alberto Reguero wrote:
> > > This patch fix audio problems whith ffmpeg EAC3 audio.
> > 
> > Maybe this could be fixed by enabling parser for EAC3 ?
> > Parser is used to fix similar problems with MPEG and AAC audio
> > 
> > (from ff_audio_decoder.c):
> >   /* Use parser for AAC LATM and MPEG.
> >   
> >    * Fixes:
> >    *  - DVB streams where multiple AAC LATM frames are packed to single
> >    PES
> >    *  - DVB streams where MPEG audio frames do not follow PES packet
> > 
> > boundaries */
> > 
> > 
> > - Petri
> 
> I try with parser, but the problem persist. I think that ffmpeg eac3 only
> works with completes frames.
> 
> Jose Alberto
> 

It works with the patch attached.

Jose Alberto

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
xine-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-devel
ff_audio_decoder_2.diff (text/x-patch, 1018 B)
diff -r 5116be93922a src/combined/ffmpeg/ff_audio_decoder.c
--- a/src/combined/ffmpeg/ff_audio_decoder.c	Fri Jun 08 11:42:04 2012 +0300
+++ b/src/combined/ffmpeg/ff_audio_decoder.c	Wed Aug 08 20:15:09 2012 +0200
@@ -169,6 +169,7 @@
    */
 #if AVPARSE > 1
   if (codec_type == BUF_AUDIO_AAC_LATM ||
+      codec_type == BUF_AUDIO_EAC3 ||
       codec_type == BUF_AUDIO_MPEG) {
 
     xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
@@ -315,6 +316,10 @@
                           this->context->extradata_size);
         break;
       }
+    case BUF_AUDIO_EAC3:
+      {
+        break;
+      }
     default:
       xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
               "ffmpeg_audio_dec: unknown header with buf type 0x%X\n", codec_type);
@@ -448,7 +453,7 @@
       /* pad input data */
       memset(&this->buf[this->size], 0, FF_INPUT_BUFFER_PADDING_SIZE);
 
-      while (this->size>0) {
+      while (this->size>=0) {
         decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
 
 	bytes_consumed =