OSDN Git Service

動画の再生途中でD2D描画が真っ黒になる現象を修正。
authorくまかみ工房 <kumakamikoubou@gmail.com>
Mon, 12 Jun 2017 14:40:54 +0000 (23:40 +0900)
committerくまかみ工房 <kumakamikoubou@gmail.com>
Mon, 12 Jun 2017 14:40:54 +0000 (23:40 +0900)
動画のBitmap生成時にメモリリークしてた?
new Bitmap → CopyFromMemory ではなく、new Bitmap だけで生成するよう変更。

FDK/メディア/動画.cs

index 7fa3337..a7825dc 100644 (file)
@@ -823,8 +823,9 @@ namespace FDK.メディア
                                                d2dBitmap = new Bitmap(
                                                        this._デコードタスク用D2DDeviceContext参照,
                                                        new Size2( (int) this.サイズ.Width, (int) this.サイズ.Height ),
-                                                       new BitmapProperties( new PixelFormat( SharpDX.DXGI.Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied ) ) );
-                                               d2dBitmap.CopyFromMemory( new IntPtr( scanLine0 ), pitch );
+                                                       new DataPointer( scanLine0, bufferLength ),
+                                                       pitch,
+                                                       new BitmapProperties( new PixelFormat( SharpDX.DXGI.Format.B8G8R8A8_UNorm, AlphaMode.Ignore ) ) );
                                        }
                                        catch( SharpDXException e )
                                        {