Skip to content

Commit

Permalink
mux: mp4: write proper empty TTML samples
Browse files Browse the repository at this point in the history
  • Loading branch information
fcartegnie committed Feb 24, 2024
1 parent e2b450e commit 28a2317
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/mux/mp4/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "../../packetizer/hxxx_nal.h"
#include "../av1_pack.h"
#include "../extradata.h"
#include "../../codec/ttml/ttml.h"

/*****************************************************************************
* Module descriptor
Expand Down Expand Up @@ -818,9 +819,10 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
}
else if(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_TTML)
{
p_empty = block_Alloc(40);
const char emptyttml[] = "<tt xmlns=\"" TT_NS "\"/>";
p_empty = block_Alloc(sizeof(emptyttml));
if(p_empty)
memcpy(p_empty->p_buffer, "<tt><body><div><p></p></div></body></tt>", 40);
memcpy(p_empty->p_buffer, emptyttml, p_empty->i_buffer);
}
else if(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_WEBVTT)
{
Expand Down

0 comments on commit 28a2317

Please sign in to comment.