summaryrefslogtreecommitdiff
path: root/kernel/zttranscode.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/zttranscode.c')
-rw-r--r--kernel/zttranscode.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/zttranscode.c b/kernel/zttranscode.c
index 239189d..5462da8 100644
--- a/kernel/zttranscode.c
+++ b/kernel/zttranscode.c
@@ -190,8 +190,17 @@ get_free_channel(struct zt_transcoder *tc)
for (i = 0; i < tc->numchannels; i++) {
chan = &tc->channels[i];
if (!zt_tc_is_busy(chan)) {
- zt_tc_set_busy(chan);
- return chan;
+ if (!zt_tc_is_built(chan)) {
+ zt_tc_set_busy(chan);
+ return chan;
+ } else {
+ /* If the channel is already built, we must
+ * make sure that it can support the formats
+ * that we're interested in. */
+ if ((fmts->srcfmt|fmts->dstfmt) ==
+ chan->built_fmts)
+ return chan;
+ }
}
}
return NULL;