Commit 4d536223 authored by Laurent Aimar's avatar Laurent Aimar

* mp4: fix for width in tkhd for video stream with null aspect.

parent d67ece3d
...@@ -1562,10 +1562,15 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux ) ...@@ -1562,10 +1562,15 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux )
} }
else if( p_stream->fmt.i_cat == VIDEO_ES ) else if( p_stream->fmt.i_cat == VIDEO_ES )
{ {
int i_width = p_stream->fmt.video.i_width;
if( p_stream->fmt.video.i_aspect > 0 )
{
i_width = tkhd, p_stream->fmt.video.i_aspect *
p_stream->fmt.video.i_height /
VOUT_ASPECT_FACTOR << 16;
}
// width (presentation) // width (presentation)
bo_add_32be( tkhd, p_stream->fmt.video.i_aspect * bo_add_32be( tkhd, i_width );
p_stream->fmt.video.i_height /
VOUT_ASPECT_FACTOR << 16 );
// height(presentation) // height(presentation)
bo_add_32be( tkhd, p_stream->fmt.video.i_height << 16 ); bo_add_32be( tkhd, p_stream->fmt.video.i_height << 16 );
} }
...@@ -1579,7 +1584,11 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux ) ...@@ -1579,7 +1584,11 @@ static bo_t *GetMoovBox( sout_mux_t *p_mux )
mp4_stream_t *tk = p_sys->pp_streams[i]; mp4_stream_t *tk = p_sys->pp_streams[i];
if( tk->fmt.i_cat == VIDEO_ES ) if( tk->fmt.i_cat == VIDEO_ES )
{ {
i_width = p_stream->fmt.video.i_aspect * p_stream->fmt.video.i_height / VOUT_ASPECT_FACTOR; if( p_stream->fmt.video.i_aspect )
i_width = p_stream->fmt.video.i_aspect *
p_stream->fmt.video.i_height / VOUT_ASPECT_FACTOR;
else
i_width = p_stream->fmt.video.i_width;
i_height = p_stream->fmt.video.i_height; i_height = p_stream->fmt.video.i_height;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment