mpegts: check substreams before discarding
authorChristian Schmidt <schmidt@digadd.de>
Thu, 6 Sep 2012 14:43:24 +0000 (16:43 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 12 Sep 2012 21:43:53 +0000 (23:43 +0200)
Allow to extract the AC3 core from TrueHD with the "copy" codec.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/mpegts.c

index 40a983b..a3d5e8e 100644 (file)
@@ -784,7 +784,8 @@ static int mpegts_push_data(MpegTSFilter *filter,
                     code = pes->header[3] | 0x100;
                     av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
 
-                    if ((pes->st && pes->st->discard == AVDISCARD_ALL) ||
+                    if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
+                         (!pes->sub_st || pes->sub_st->discard == AVDISCARD_ALL)) ||
                         code == 0x1be) /* padding_stream */
                         goto skip;