[FFmpeg-devel] [PATCH] ffmpeg_opt: Dont exit on avformat_find_stream_info() failure if there are streams

Michael Niedermayer michaelni at gmx.at
Wed Jun 18 21:38:38 CEST 2014


On Wed, Jun 18, 2014 at 11:26:48AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2014-06-10 18:01:49 +0200, Michael Niedermayer encoded:
> > This allows "-codec copy -f framecrc" on files with only unindentifyable streams
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  ffmpeg_opt.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> > index 887752d..f7473fa 100644
> > --- a/ffmpeg_opt.c
> > +++ b/ffmpeg_opt.c
> > @@ -888,8 +888,10 @@ static int open_input_file(OptionsContext *o, const char *filename)
> >      ret = avformat_find_stream_info(ic, opts);
> >      if (ret < 0) {
> >          av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename);
> > -        avformat_close_input(&ic);
> > -        exit_program(1);
> > +        if (ic->nb_streams == 0) {
> > +            avformat_close_input(&ic);
> > +            exit_program(1);
> > +        }
> >      }
> >  
> >      timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time;
> 
> LGTM.

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140618/097b3011/attachment.asc>


More information about the ffmpeg-devel mailing list