[vlc-commits] mux: mp4: reject spu for fragmented mp4 for now
Francois Cartegnie
git at videolan.org
Wed Jan 17 18:31:59 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 17 16:40:13 2018 +0100| [b408655d355324254ad3a84972473b2e233fdd7c] | committer: Francois Cartegnie
mux: mp4: reject spu for fragmented mp4 for now
too broken
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b408655d355324254ad3a84972473b2e233fdd7c
---
modules/demux/smooth/playlist/ForgedInitSegment.cpp | 2 +-
modules/mux/mp4/libmp4mux.c | 8 +++++---
modules/mux/mp4/libmp4mux.h | 2 +-
modules/mux/mp4/mp4.c | 3 ++-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.cpp b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
index 258bf26756..74783fce00 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 ))
+ if(mp4mux_CanMux( NULL, &trackinfo.fmt, true, false ))
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 0d40a87589..015d0772b5 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -1816,8 +1816,10 @@ bo_t *mp4mux_GetFtyp(vlc_fourcc_t major, uint32_t minor, vlc_fourcc_t extra[], s
return box;
}
-bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt)
+bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt,
+ bool b_fragmented, bool b_mov)
{
+ VLC_UNUSED(b_mov);
switch(p_fmt->i_codec)
{
case VLC_CODEC_A52:
@@ -1856,10 +1858,10 @@ bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt)
case VLC_CODEC_SUBT:
if(p_obj)
msg_Warn(p_obj, "subtitle track added like in .mov (even when creating .mp4)");
- break;
+ return !b_fragmented;
case VLC_CODEC_QTXT:
case VLC_CODEC_TX3G:
- break;
+ return !b_fragmented;
default:
return false;
}
diff --git a/modules/mux/mp4/libmp4mux.h b/modules/mux/mp4/libmp4mux.h
index 1a280a9915..ee0e6ba62d 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 mp4mux_CanMux(vlc_object_t *, const es_format_t *, bool, 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 e22963490a..73cfb13a31 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -395,7 +395,8 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
sout_mux_sys_t *p_sys = p_mux->p_sys;
mp4_stream_t *p_stream;
- if(!mp4mux_CanMux(VLC_OBJECT(p_mux), p_input->p_fmt))
+ if(!mp4mux_CanMux(VLC_OBJECT(p_mux), p_input->p_fmt,
+ p_sys->b_fragmented, p_sys->b_mov))
{
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