[vlc-devel] [PATCH] transcoding: avoid a divide by 0 when source video framerate is mistakenly set to 0 by a demuxer

Sebastian Ramacher sramacher at debian.org
Sun Jun 12 11:11:09 CEST 2016


On 2015-10-07 11:18:22, Emeric Grange wrote:
> 2015-10-06 19:10 GMT+02:00 Ilkka Ollakka <ileoo at videolan.org>:
> >
> > On Tue, Oct 06, 2015 at 02:57:03PM +0200, Emeric Grange wrote:
> >
> > Hi,
> >
> > Patch looks ok, but I have feeling that most cases default framerate is wrong on cases where
> > demuxer isn't able to give. Do you have some cases currently that
> > demuxer fails to get framerate but that default is actually reasonable
> > guess?
> >
> > > ---
> > >  modules/stream_out/transcode/video.c | 10 +++++++++-
> > >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > > diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
> > > index 2c2d4f3..8f85036 100644
> > > --- a/modules/stream_out/transcode/video.c
> > > +++ b/modules/stream_out/transcode/video.c
> > > @@ -465,7 +465,7 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
> > >           i_dst_visible_width, i_dst_visible_height
> > >       );
> >
> > > -    /* Handle frame rate conversion */
> > > +    /* Handle frame rate conversion (encoder) */
> > >      if( !id->p_encoder->fmt_out.video.i_frame_rate ||
> > >          !id->p_encoder->fmt_out.video.i_frame_rate_base )
> > >      {
> > > @@ -485,6 +485,14 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
> > >          }
> > >      }
> >
> > > +    /* Handle frame rate (decoder) */
> > > +    if (!id->p_decoder->fmt_out.video.i_frame_rate ||
> > > +        !id->p_decoder->fmt_out.video.i_frame_rate_base)
> > > +    {
> > > +        id->p_decoder->fmt_out.video.i_frame_rate = ENC_FRAMERATE;
> > > +        id->p_decoder->fmt_out.video.i_frame_rate_base = ENC_FRAMERATE_BASE;
> > > +    }
> > > +
> > >      id->p_encoder->fmt_in.video.orientation =
> > >          id->p_encoder->fmt_out.video.orientation =
> > >          id->p_decoder->fmt_in.video.orientation;
> > --
> > Ilkka Ollakka
> > Each person has the right to take the subway.
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> >
> 
> Hi,
> Yes you are right the default will probably be wrong, the goal was
> only to avoid VLC segfaulting. My use case was trancoding mp4 file
> with "DASH style" tracks from youtube, and the problem was not an
> exotic framerate but just the mp4 parser unable to get framerate. Most
> files are 24fps so 25 is not that far of.
> Maybe the proper way to handle that situation is just to fail with an
> error trace then.

Hi,

any news on this patch? We got a bug report [1] for a SIGFPE while transcoding
which is supposedly fixed by this patch.

Regards

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825431#5
-- 
Sebastian Ramacher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160612/1c9b97a0/attachment.sig>


More information about the vlc-devel mailing list