Fix problems with FFmpeg files that have all-zero stream IDs.
[dcpomatic.git] / src / lib / image.cc
index 9a3aa8d45b036557fcb6f0297cc92afbf519aeb1..048cc4ab64e2d7408bc3445cb7580faa0f830c62 100644 (file)
@@ -155,10 +155,7 @@ Image::post_process (string pp, bool aligned) const
 shared_ptr<Image>
 Image::crop (Crop crop, bool aligned) const
 {
-       libdcp::Size cropped_size = size ();
-       cropped_size.width -= crop.left + crop.right;
-       cropped_size.height -= crop.top + crop.bottom;
-
+       libdcp::Size cropped_size = crop.apply (size ());
        shared_ptr<Image> out (new Image (pixel_format(), cropped_size, aligned));
 
        for (int c = 0; c < components(); ++c) {
@@ -300,7 +297,11 @@ Image::make_black ()
                yuv_16_black (sixteen_bit_uv, true);
                break;
 
-       case PIX_FMT_RGB24:             
+       case PIX_FMT_RGB24:
+       case PIX_FMT_ARGB:
+       case PIX_FMT_RGBA:
+       case PIX_FMT_ABGR:
+       case PIX_FMT_BGRA:
                memset (data()[0], 0, lines(0) * stride()[0]);
                break;