avilib: only require track ID instead of full tag in idx1

This commit is contained in:
Moritz Bunkus 2015-02-27 21:58:31 +01:00
parent da54691975
commit 461e3ac82b
3 changed files with 11 additions and 4 deletions

View File

@ -2718,7 +2718,7 @@ int avi_parse_input_file(avi_t *AVI, int getIndex)
it is in the file */
for(i=0;i<AVI->n_idx;i++)
if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3)==0 ) break;
if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,2)==0 ) break;
if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS)
pos = str2ulong(AVI->idx[i]+ 8);
@ -3130,7 +3130,7 @@ multiple_riff:
for(i=0;i<AVI->n_idx;i++) {
if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) nvi++;
if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,2) == 0) nvi++;
for(j=0; j<AVI->anum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++;
}
@ -3159,7 +3159,7 @@ multiple_riff:
for(i=0;i<AVI->n_idx;i++) {
//video
if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) {
if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,2) == 0) {
AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4) & 0x10;
AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff;
AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12);
@ -3595,7 +3595,7 @@ int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf,
n = PAD_EVEN(str2ulong((unsigned char *)data+4));
if(strncasecmp(data,AVI->video_tag,3) == 0)
if(strncasecmp(data,AVI->video_tag,2) == 0)
{
*len = n;
AVI->video_pos++;

View File

@ -315,3 +315,4 @@ T_466mkvextract_avi_8bpp:9d8a3a19c80c395ae3efe0ba8c66c2f2:passed:20150223-213412
T_467mpeg_ts_eac3_type_0xa1:6c97721782afd53bc41776abf2d7f445:passed:20150223-221854:0.595330952
T_468extract_cues:337fe77a5fb2f3d30deea092820c7ae8-f58aa81140411b045ce403f4d07de361+b71e065b26dd67f03fff849f1cbb929a:passed:20150225-202605:0.373426759
T_469avi_keyframes:cabe8cc129d7e1f72476c606e7e0f0d2:passed:20150225-223922:0.055489645
T_470avi_idx1_video_not_00db:12e8b014a66eaefcce54fb128d9a0d52-7f247aaf4412b0b9fb181d22fd96a1db-bff4ad0da7ec16a0cec0ff41733a7539-bb304b822980242f8bc240e58d3dd1af-298d112e745133b54362b61a3edf2238-6fe2d394bf9d3814795860745c19865b:passed:20150227-215810:0.225420656

View File

@ -0,0 +1,6 @@
#!/usr/bin/ruby -w
# T_470avi_idx1_video_not_00db
describe "mkvmerge / video tracks which use tags in idx1 other than 00db"
(1..6).each { |idx| test_merge "data/avi/idx1-video-not-00db-#{idx}.avi" }