Merge "core: Don't attempt to write to a stream that does not exist."
This commit is contained in:
commit
7a75abdf13
1 changed files with 15 additions and 3 deletions
|
@ -5054,7 +5054,11 @@ int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame
|
||||||
case AST_FRAME_VIDEO:
|
case AST_FRAME_VIDEO:
|
||||||
/* XXX Handle translation of video codecs one day XXX */
|
/* XXX Handle translation of video codecs one day XXX */
|
||||||
if (ast_channel_tech(chan)->write_stream) {
|
if (ast_channel_tech(chan)->write_stream) {
|
||||||
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);
|
if (stream) {
|
||||||
|
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);
|
||||||
|
} else {
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
} else if ((stream == default_stream) && ast_channel_tech(chan)->write_video) {
|
} else if ((stream == default_stream) && ast_channel_tech(chan)->write_video) {
|
||||||
res = ast_channel_tech(chan)->write_video(chan, fr);
|
res = ast_channel_tech(chan)->write_video(chan, fr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -5063,7 +5067,11 @@ int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame
|
||||||
break;
|
break;
|
||||||
case AST_FRAME_MODEM:
|
case AST_FRAME_MODEM:
|
||||||
if (ast_channel_tech(chan)->write_stream) {
|
if (ast_channel_tech(chan)->write_stream) {
|
||||||
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);
|
if (stream) {
|
||||||
|
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);
|
||||||
|
} else {
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
} else if ((stream == default_stream) && ast_channel_tech(chan)->write) {
|
} else if ((stream == default_stream) && ast_channel_tech(chan)->write) {
|
||||||
res = ast_channel_tech(chan)->write(chan, fr);
|
res = ast_channel_tech(chan)->write(chan, fr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -5251,7 +5259,11 @@ int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame
|
||||||
f = NULL;
|
f = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (ast_channel_tech(chan)->write_stream) {
|
if (ast_channel_tech(chan)->write_stream) {
|
||||||
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), f);
|
if (stream) {
|
||||||
|
res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), f);
|
||||||
|
} else {
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
} else if ((stream == default_stream) && ast_channel_tech(chan)->write) {
|
} else if ((stream == default_stream) && ast_channel_tech(chan)->write) {
|
||||||
res = ast_channel_tech(chan)->write(chan, f);
|
res = ast_channel_tech(chan)->write(chan, f);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue