Page 1 of 1

AV on TRVMFFMPEG.InitDecode

Posted: Mon Jul 01, 2019 2:53 pm
by panlab_mf
Hi,

I'm getting AV on TRVMFFMPEG.InitDecode(), if the OpenFile returns false.

Code: Select all

    try
      // Open video file
      if not OpenFile(FormatContext, DecCurTime, filename) then
      begin
        try
          av_free(FormatContext);
        finally
          FormatContext := nil;
        end;
        exit;
      end;
    except
      exit;
    end;
How can I silence this exception in order to continue running my application?

Thanks,

Re: AV on TRVMFFMPEG.InitDecode

Posted: Tue Jul 02, 2019 8:49 am
by Sergey Tkachenko
This is a bug. This code must be:

Code: Select all

    try
      // Open video file
      if not OpenFile(FormatContext, DecCurTime, filename) then
      begin
          FormatContext := nil;
          exit;
      end;
    except
      exit;
    end;

Re: AV on TRVMFFMPEG.InitDecode

Posted: Wed Jul 03, 2019 10:40 am
by panlab_mf
Nice.