comparison avidec.c @ 980:da4296d3bc39 libavformat

add movi_list offset into index
author michael
date Wed, 01 Mar 2006 11:41:16 +0000
parents d2e5dfdf4def
children 55519fa957c3
comparison
equal deleted inserted replaced
979:d2e5dfdf4def 980:da4296d3bc39
465 i= av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY); 465 i= av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY);
466 466
467 // av_log(NULL, AV_LOG_DEBUG, "%d\n", i); 467 // av_log(NULL, AV_LOG_DEBUG, "%d\n", i);
468 if(i>=0){ 468 if(i>=0){
469 int64_t pos= best_st->index_entries[i].pos; 469 int64_t pos= best_st->index_entries[i].pos;
470 pos += avi->movi_list + best_ast->packet_size - best_ast->remaining; 470 pos += best_ast->packet_size - best_ast->remaining;
471 url_fseek(&s->pb, pos, SEEK_SET); 471 url_fseek(&s->pb, pos, SEEK_SET);
472 // av_log(NULL, AV_LOG_DEBUG, "pos=%Ld\n", pos); 472 // av_log(NULL, AV_LOG_DEBUG, "pos=%Ld\n", pos);
473 473
474 if(best_ast->remaining) 474 if(best_ast->remaining)
475 avi->stream_index= best_stream_index; 475 avi->stream_index= best_stream_index;
687 av_log(NULL, AV_LOG_DEBUG, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/", 687 av_log(NULL, AV_LOG_DEBUG, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
688 i, tag, flags, pos, len); 688 i, tag, flags, pos, len);
689 #endif 689 #endif
690 if(i==0 && pos > avi->movi_list) 690 if(i==0 && pos > avi->movi_list)
691 avi->movi_list= 0; //FIXME better check 691 avi->movi_list= 0; //FIXME better check
692 pos += avi->movi_list;
692 693
693 index = ((tag & 0xff) - '0') * 10; 694 index = ((tag & 0xff) - '0') * 10;
694 index += ((tag >> 8) & 0xff) - '0'; 695 index += ((tag >> 8) & 0xff) - '0';
695 if (index >= s->nb_streams) 696 if (index >= s->nb_streams)
696 continue; 697 continue;
836 } 837 }
837 838
838 if (avi->dv_demux) 839 if (avi->dv_demux)
839 dv_flush_audio_packets(avi->dv_demux); 840 dv_flush_audio_packets(avi->dv_demux);
840 /* do the seek */ 841 /* do the seek */
841 pos += avi->movi_list;
842 url_fseek(&s->pb, pos, SEEK_SET); 842 url_fseek(&s->pb, pos, SEEK_SET);
843 avi->stream_index= -1; 843 avi->stream_index= -1;
844 return 0; 844 return 0;
845 } 845 }
846 846