@@ -114,12 +114,7 @@ private static List<StreamInfo> ExtractStreams(AVFormatContext* inputContext)
114
114
var s = inputContext ->streams [ i ] ;
115
115
116
116
var codecContext = ffmpeg . avcodec_alloc_context3 ( null ) ;
117
-
118
- #pragma warning disable CS0618 // Type or member is obsolete
119
-
120
- // ffmpeg.avcodec_parameters_to_context(codecContext, s->codecpar);
121
- ffmpeg . avcodec_copy_context ( codecContext , s ->codec ) ;
122
- #pragma warning restore CS0618 // Type or member is obsolete
117
+ ffmpeg . avcodec_parameters_to_context ( codecContext , s ->codecpar ) ;
123
118
124
119
var bitsPerSample = codecContext ->codec_type == AVMediaType . AVMEDIA_TYPE_AUDIO ?
125
120
ffmpeg . av_get_bits_per_sample ( codecContext ->codec_id ) : 0 ;
@@ -150,7 +145,7 @@ private static List<StreamInfo> ExtractStreams(AVFormatContext* inputContext)
150
145
bitsPerSample * codecContext ->channels * codecContext ->sample_rate :
151
146
codecContext ->bit_rate ,
152
147
MaxBitRate = codecContext ->rc_max_rate ,
153
- InfoFrameCount = s ->codec_info_nb_frames ,
148
+ InfoFrameCount = ( int ) s ->nb_frames ,
154
149
TimeBase = s ->time_base ,
155
150
SampleFormat = codecContext ->sample_fmt ,
156
151
SampleRate = codecContext ->sample_rate ,
@@ -258,7 +253,7 @@ private static List<ChapterInfo> ExtractChapters(AVFormatContext* ic)
258
253
StartTime = c ->start . ToTimeSpan ( c ->time_base ) ,
259
254
EndTime = c ->end . ToTimeSpan ( c ->time_base ) ,
260
255
Index = i ,
261
- ChapterId = c ->id ,
256
+ ChapterId = ( int ) c ->id ,
262
257
Metadata = FFDictionary . ToDictionary ( c ->metadata )
263
258
} ;
264
259
0 commit comments