Ticket #4925: remove_audio_streams_v2.diff
File remove_audio_streams_v2.diff, 5.7 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
1443 1443 map<int,uint> lang_sub_cnt; 1444 1444 map<int,uint> lang_aud_cnt; 1445 1445 1446 if (ringBuffer->isDVD() && 1447 ringBuffer->DVD()->AudioStreamsChanged()) 1448 { 1449 ringBuffer->DVD()->AudioStreamsChanged(false); 1450 RemoveAudioStreams(); 1451 } 1452 1446 1453 for (uint i = 0; i < ic->nb_streams; i++) 1447 1454 { 1448 1455 AVCodecContext *enc = ic->streams[i]->codec; … … 1858 1865 { 1859 1866 GetNVP()->SetAudioParams(-1, -1, -1, false /* AC3/DTS pass-through */); 1860 1867 GetNVP()->ReinitAudio(); 1868 audioIn = AudioInfo(); 1861 1869 } 1862 1870 1863 1871 // if we don't have a video stream we still need to make sure some … … 1991 1999 else 1992 2000 i++; 1993 2001 } 1994 av_read_frame_flush(ic);1995 2002 } 1996 2003 1997 2004 void release_avf_buffer(struct AVCodecContext *c, AVFrame *pic) … … 3020 3027 if ((storedPackets.count() > 10 && !decodeStillFrame) || 3021 3028 decodeStillFrame) 3022 3029 { 3023 RemoveAudioStreams();3024 3030 storevideoframes = false; 3025 3031 dvdTitleChanged = false; 3026 ScanStreams(true);3027 3032 } 3028 3033 else 3029 3034 storevideoframes = true; -
libs/libmythtv/DVDRingBuffer.cpp
34 34 lastNav(NULL), part(0), 35 35 title(0), titleParts(0), 36 36 gotStop(false), 37 cellHasStillFrame(false), dvdWaiting(false), 37 cellHasStillFrame(false), audioStreamsChanged(false), 38 dvdWaiting(false), 38 39 titleLength(0), hl_startx(0), hl_width(0), 39 40 hl_starty(0), hl_height(0), 40 41 menuBuflength(0), … … 446 447 break; 447 448 } 448 449 } 450 451 audioStreamsChanged = true; 449 452 450 453 if (blockBuf != dvdBlockWriteBuf) 451 454 { -
libs/libmythtv/DVDRingBuffer.h
41 41 void GetPartAndTitle(int &_part, int &_title) const 42 42 { _part = part; _title = title; } 43 43 uint GetTotalTimeOfTitle(void); 44 uint GetChapterLength(void) { return pgLength / 90000; }44 uint GetChapterLength(void) const { return pgLength / 90000; } 45 45 uint GetCellStart(void); 46 bool InStillFrame(void) { return cellHasStillFrame; } 47 bool IsWaiting(void) { return dvdWaiting; } 48 int NumPartsInTitle(void) { return titleParts; } 46 bool InStillFrame(void) const { return cellHasStillFrame; } 47 bool AudioStreamsChanged(void) const { return audioStreamsChanged; } 48 bool IsWaiting(void) const { return dvdWaiting; } 49 int NumPartsInTitle(void) const { return titleParts; } 49 50 void GetMenuSPUPkt(uint8_t *buf, int len, int stream_id); 50 51 51 52 AVSubtitleRect *GetMenuButton(void); … … 97 98 int NumMenuButtons(void) const; 98 99 void IgnoreStillOrWait(bool skip) { skipstillorwait = skip; } 99 100 void InStillFrame(bool change) { cellHasStillFrame = change; } 101 void AudioStreamsChanged(bool change) { audioStreamsChanged = change; } 100 102 uint GetCurrentTime(void) { return (currentTime / 90000); } 101 103 uint TitleTimeLeft(void); 102 104 void SetTrack(uint type, int trackNo); … … 129 131 bool gotStop; 130 132 131 133 bool cellHasStillFrame; 134 bool audioStreamsChanged; 132 135 bool dvdWaiting; 133 136 long long titleLength; 134 137 MythTimer stillFrameTimer; -
libs/libavformat/utils.c
580 580 581 581 *pnum = 0; 582 582 *pden = 0; 583 584 if (!st || !st->codec) 585 return; 586 583 587 switch(st->codec->codec_type) { 584 588 case CODEC_TYPE_VIDEO: 585 589 if(st->time_base.num*1000LL > st->time_base.den){ … … 792 796 for(;;) { 793 797 /* select current input stream component */ 794 798 st = s->cur_st; 795 if (st ) {799 if (st && st->codec) { 796 800 if (!st->need_parsing || !st->parser) { 797 801 /* no parsing needed: we just output the packet as is */ 798 802 /* raw data support */ … … 867 871 s->cur_pkt.pos = startpos; 868 872 869 873 st = s->streams[s->cur_pkt.stream_index]; 870 if(st ->codec->debug & FF_DEBUG_PTS)874 if(st && st->codec && st->codec->debug & FF_DEBUG_PTS) 871 875 av_log(s, AV_LOG_DEBUG, "av_read_packet stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d\n", 872 876 s->cur_pkt.stream_index, 873 877 s->cur_pkt.pts, … … 877 881 s->cur_st = st; 878 882 s->cur_ptr = s->cur_pkt.data; 879 883 s->cur_len = s->cur_pkt.size; 880 if (st ->need_parsing && !st->parser) {884 if (st && st->need_parsing && !st->parser) { 881 885 st->parser = av_parser_init(st->codec->codec_id); 882 886 if (!st->parser) { 883 887 /* no parser available : just output the raw packets */ … … 892 896 } 893 897 } 894 898 } 895 if(st->codec ->debug & FF_DEBUG_PTS)899 if(st->codec && st->codec->debug & FF_DEBUG_PTS) 896 900 av_log(s, AV_LOG_DEBUG, "av_read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d\n", 897 901 pkt->stream_index, 898 902 pkt->pts,