Rev 4438 | Rev 5592 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4438 | Rev 5021 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | #include |
9 | #include |
10 | #include |
10 | #include |
11 | #include |
11 | #include |
12 | #include |
12 | #include |
13 | #include "../winlib/winlib.h" |
13 | #include "winlib/winlib.h" |
14 | 14 | ||
Line 15... | Line 15... | ||
15 | #include "sound.h" |
15 | #include "sound.h" |
16 | #include "fplay.h" |
16 | #include "fplay.h" |
Line 17... | Line 17... | ||
17 | 17 | ||
Line 140... | Line 140... | ||
140 | movie_file[dot-file_name] = 0; |
140 | movie_file[dot-file_name] = 0; |
141 | } |
141 | } |
142 | else movie_file = file_name; |
142 | else movie_file = file_name; |
143 | 143 | ||
Line 144... | Line -... | ||
144 | - | ||
145 | // __asm__ __volatile__("int3"); |
144 | // __asm__ __volatile__("int3"); |
Line 146... | Line -... | ||
146 | - | ||
147 | // dump_format(pFormatCtx, 0, argv[1], 0); |
- | |
148 | - | ||
149 | // stream_duration = 1000.0 * pFormatCtx->duration * av_q2d(AV_TIME_BASE_Q); |
145 | |
Line 150... | Line 146... | ||
150 | stream_duration = pFormatCtx->duration; |
146 | stream_duration = pFormatCtx->duration; |
151 | 147 | ||
152 | printf("duration %f\n", (double)stream_duration); |
148 | printf("duration %f\n", (double)stream_duration); |
153 | // Find the first video stream |
149 | // Find the first video stream |
154 | videoStream=-1; |
150 | videoStream=-1; |
155 | audioStream=-1; |
151 | audioStream=-1; |
156 | for(i=0; i < pFormatCtx->nb_streams; i++) |
- | |
157 | { |
- | |
158 | // pFormatCtx->streams[i]->discard = AVDISCARD_ALL; |
152 | for(i=0; i < pFormatCtx->nb_streams; i++) |
159 | 153 | { |
|
160 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO |
154 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO |
161 | && videoStream < 0) |
155 | && videoStream < 0) |
162 | { |
156 | { |
163 | videoStream=i; |
157 | videoStream=i; |
164 | video_time_base = pFormatCtx->streams[i]->time_base; |
- | |
165 | if(stream_duration == 0) |
- | |
166 | // stream_duration = 1000.0 * |
- | |
167 | // pFormatCtx->streams[i]->duration * |
158 | video_time_base = pFormatCtx->streams[i]->time_base; |
Line 168... | Line 159... | ||
168 | // av_q2d(pFormatCtx->streams[i]->time_base); |
159 | if(stream_duration == 0) |
169 | stream_duration = pFormatCtx->streams[i]->duration; |
160 | stream_duration = pFormatCtx->streams[i]->duration; |
170 | 161 | ||
171 | } |
162 | } |
172 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO && |
163 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO && |
173 | audioStream < 0) |
164 | audioStream < 0) |
174 | { |
- | |
175 | audioStream=i; |
- | |
176 | if(stream_duration == 0) |
- | |
177 | // stream_duration = 1000.0 * |
165 | { |
178 | // pFormatCtx->streams[i]->duration * |
- | |
179 | // av_q2d(pFormatCtx->streams[i]->time_base); |
166 | audioStream=i; |
180 | stream_duration = pFormatCtx->streams[i]->duration; |
167 | if(stream_duration == 0) |
Line 181... | Line 168... | ||
181 | 168 | stream_duration = pFormatCtx->streams[i]->duration; |
|
182 | } |
169 | } |
Line 357... | Line 344... | ||
357 | { |
344 | { |
358 | int err = 0; |
345 | int err = 0; |
359 | AVPacket packet; |
346 | AVPacket packet; |
360 | 347 | ||
Line 361... | Line -... | ||
361 | // __asm__ __volatile__("int3"); |
- | |
362 | - | ||
363 | while( (q_video.size < 4*1024*1024) && |
348 | while( (q_video.size < 4*1024*1024) && |
364 | !err ) |
349 | !err ) |
365 | err = load_frame(); |
350 | err = load_frame(); |
Line 366... | Line 351... | ||
366 | 351 | ||
Line 397... | Line 382... | ||
397 | while( player_state != CLOSED ) |
382 | while( player_state != CLOSED ) |
398 | { |
383 | { |
399 | int err; |
384 | int err; |
Line 400... | Line -... | ||
400 | - | ||
401 | // __asm__ __volatile__("int3"); |
- | |
402 | 385 | ||
403 | switch(decoder_state) |
386 | switch(decoder_state) |
404 | { |
387 | { |
405 | case PREPARE: |
388 | case PREPARE: |
Line 496... | Line 479... | ||
496 | 479 | ||
Line 497... | Line 480... | ||
497 | ret = avformat_seek_file(pFormatCtx, -1, INT64_MIN, |
480 | ret = avformat_seek_file(pFormatCtx, -1, INT64_MIN, |
498 | rewind_pos, INT64_MAX, 0); |
481 | rewind_pos, INT64_MAX, 0); |
Line 499... | Line -... | ||
499 | - | ||
500 | // ret = avformat_seek_file(pFormatCtx, -1, min_pos, |
- | |
501 | // rewind_pos, max_pos, opts); |
- | |
502 | // __asm__ __volatile__("int3"); |
- | |
503 | 482 | ||
504 | if (ret < 0) |
483 | if (ret < 0) |
505 | { |
484 | { |
506 | printf("could not seek to position %f\n", |
485 | printf("could not seek to position %f\n", |
507 | (double)rewind_pos / AV_TIME_BASE); |
486 | (double)rewind_pos / AV_TIME_BASE); |