[vlc-commits] mux: libmp4mux: use brand instead of flag

Francois Cartegnie git at videolan.org
Wed May 16 09:39:41 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 16 09:14:16 2018 +0200| [50e74d700a19c0fe8f6cfb1e251b2cd5edc7499c] | committer: Francois Cartegnie

mux: libmp4mux: use brand instead of flag

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=50e74d700a19c0fe8f6cfb1e251b2cd5edc7499c
---

 modules/demux/smooth/playlist/ForgedInitSegment.cpp | 2 +-
 modules/mux/mp4/libmp4mux.c                         | 4 ++--
 modules/mux/mp4/libmp4mux.h                         | 2 +-
 modules/mux/mp4/mp4.c                               | 3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.cpp b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
index 74783fce00..bb6806c8ae 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.cpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
@@ -274,7 +274,7 @@ block_t * ForgedInitSegment::buildMoovBox()
     mp4mux_trackinfo_t *p_tracks = &trackinfo;
     bo_t *box = NULL;
 
-    if(mp4mux_CanMux( NULL, &trackinfo.fmt, true, false ))
+    if(mp4mux_CanMux( NULL, &trackinfo.fmt, VLC_FOURCC('s', 'm', 'o', 'o'), true ))
        box = mp4mux_GetMoovBox(NULL, &p_tracks, 1,
                                trackTimescale.ToTime(duration.Get()),
                                true, false, false, false);
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 98f78bb768..cb36653fa2 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -1837,9 +1837,9 @@ bo_t *mp4mux_GetFtyp(vlc_fourcc_t major, uint32_t minor, vlc_fourcc_t extra[], s
 }
 
 bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt,
-                   bool b_fragmented, bool b_mov)
+                   vlc_fourcc_t i_brand, bool b_fragmented)
 {
-    VLC_UNUSED(b_mov);
+    VLC_UNUSED(i_brand);
     switch(p_fmt->i_codec)
     {
     case VLC_CODEC_A52:
diff --git a/modules/mux/mp4/libmp4mux.h b/modules/mux/mp4/libmp4mux.h
index ee0e6ba62d..775bf2005d 100644
--- a/modules/mux/mp4/libmp4mux.h
+++ b/modules/mux/mp4/libmp4mux.h
@@ -82,7 +82,7 @@ bo_t *box_full_new(const char *fcc, uint8_t v, uint32_t f);
 void  box_fix     (bo_t *box, uint32_t);
 void  box_gather  (bo_t *box, bo_t *box2);
 
-bool mp4mux_CanMux(vlc_object_t *, const es_format_t *, bool, bool);
+bool mp4mux_CanMux(vlc_object_t *, const es_format_t *, vlc_fourcc_t, bool);
 bo_t *mp4mux_GetFtyp(vlc_fourcc_t, uint32_t, vlc_fourcc_t[], size_t i_fourcc);
 bo_t *mp4mux_GetMoovBox(vlc_object_t *, mp4mux_trackinfo_t **pp_tracks, unsigned int i_tracks,
                         int64_t i_movie_duration,
diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 36b7db0fd5..98d7da84d9 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -406,7 +406,8 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
     mp4_stream_t    *p_stream;
 
     if(!mp4mux_CanMux(VLC_OBJECT(p_mux), p_input->p_fmt,
-                      p_sys->b_fragmented, p_sys->b_mov))
+                      p_sys->b_mov ? MAJOR_qt__ : MAJOR_isom,
+                      p_sys->b_fragmented))
     {
         msg_Err(p_mux, "unsupported codec %4.4s in mp4",
                  (char*)&p_input->p_fmt->i_codec);



More information about the vlc-commits mailing list