[FFmpeg-devel] [PATCH/RFC]E-AC-3 via HDMI

Carl Eugen Hoyos cehoyos
Sun Jun 20 14:33:23 CEST 2010


Hi!

Attached patch allows to play E-AC-3 samples with up to 384kb (the French 
France2 HD samples from issue 1256 and 2.0 streams from an EVO file) via HDMI 
and a suitable receiver:
aplay -D hw:1,3 -t raw -r 192000 -f S16_LE -c 2
Higher bitrate streams play choppy (and too slow/long) because several packets 
have to be combined into one data-burst. (I have the exact same problem with 
TrueHD.).

I did not check if bitstream_mode is calculated correctly, the specification 
asks for the same "bsmod" parameter as in AC-3 via SPDIF.

I did try to send the low-bitrate streams via SPDIF (after dividing 24576 by 
four and using -r 48000, the receiver shows "DD+", but does not decode 
anything).

Please comment, Carl Eugen
-------------- next part --------------
Index: libavformat/spdif.c
===================================================================
--- libavformat/spdif.c	(revision 23655)
+++ libavformat/spdif.c	(working copy)
@@ -103,6 +103,16 @@
         dst[i + 0] = bswap_16(src[i + 0]);
 }
 
+static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt)
+{
+    IEC958Context *ctx = s->priv_data;
+    int bitstream_mode = pkt->data[6] & 0x7;
+
+    ctx->data_type  = IEC958_EAC3 | (bitstream_mode << 8);
+    ctx->pkt_offset = 24576;
+    return 0;
+}
+
 static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
 {
     IEC958Context *ctx = s->priv_data;
@@ -230,6 +240,9 @@
     case CODEC_ID_AC3:
         ctx->header_info = spdif_header_ac3;
         break;
+    case CODEC_ID_EAC3:
+	ctx->header_info = spdif_header_eac3;
+	break;
     case CODEC_ID_MP1:
     case CODEC_ID_MP2:
     case CODEC_ID_MP3:



More information about the ffmpeg-devel mailing list