Re: AVDemuxer mediastatus after unload call?

Gilles Caulier <[email protected]> Sun, 18 Sep 2022 09:59:37 +0200
Newsgroups gmane.comp.kde.digikam.devel
Message-ID <CAHFG6sEe0ujJxqcUqLSuNC5r-gcneK=GOrsw156_w0Gi=4Brjg@mail.gmail.com>
Hi Steven,

Good question. I will also place another brick in the wall : this is
different between ffmpeg 4 and ffmpeg 5, as the API has changed a lot
?

What's the ffmpeg API documentation said exactly (if any) ?

How are the sample/test codes implemented in the ffmpeg project about
this topic ?

Best
Gilles

Le dim. 18 sept. 2022 à 01:19, Steven Robbins <[email protected]> a écrit :
>
> Looking for a sanity check on my understanding.  I've written a test case (see
> below) that passes.  What puzzles me is that the call to mediaStatus() returns
> "LoadedMedia" after a call to unload().  Is that correct?
>
>
>     void status()
>     {
>         AVDemuxer demux;
>         QCOMPARE(demux.mediaStatus(), MediaStatus::NoMedia);
>         QCOMPARE(demux.atEnd(), false);
>         QCOMPARE(demux.fileName(), QLatin1String(""));
>         QCOMPARE(demux.isLoaded(), false);
>
>         QVERIFY(demux.setMedia(testFile1()));
>         QCOMPARE(demux.mediaStatus(), MediaStatus::NoMedia);
>         QCOMPARE(demux.atEnd(), false);
>         QCOMPARE(demux.fileName(), testFile1());
>         QCOMPARE(demux.isLoaded(), false);
>
>         QVERIFY(demux.load());
>         QCOMPARE(demux.mediaStatus(), MediaStatus::LoadedMedia);
>         QCOMPARE(demux.atEnd(), false);
>         QCOMPARE(demux.fileName(), testFile1());
>         QCOMPARE(demux.isLoaded(), true);
>
>         QVERIFY(demux.unload());
>         QCOMPARE(demux.mediaStatus(), MediaStatus::LoadedMedia);  // ??? why
> status shows loaded?
>         QCOMPARE(demux.atEnd(), false);
>         QCOMPARE(demux.fileName(), testFile1());
>         QCOMPARE(demux.isLoaded(), false);
>     }
>