vlc/vlc-3.0 | branch: master | Steve Lhomme <[email protected]> | Wed Sep 12 11:38:14 2018 +0200| [cf1ea74e8cab1d358c8b48c5c582538b79a12052] | committer: Hugo Beauzée-Luyssen
aom: don't pass the private structure pointer, just the index We can never get a NULL pointer from libaom this way. The PTS may be wrong but it won't crash. (cherry picked from commit 96a606dcaf1bb53537d902b2235c41856cc218bc) Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cf1ea74e8cab1d358c8b48c5c582538b79a12052 --- modules/codec/aom.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/codec/aom.c b/modules/codec/aom.c index eda86b5fac..4d53831255 100644 --- a/modules/codec/aom.c +++ b/modules/codec/aom.c @@ -145,13 +145,13 @@ static int PushFrame(decoder_t *dec, block_t *block) size_t i_buffer; /* Associate packet PTS with decoded frame */ - struct frame_priv_s *priv = &p_sys->frame_priv[p_sys->i_next_frame_priv++ % AOM_MAX_FRAMES_DEPTH]; + uintptr_t priv_index = p_sys->i_next_frame_priv++ % AOM_MAX_FRAMES_DEPTH; if(likely(block)) { p_buffer = block->p_buffer; i_buffer = block->i_buffer; - priv->pts = (block->i_pts != VLC_TS_INVALID) ? block->i_pts : block->i_dts; + p_sys->frame_priv[priv_index].pts = (block->i_pts != VLC_TS_INVALID) ? block->i_pts : block->i_dts; } else { @@ -160,7 +160,7 @@ static int PushFrame(decoder_t *dec, block_t *block) } aom_codec_err_t err; - err = aom_codec_decode(ctx, p_buffer, i_buffer, priv); + err = aom_codec_decode(ctx, p_buffer, i_buffer, (void*)priv_index); if(block) block_Release(block); @@ -206,13 +206,12 @@ static void OutputFrame(decoder_t *dec, const struct aom_image *img) picture_t *pic = decoder_NewPicture(dec); if (pic) { + decoder_sys_t *p_sys = dec->p_sys; CopyPicture(img, pic); - /* fetches back the PTS */ - mtime_t pts = ((struct frame_priv_s *) img->user_priv)->pts; pic->b_progressive = true; /* codec does not support interlacing */ - pic->date = pts; + pic->date = p_sys->frame_priv[(uintptr_t)img->user_priv].pts; decoder_QueueVideo(dec, pic); } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
