Fix: besides the background video no other video is decoded

This commit is contained in:
lukeIam committed 2016-02-05 19:13:52 +01:00
1 parent f069f9fd9b
commit 216375ab10
1 file changed
+14 -6
+14 -6
View File
@@ -406,23 +406,31 @@ namespace Vocaluxe.Lib.Video.Acinerella
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder) public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
{ {
if (pAcDecoder == IntPtr.Zero)
{
return false;
}
lock (_GetLockToken(pAcDecoder)) lock (_GetLockToken(pAcDecoder))
{
do
{ {
var pckt = _ac_read_package(pAcInstance); var pckt = _ac_read_package(pAcInstance);
if (pckt != IntPtr.Zero) if (pckt == IntPtr.Zero)
{
if (pAcDecoder != IntPtr.Zero)
{ {
return false;
}
// The packet is for the video stream, try to decode it // The packet is for the video stream, try to decode it
if (_ac_decode_package(pckt, pAcDecoder) != 0) if (_ac_decode_package(pckt, pAcDecoder) != 0)
{ {
ac_free_package(pckt); ac_free_package(pckt);
return true; return true;
} }
}
ac_free_package(pckt); ac_free_package(pckt);
}
return false; } while (true);
} }
} }