OSDN Git Service

#42987 Again Fixed failing to seek the tail of mp4 video (by using DTXCreator + DTXMa...
authoryyagi <yyagi.dtxmania@gmail.com>
Tue, 5 Oct 2021 12:56:46 +0000 (21:56 +0900)
committeryyagi <yyagi.dtxmania@gmail.com>
Tue, 5 Oct 2021 12:56:46 +0000 (21:56 +0900)
FDK/コード/04.グラフィック/CAviDS.cs

index 14f02dc..4ef2a34 100644 (file)
@@ -143,11 +143,8 @@ namespace FDK
 
                public void Seek(int timeInMs)
                {
-                       int hr = seeker.SetPositions( DsLong.FromInt64((long)(timeInMs * 10000)), AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
-                       if ( (uint)hr != 0x80070057 )   // E_INVALIDARG. It tend to occur in seeking to the tail-part in mp4 file. Even if we ignore the error, the seek seems success,
-                       {
-                               DsError.ThrowExceptionForHR(hr);
-                       }
+                       int hr = seeker.SetPositions( new DsLong( (long)timeInMs * 10000 ), AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning );
+                       DsError.ThrowExceptionForHR(hr);
                        hr = control.GetState(timeOutMs, out state); // state is Running
                        DsError.ThrowExceptionForHR(hr);
                }