summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2017-12-29 01:40:54 +0300
committerDmitry Osipenko <digetx@gmail.com>2017-12-29 01:40:54 +0300
commitc5a23a77ccf11fd3a0c029e2ac8e7d9b936b7af5 (patch)
tree834a9baaee636af86c031a86d5dbaec1ab5a3743
parent1e168d3fb73cd7eff4f7871955f1f8facd7db486 (diff)
Handle potential interrupt signals in the decoder
-rw-r--r--src/decoder.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/decoder.c b/src/decoder.c
index dd990e1..71464c4 100644
--- a/src/decoder.c
+++ b/src/decoder.c
@@ -364,6 +364,7 @@ static VdpStatus tegra_decode_h264(tegra_decoder *dec, tegra_surface *surf,
int slice_type_mod = slice_type % 5;
int frame_num_wrap = (info->frame_num == 0);
int refs_num = 0;
+ int err;
if (dev == NULL) {
return VDP_STATUS_INVALID_HANDLE;
@@ -431,7 +432,12 @@ static VdpStatus tegra_decode_h264(tegra_decoder *dec, tegra_surface *surf,
ctx.num_ref_idx_l1_active_minus1 = info->num_ref_idx_l1_active_minus1;
ctx.reserved = 0;
- if (ioctl(dev->vde_fd, TEGRA_VDE_IOCTL_DECODE_H264, &ctx) != 0) {
+repeat:
+ err = ioctl(dev->vde_fd, TEGRA_VDE_IOCTL_DECODE_H264, &ctx);
+ if (err != 0) {
+ if (errno == EINTR || errno == EAGAIN) {
+ goto repeat;
+ }
return VDP_STATUS_ERROR;
}