Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
diff --git a/bs1770gain/bs1770gain_tree.c b/bs1770gain/bs1770gain_tree.c
index fe2b198..d429752 100755
--- a/bs1770gain/bs1770gain_tree.c
+++ b/bs1770gain/bs1770gain_tree.c
@@ -129,6 +129,8 @@ int bs1770gain_tree_analyze(tree_t *tree, const char *odirname,
ac.shortterm.partition=options->shortterm.partition;
ac.f=f;
ac.dump=0;
+ ac.ai=options->audio;
+ ac.vi=options->video;
if (ffsox_analyze(&ac)<0) {
fprintf(f,"Error gathering track statistics.\n");
diff --git a/libffsox-2/ffsox.h b/libffsox-2/ffsox.h
index fdc08f1..1e47917 100755
--- a/libffsox-2/ffsox.h
+++ b/libffsox-2/ffsox.h
@@ -299,6 +299,8 @@ struct ffsox_analyze_config {
ffsox_block_config_t shortterm;
FILE *f;
int dump;
+ int ai;
+ int vi;
};
int ffsox_analyze(ffsox_analyze_config_t *ac);
diff --git a/libffsox-2/ffsox_analyze.c b/libffsox-2/ffsox_analyze.c
index bea764c..cf67d36 100755
--- a/libffsox-2/ffsox_analyze.c
+++ b/libffsox-2/ffsox_analyze.c
@@ -43,7 +43,7 @@ int ffsox_analyze(analyze_config_t *ac)
char buf[32];
// create a source.
- if (ffsox_source_create(&si,ac->path,-1,-1,progress,ac->f)<0) {
+ if (ffsox_source_create(&si,ac->path,ac->ai,ac->vi,progress,ac->f)<0) {
DMESSAGE("creating source");
goto si;
}
@@ -66,6 +66,13 @@ int ffsox_analyze(analyze_config_t *ac)
cc.momentary=ac->momentary;
cc.shortterm=ac->shortterm;
+ if (LIB1770_MAX_CHANNELS <= cc.channels) {
+ fprintf(stderr,
+ "\nError: ITU BS.1770 specifies only up to %d audio channels, this audio track has %d channels.\n",
+ LIB1770_MAX_CHANNELS, cc.channels);
+ goto si;
+ }
+
if (ffsox_collect_create(&collect,&cc)<0) {
DMESSAGE("creating collector");
goto collect;
diff --git a/libffsox-2/ffsox_audiostream.c b/libffsox-2/ffsox_audiostream.c
index 2996db8..a536a41 100755
--- a/libffsox-2/ffsox_audiostream.c
+++ b/libffsox-2/ffsox_audiostream.c
@@ -58,7 +58,7 @@ int ffsox_audiostream(AVFormatContext *fc, int *aip, int *vip)
if (*aip==i)
ai=i;
}
- else if (ai<0||2==cc->channels)
+ else if (ai<0)
ai=i;
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment