Fixed default FLV metadata values.
This commit is contained in:
parent
02b384ff2e
commit
bdc651bc85
1 changed files with 16 additions and 0 deletions
|
@ -930,24 +930,38 @@ JSON::Value FLV::Tag::toJSON(DTSC::Meta & metadata){
|
||||||
if (tmp){
|
if (tmp){
|
||||||
if (tmp->getContentP("width")){
|
if (tmp->getContentP("width")){
|
||||||
metadata.tracks[1].width = (long long int)tmp->getContentP("width")->NumValue();
|
metadata.tracks[1].width = (long long int)tmp->getContentP("width")->NumValue();
|
||||||
|
}else{
|
||||||
|
metadata.tracks[1].width = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("height")){
|
if (tmp->getContentP("height")){
|
||||||
metadata.tracks[1].height = (long long int)tmp->getContentP("height")->NumValue();
|
metadata.tracks[1].height = (long long int)tmp->getContentP("height")->NumValue();
|
||||||
|
}else{
|
||||||
|
metadata.tracks[1].height = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("framerate")){
|
if (tmp->getContentP("framerate")){
|
||||||
metadata.tracks[1].fpks = (long long int)(tmp->getContentP("framerate")->NumValue() * 1000.0);
|
metadata.tracks[1].fpks = (long long int)(tmp->getContentP("framerate")->NumValue() * 1000.0);
|
||||||
|
}else{
|
||||||
|
metadata.tracks[1].fpks = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("videodatarate")){
|
if (tmp->getContentP("videodatarate")){
|
||||||
metadata.tracks[1].bps = (long long int)(tmp->getContentP("videodatarate")->NumValue() * 1024) / 8;
|
metadata.tracks[1].bps = (long long int)(tmp->getContentP("videodatarate")->NumValue() * 1024) / 8;
|
||||||
|
}else{
|
||||||
|
metadata.tracks[1].bps = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("audiodatarate")){
|
if (tmp->getContentP("audiodatarate")){
|
||||||
metadata.tracks[2].bps = (long long int)(tmp->getContentP("audiodatarate")->NumValue() * 1024) / 8;
|
metadata.tracks[2].bps = (long long int)(tmp->getContentP("audiodatarate")->NumValue() * 1024) / 8;
|
||||||
|
}else{
|
||||||
|
metadata.tracks[2].bps = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("audiosamplerate")){
|
if (tmp->getContentP("audiosamplerate")){
|
||||||
metadata.tracks[2].rate = (long long int)tmp->getContentP("audiosamplerate")->NumValue();
|
metadata.tracks[2].rate = (long long int)tmp->getContentP("audiosamplerate")->NumValue();
|
||||||
|
}else{
|
||||||
|
metadata.tracks[2].rate = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("audiosamplesize")){
|
if (tmp->getContentP("audiosamplesize")){
|
||||||
metadata.tracks[2].size = (long long int)tmp->getContentP("audiosamplesize")->NumValue();
|
metadata.tracks[2].size = (long long int)tmp->getContentP("audiosamplesize")->NumValue();
|
||||||
|
}else{
|
||||||
|
metadata.tracks[2].size = 0;
|
||||||
}
|
}
|
||||||
if (tmp->getContentP("stereo")){
|
if (tmp->getContentP("stereo")){
|
||||||
if (tmp->getContentP("stereo")->NumValue() == 1){
|
if (tmp->getContentP("stereo")->NumValue() == 1){
|
||||||
|
@ -955,6 +969,8 @@ JSON::Value FLV::Tag::toJSON(DTSC::Meta & metadata){
|
||||||
}else{
|
}else{
|
||||||
metadata.tracks[2].channels = 1;
|
metadata.tracks[2].channels = 1;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
metadata.tracks[2].channels = 1;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < tmp->hasContent(); ++i){
|
for (int i = 0; i < tmp->hasContent(); ++i){
|
||||||
if (tmp->getContentP(i)->Indice() == "videocodecid" || tmp->getContentP(i)->Indice() == "audiocodecid" || tmp->getContentP(i)->Indice() == "width" || tmp->getContentP(i)->Indice() == "height" || tmp->getContentP(i)->Indice() == "framerate" || tmp->getContentP(i)->Indice() == "videodatarate" || tmp->getContentP(i)->Indice() == "audiodatarate" || tmp->getContentP(i)->Indice() == "audiosamplerate" || tmp->getContentP(i)->Indice() == "audiosamplesize" || tmp->getContentP(i)->Indice() == "audiochannels"){
|
if (tmp->getContentP(i)->Indice() == "videocodecid" || tmp->getContentP(i)->Indice() == "audiocodecid" || tmp->getContentP(i)->Indice() == "width" || tmp->getContentP(i)->Indice() == "height" || tmp->getContentP(i)->Indice() == "framerate" || tmp->getContentP(i)->Indice() == "videodatarate" || tmp->getContentP(i)->Indice() == "audiodatarate" || tmp->getContentP(i)->Indice() == "audiosamplerate" || tmp->getContentP(i)->Indice() == "audiosamplesize" || tmp->getContentP(i)->Indice() == "audiochannels"){
|
||||||
|
|
Loading…
Add table
Reference in a new issue