Commit 99c58e49 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/matroskaenc: Clean up mkv_write_stereo_mode()

Mostly reindentation after the last commit. Also remove a variable that
is always zero; move another variable to a more local scope and don't
assign a value to a local variable immediately before leaving the function.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent ff1264aa
......@@ -1025,8 +1025,6 @@ static void mkv_write_field_order(AVIOContext *pb, int mode,
static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb,
AVStream *st, int mode, int *h_width, int *h_height)
{
int i;
int ret = 0;
const AVDictionaryEntry *tag;
MatroskaVideoStereoModeType format = MATROSKA_VIDEO_STEREOMODE_TYPE_NB;
const AVStereo3D *stereo;
......@@ -1039,7 +1037,7 @@ static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb,
(tag = av_dict_get( s->metadata, "stereo_mode", NULL, 0))) {
int stereo_mode = atoi(tag->value);
for (i=0; i<MATROSKA_VIDEO_STEREOMODE_TYPE_NB; i++)
for (int i = 0; i < MATROSKA_VIDEO_STEREOMODE_TYPE_NB; i++)
if (!strcmp(tag->value, ff_matroska_video_stereo_mode[i])){
stereo_mode = i;
break;
......@@ -1098,7 +1096,7 @@ static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb,
}
if (format == MATROSKA_VIDEO_STEREOMODE_TYPE_NB)
return ret;
return 0;
// if webm, do not write unsupported modes
if ((mode == MODE_WEBM &&
......@@ -1107,14 +1105,13 @@ static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb,
|| format >= MATROSKA_VIDEO_STEREOMODE_TYPE_NB) {
av_log(s, AV_LOG_ERROR,
"The specified stereo mode is not valid.\n");
format = MATROSKA_VIDEO_STEREOMODE_TYPE_NB;
return AVERROR(EINVAL);
}
// write StereoMode if format is valid
put_ebml_uint(pb, MATROSKA_ID_VIDEOSTEREOMODE, format);
return ret;
return 0;
}
static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment