changeset 34398:9120eb514454

Add support of compression algorithm 3 (header stripping) in mkv demuxer. Patch by Alexander Beregalov (a.beregalov gmail).
author iive
date Mon, 02 Jan 2012 12:53:20 +0000
parents 5d6f6e30e1cc
children f2c03009068d
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Mon Jan 02 11:26:00 2012 +0000
+++ b/libmpdemux/demux_mkv.c	Mon Jan 02 12:53:20 2012 +0000
@@ -380,6 +380,15 @@
             }
             *size = dstlen - out_avail;
         }
+      else if (track->encodings[i].comp_algo == 3)
+        {
+          *dest = malloc (*size + track->encodings[i].comp_settings_len);
+          memcpy(*dest, track->encodings[i].comp_settings,
+                 track->encodings[i].comp_settings_len);
+          memcpy(*dest + track->encodings[i].comp_settings_len, src, *size);
+          *size += track->encodings[i].comp_settings_len;
+          modified = 1;
+        }
     }
 
     return modified;
@@ -542,7 +551,7 @@
                                track->tnum);
                     }
 
-                    if (e.comp_algo != 0 && e.comp_algo != 2) {
+                    if (e.comp_algo != 0 && e.comp_algo != 2 && e.comp_algo != 3) {
                         mp_msg(MSGT_DEMUX, MSGL_WARN,
                                MSGTR_MPDEMUX_MKV_UnknownCompression,
                                track->tnum, e.comp_algo);