aboutsummaryrefslogtreecommitdiffstats
path: root/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'frame.c')
-rw-r--r--frame.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/frame.c b/frame.c
index 51ca3e9ea..b4ef6dc04 100644
--- a/frame.c
+++ b/frame.c
@@ -1008,9 +1008,12 @@ int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
break;
}
}
- if(ret)
+ if(ret & AST_FORMAT_AUDIO_MASK)
return ret;
+ if (option_debug > 3)
+ ast_log(LOG_DEBUG, "Could not find preferred codec - %s\n", find_best ? "Going for the best codec" : "Returning zero codec");
+
return find_best ? ast_best_codec(formats) : 0;
}
@@ -1034,7 +1037,10 @@ void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, const char
*mask &= ~format;
}
- if (pref) {
+ /* Set up a preference list for audio. Do not include video in preferences
+ since we can not transcode video and have to use whatever is offered
+ */
+ if (pref && (format & AST_FORMAT_AUDIO_MASK)) {
if (strcasecmp(this, "all")) {
if (allowing)
ast_codec_pref_append(pref, format);