avformat/mpegtsenc: Allow DTS audio copy to TS streams
authorgoodthanks <tamlyn@internode.on.net>
Fri, 25 Apr 2014 04:23:41 +0000 (14:23 +1000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Apr 2014 12:24:29 +0000 (14:24 +0200)
This doesn't allow encoding of DTS or TrueHD. It just sets the correct
stream ID in the TS output file when a DTS or TrueHD audio stream is copied.

Fixes ticket #1398

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpegts.h
libavformat/mpegtsenc.c

index d7a9f03..7dfe844 100644 (file)
@@ -58,7 +58,8 @@
 #define STREAM_TYPE_VIDEO_DIRAC     0xd1
 
 #define STREAM_TYPE_AUDIO_AC3       0x81
-#define STREAM_TYPE_AUDIO_DTS       0x8a
+#define STREAM_TYPE_AUDIO_DTS       0x82
+#define STREAM_TYPE_AUDIO_TRUEHD    0x83
 
 typedef struct MpegTSContext MpegTSContext;
 
index 47f0a78..78a9786 100644 (file)
@@ -318,6 +318,12 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
         case AV_CODEC_ID_AC3:
             stream_type = STREAM_TYPE_AUDIO_AC3;
             break;
+        case AV_CODEC_ID_DTS:
+            stream_type = STREAM_TYPE_AUDIO_DTS;
+            break;
+        case AV_CODEC_ID_TRUEHD:
+            stream_type = STREAM_TYPE_AUDIO_TRUEHD;
+            break;
         default:
             stream_type = STREAM_TYPE_PRIVATE_DATA;
             break;