AV on TRVMFFMPEG.InitDecode

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
panlab_mf
Posts: 15
Joined: Wed Feb 06, 2019 9:55 am

AV on TRVMFFMPEG.InitDecode

Post by panlab_mf » Mon Jul 01, 2019 2:53 pm

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,

Sergey Tkachenko
Site Admin
Posts: 14464
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: AV on TRVMFFMPEG.InitDecode

Post by Sergey Tkachenko » Tue Jul 02, 2019 8:49 am

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;

panlab_mf
Posts: 15
Joined: Wed Feb 06, 2019 9:55 am

Re: AV on TRVMFFMPEG.InitDecode

Post by panlab_mf » Wed Jul 03, 2019 10:40 am

Nice.

Post Reply