1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

lavf: fix style for avformat_alloc_output_context2()

More consistent/readable.
This commit is contained in:
Stefano Sabatini 2011-05-19 22:12:37 +02:00
parent 5ecdfd008b
commit 5045786b7e

View File

@ -2754,14 +2754,14 @@ int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)
int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat, int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat,
const char *format, const char *filename) const char *format, const char *filename)
{ {
AVFormatContext *s= avformat_alloc_context(); AVFormatContext *s = avformat_alloc_context();
int ret = 0; int ret = 0;
*avctx = NULL; *avctx = NULL;
if(!s) if (!s)
goto nomem; goto nomem;
if(!oformat){ if (!oformat) {
if (format) { if (format) {
oformat = av_guess_format(format, NULL, NULL); oformat = av_guess_format(format, NULL, NULL);
if (!oformat) { if (!oformat) {
@ -2774,13 +2774,13 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *ofor
if (!oformat) { if (!oformat) {
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n", av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n",
filename); filename);
goto error; goto error;
} }
} }
} }
s->oformat= oformat; s->oformat = oformat;
if (s->oformat->priv_data_size > 0) { if (s->oformat->priv_data_size > 0) {
s->priv_data = av_mallocz(s->oformat->priv_data_size); s->priv_data = av_mallocz(s->oformat->priv_data_size);
if (!s->priv_data) if (!s->priv_data)
@ -2792,7 +2792,7 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *ofor
} else } else
s->priv_data = NULL; s->priv_data = NULL;
if(filename) if (filename)
av_strlcpy(s->filename, filename, sizeof(s->filename)); av_strlcpy(s->filename, filename, sizeof(s->filename));
*avctx = s; *avctx = s;
return 0; return 0;