@@ -41,42 +41,36 @@ void FileProperties::extractStreamProperties( IProgress& progress, const EAnalys
41
41
{
42
42
VideoProperties properties ( *_formatContext, streamIndex, progress, level );
43
43
_videoStreams.push_back ( properties );
44
- _streams.push_back ( &_videoStreams.back () );
45
44
break ;
46
45
}
47
46
case AVMEDIA_TYPE_AUDIO:
48
47
{
49
48
AudioProperties properties ( *_formatContext, streamIndex );
50
49
_audioStreams.push_back ( properties );
51
- _streams.push_back ( &_audioStreams.back () );
52
50
break ;
53
51
}
54
52
case AVMEDIA_TYPE_DATA:
55
53
{
56
54
DataProperties properties ( *_formatContext, streamIndex );
57
55
_dataStreams.push_back ( properties );
58
- _streams.push_back ( &_dataStreams.back () );
59
56
break ;
60
57
}
61
58
case AVMEDIA_TYPE_SUBTITLE:
62
59
{
63
60
SubtitleProperties properties ( *_formatContext, streamIndex );
64
61
_subtitleStreams.push_back ( properties );
65
- _streams.push_back ( &_subtitleStreams.back () );
66
62
break ;
67
63
}
68
64
case AVMEDIA_TYPE_ATTACHMENT:
69
65
{
70
66
AttachementProperties properties ( *_formatContext, streamIndex );
71
67
_attachementStreams.push_back ( properties );
72
- _streams.push_back ( &_attachementStreams.back () );
73
68
break ;
74
69
}
75
70
case AVMEDIA_TYPE_UNKNOWN:
76
71
{
77
72
UnknownProperties properties ( *_formatContext, streamIndex );
78
73
_unknownStreams.push_back ( properties );
79
- _streams.push_back ( &_unknownStreams.back () );
80
74
break ;
81
75
}
82
76
case AVMEDIA_TYPE_NB:
@@ -86,6 +80,25 @@ void FileProperties::extractStreamProperties( IProgress& progress, const EAnalys
86
80
}
87
81
}
88
82
83
+ // once the streams vectors are filled, add their references the base streams vector
84
+ for ( size_t streamIndex = 0 ; streamIndex < _videoStreams.size (); ++streamIndex )
85
+ _streams.push_back ( &_videoStreams.at ( streamIndex ) );
86
+
87
+ for ( size_t streamIndex = 0 ; streamIndex < _audioStreams.size (); ++ streamIndex )
88
+ _streams.push_back ( &_audioStreams.at (streamIndex) );
89
+
90
+ for ( size_t streamIndex = 0 ; streamIndex < _dataStreams.size (); ++ streamIndex )
91
+ _streams.push_back ( &_dataStreams.at (streamIndex) );
92
+
93
+ for ( size_t streamIndex = 0 ; streamIndex < _subtitleStreams.size (); ++ streamIndex )
94
+ _streams.push_back ( &_subtitleStreams.at (streamIndex) );
95
+
96
+ for ( size_t streamIndex = 0 ; streamIndex < _attachementStreams.size (); ++ streamIndex )
97
+ _streams.push_back ( &_attachementStreams.at (streamIndex) );
98
+
99
+ for ( size_t streamIndex = 0 ; streamIndex < _unknownStreams.size (); ++ streamIndex )
100
+ _streams.push_back ( &_unknownStreams.at (streamIndex) );
101
+
89
102
// if the analysis level has decoded some streams parts, return at the beginning
90
103
if ( level > eAnalyseLevelHeader )
91
104
const_cast <FormatContext*>( _formatContext )->seek ( 0 , AVSEEK_FLAG_BACKWARD );
0 commit comments