Ticket #1043: mythdvd_v5.patch

File mythdvd_v5.patch, 24.9 KB (added by skamithi@…, 20 years ago)

v5 patch. includes mpeg12.c patch and posted patches that are not committed. some patch cleanup as well.

  • libs/libmythtv/NuppelVideoPlayer.h

     
    319319    void ActivateDVDButton(void);
    320320    void GoToDVDMenu(QString str);
    321321    void GoToDVDProgram(bool direction);
     322    void HideDVDButton(bool hide) { hidedvdbutton = hide; }
    322323
    323324  protected:
    324325    void DisplayPauseFrame(void);
     
    666667
    667668    // DVD
    668669    bool indvdstillframe;
     670    bool hidedvdbutton;
    669671
    670672    // Debugging variables
    671673    Jitterometer *output_jmeter;
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    175175      // LiveTVChain stuff
    176176      livetvchain(NULL), m_tv(NULL),
    177177      // DVD stuff
    178       indvdstillframe(false),
     178      indvdstillframe(false), hidedvdbutton(true),
    179179      // Debugging variables
    180180      output_jmeter(NULL)
    181181{
     
    509509
    510510    ClearAfterSeek();
    511511
    512     if (ringBuffer->InDVDMenuOrStillFrame())
     512    if (ringBuffer->isDVD())
    513513        ringBuffer->Seek(ringBuffer->DVD()->GetCellStartPos(), SEEK_SET);
    514514}
    515515
     
    19541954    video_actually_paused = false;
    19551955    resetvideo = false;
    19561956
    1957     if (!ringBuffer->isDVD())
     1957    if (!ringBuffer->InDVDMenuOrStillFrame())
    19581958    {
    19591959        if (!PrebufferEnoughFrames())
    19601960            return;
     
    21042104                if (ringBuffer->DVD()->IsWaiting())
    21052105                {
    21062106                    ringBuffer->DVD()->WaitSkip();
    2107                     usleep(100000);
    21082107                    continue;
    21092108                }
     2109               
    21102110                if (ringBuffer->InDVDMenuOrStillFrame())
    21112111                {
    21122112                    if (nbframes == 0)
    21132113                    {
    2114                         // wait to confirm there is no other frames been decoded.
    2115                         usleep(100000);
    2116                         nbframes = videoOutput->ValidVideoFrames();
    2117                         if (nbframes == 0)
    2118                         {
    2119                             ringBuffer->Seek(ringBuffer->DVD()->GetCellStartPos(),SEEK_SET);
    2120                             continue;
    2121                         }
     2114                        if (pausevideo)
     2115                            UnpauseVideo();
     2116                        continue;
    21222117                    }
    2123                     indvdstillframe = true;
    21242118                    if (!pausevideo && nbframes == 1)
     2119                    {
     2120                        indvdstillframe = true;
    21252121                        PauseVideo(false);
     2122                    }
    21262123                }
    21272124            }
    21282125
    2129             // restart playing after skipping still frame
    21302126            if (indvdstillframe && nbframes > 1)
    21312127            {
    21322128                UnpauseVideo();
    21332129                indvdstillframe = false;
     2130                continue;
    21342131            }
    21352132        }
    21362133
     
    29252922
    29262923    int samples = len / samplesize;
    29272924
    2928     if (ringBuffer->isDVD())
     2925    if (ringBuffer->InDVDMenuOrStillFrame())
    29292926    {
    29302927        audioOutput->Pause(false);
    29312928        audioOutput->Drain();
    2932     }
     2929    } 
    29332930
    29342931    // If there is no warping, just send it to the audioOutput.
    29352932    if (!usevideotimebase)
     
    53215318    if (!ringBuffer->InDVDMenuOrStillFrame())
    53225319        return;
    53235320
    5324     long long spupts = ringBuffer->DVD()->MenuSpuPts();
    5325     long long ptslow = spupts - 1000;
    5326     long long ptshigh = spupts + 1000;
    53275321    VideoFrame *buffer = videoOutput->GetLastShownFrame();
    5328 
    5329     if (!osd->IsSetDisplaying("subtitles") &&
    5330         (buffer->timecode > 0) &&
    5331         ((buffer->timecode < ptslow) ||
    5332          (buffer->timecode > ptshigh)))
     5322    int numbuttons = ringBuffer->DVD()->NumMenuButtons();
     5323    bool osdshown = osd->IsSetDisplaying("subtitles");
     5324    long long menupktpts = ringBuffer->DVD()->GetMenuPktPts();
     5325   
     5326    if ((numbuttons == 0) ||
     5327            (osdshown) ||
     5328            ((!osdshown) && (hidedvdbutton) &&
     5329             (buffer->timecode > 0) && (menupktpts != buffer->timecode)))
    53335330    {
    5334         return; 
     5331        return;
    53355332    }
    53365333
     5334    hidedvdbutton = false;
    53375335    AVSubtitleRect *highlightButton;
    53385336    OSDSet *subtitleOSD = NULL;
    53395337    highlightButton = ringBuffer->DVD()->GetMenuButton();
     
    53835381    if (!ringBuffer->isDVD())
    53845382        return;
    53855383
    5386     if (videoOutput->ValidVideoFrames() > 20)
    5387         DiscardVideoFrames(true);
    53885384    ringBuffer->DVD()->ActivateButton();
    5389     ringBuffer->DVD()->HideMenuButton(true);
    53905385}
    53915386
    53925387void NuppelVideoPlayer::GoToDVDMenu(QString str)
     
    53945389    if (!ringBuffer->isDVD())
    53955390        return;
    53965391
    5397     if (videoOutput->ValidVideoFrames() > 20)
    5398         DiscardVideoFrames(true);
     5392    subtitlesOn = false;
    53995393    ringBuffer->DVD()->GoToMenu(str);
    54005394}
    54015395
     
    54065400{
    54075401    if (!ringBuffer->isDVD())
    54085402        return;
    5409  
    5410     if (videoOutput->ValidVideoFrames() > 20)
    5411         DiscardVideoFrames(true);
     5403
    54125404    if (direction == 0)
    54135405        ringBuffer->DVD()->GoToPreviousProgram();
    54145406    else
  • libs/libmythtv/DVDRingBuffer.h

     
    4545    bool InStillFrame(void) { return cellHasStillFrame; }
    4646    bool IsWaiting(void) { return dvdWaiting; }
    4747    int    NumPartsInTitle(void) { return titleParts; }
    48     void GetMenuSPUPkt(uint8_t *buf, int buf_size,long long pts);
     48    void GetMenuSPUPkt(uint8_t *buf, int len, int stream_id);
    4949    AVSubtitleRect *GetMenuButton(void);
    5050    bool IgnoringStillorWait(void) { return skipstillorwait; }
    51     long long GetCellStartPos(void) { return cellstartPos; }
    52     void HideMenuButton(bool hide);
     51    long long GetCellStartPos(void);
    5352    uint ButtonPosX(void) { return hl_startx; }
    5453    uint ButtonPosY(void) { return hl_starty; }
    5554    uint GetAudioLanguage(int id);
    5655    uint GetSubtitleLanguage(int id);
    57     long long MenuSpuPts(void) { return menuspupts; }
    58 
     56    void SetMenuPktPts(long long pts) { menupktpts = pts; }
     57    long long GetMenuPktPts(void) { return menupktpts; }
     58   
    5959    // commands
    6060    bool OpenFile(const QString &filename);
    6161    void close(void);
     
    7676    int NumMenuButtons(void);
    7777    void IgnoreStillOrWait(bool skip) { skipstillorwait = skip; }
    7878    uint GetCurrentTime(void);
     79    int  SelectedAudioTrack(void);
     80    uint8_t GetNumAudioChannels(int id);
    7981   
    8082    void SetParent(NuppelVideoPlayer *p) { parent = p; }
    8183   
     
    111113    int            menuBuflength;
    112114    uint8_t       *buttonBitmap;
    113115    AVSubtitleRect *dvdMenuButton;
    114     int            buttonCoords;
    115116    bool           skipstillorwait;
    116117    bool           spuStreamLetterbox;
    117118    long long      cellstartPos;
    118119    bool           buttonSelected;
    119120    bool           buttonExists;
    120     long long      menuspupts;
    121 
     121    int            cellid;
     122    int            lastcellid;
     123    int            vobid;
     124    int            lastvobid;
     125    bool           cellRepeated;
     126    int            buttonstreamid;
     127    bool           gotoCellStart;
     128    long long      menupktpts;
     129   
    122130    NuppelVideoPlayer *parent;
    123131
    124132    bool DrawMenuButton(uint8_t *spu_pkt, int buf_size);
     
    126134    void ClearMenuSPUParameters(void);
    127135    bool MenuButtonChanged(void);
    128136    uint ConvertLangCode(uint16_t code); // converts 2char key to 3char key
     137    void SelectDefaultButton(void);
     138    void ClearSubtitlesOSD(void);
    129139   
    130140    /* copied from dvdsub.c from ffmpeg */
    131141    int get_nibble(const uint8_t *buf, int nibble_offset);
  • libs/libmythtv/avformatdecoder.cpp

     
    278278      // language preference
    279279      languagePreference(iso639_get_language_key_list()),
    280280      // DVD
    281       lastdvdtitle(0)
     281      lastdvdtitle(0), dvdmenupktseen(false)
    282282{
    283283    bzero(&params, sizeof(AVFormatParameters));
    284284    bzero(prvpkt, 3 * sizeof(char));
     
    431431void AvFormatDecoder::SeekReset(long long newKey, uint skipFrames,
    432432                                bool doflush, bool discardFrames)
    433433{
    434     if (ringBuffer->isDVD())
    435     {
    436         int totaltime = ringBuffer->DVD()->GetTotalTimeOfTitle();
    437         if (totaltime < 30 || ringBuffer->InDVDMenuOrStillFrame())
    438             return;
    439     }
    440 
     434    if (ringBuffer->InDVDMenuOrStillFrame())
     435        return;
     436   
    441437    VERBOSE(VB_PLAYBACK, LOC +
    442438            QString("SeekReset(%1, %2, %3 flush, %4 discard)")
    443439            .arg(newKey).arg(skipFrames)
     
    11941190                lang_indx = lang_sub_cnt[lang];
    11951191                lang_sub_cnt[lang]++;
    11961192            }
    1197             subtitleStreams.push_back(StreamInfo(i, lang, lang_indx));
     1193            subtitleStreams.push_back(StreamInfo(i, lang, lang_indx,ic->streams[i]->id));
    11981194
    11991195            VERBOSE(VB_PLAYBACK, LOC + QString(
    12001196                        "Subtitle track #%1 is A/V stream #%2 "
     
    12131209                lang_indx = lang_aud_cnt[lang];
    12141210                lang_aud_cnt[lang]++;
    12151211            }
    1216             audioStreams.push_back(StreamInfo(i, lang, lang_indx));
    1217 
     1212            audioStreams.push_back(StreamInfo(i, lang, lang_indx,ic->streams[i]->id));
    12181213            VERBOSE(VB_AUDIO, LOC + QString(
    12191214                        "Audio Track #%1 is A/V stream #%2 "
    12201215                        "and has %3 channels in the %4 language(%5).")
     
    12351230    currentAudioTrack = -1;
    12361231    currentSubtitleTrack = -1;
    12371232
     1233    if (ringBuffer->isDVD())
     1234    {
     1235        if (audioStreams.size() > 1)
     1236        {
     1237            qBubbleSort(audioStreams);
     1238            setCurrentAudioTrack(ringBuffer->DVD()->SelectedAudioTrack());
     1239        }
     1240        if (subtitleStreams.size() > 1)
     1241            qBubbleSort(subtitleStreams);
     1242    }
     1243
    12381244    // We have to do this here to avoid the NVP getting stuck
    12391245    // waiting on audio.
    12401246    if (GetNVP()->HasAudioIn() && audioStreams.empty())
     
    19141920            else
    19151921                msg += QString(" %1").arg(s->codec->codec->name).upper();
    19161922
    1917             if (!s->codec->channels)
    1918                 msg += QString(" ?ch");
    1919             else if ((s->codec->channels > 4) && !(s->codec->channels & 1))
    1920                 msg += QString(" %1.1ch").arg(s->codec->channels - 1);
     1923            int channels = 0;
     1924            if (ringBuffer->isDVD())
     1925                channels = ringBuffer->DVD()->GetNumAudioChannels(i);
     1926            else if (s->codec->channels)
     1927                channels = s->codec->channels;
     1928
     1929            if (channels == 0)
     1930                msg+= QString(" ?ch");
     1931            else if((channels > 4) && !(channels & 1))
     1932                msg += QString(" %1.1ch").arg(channels - 1);
    19211933            else
    1922                 msg += QString(" %1ch").arg(s->codec->channels);
    1923         }
     1934                msg += QString(" %1ch").arg(channels);
     1935        }   
    19241936        list += QString("%1: %2").arg(i+1).arg(msg);
    19251937    }
    19261938
     
    23012313                VERBOSE(VB_PLAYBACK,
    23022314                    QString(LOC + "DVD Title Changed. Update framesPlayed: %1 ")
    23032315                            .arg(framesPlayed));
     2316                setCurrentAudioTrack(ringBuffer->DVD()->SelectedAudioTrack());
    23042317            }
    23052318            lastdvdtitle = dvdtitle;
    23062319           
     
    23132326        if (gotvideo)
    23142327        {
    23152328            if (lowbuffers && onlyvideo == 0 && lastapts < lastvpts + 100 &&
    2316                 lastapts > lastvpts - 10000 && !ringBuffer->isDVD())
     2329                lastapts > lastvpts - 10000 && !ringBuffer->InDVDMenuOrStillFrame())
    23172330            {
    23182331                //cout << "behind: " << lastapts << " " << lastvpts << endl;
    23192332                storevideoframes = true;
     
    23252338            }
    23262339        }
    23272340
    2328         if (ringBuffer->isDVD() && ringBuffer->DVD()->InStillFrame() &&
    2329                 storedPackets.count() > 0)
     2341        if (ringBuffer->isDVD() &&
     2342                ringBuffer->DVD()->InStillFrame())
    23302343        {
    23312344            storevideoframes = false;
    23322345            dvdvideopause = true;
     
    27202733                    gotvideo = 1;
    27212734                    framesPlayed++;
    27222735
     2736                    if (dvdmenupktseen)
     2737                    {
     2738                        ringBuffer->DVD()->SetMenuPktPts(pts);
     2739                        dvdmenupktseen = false;
     2740                    }
     2741
    27232742                    lastvpts = temppts;
    27242743                    break;
    27252744                }
     
    27292748                    AVSubtitle subtitle;
    27302749
    27312750                    if (ringBuffer->isDVD() && ringBuffer->DVD()->IsInMenu())
    2732                         ringBuffer->DVD()->GetMenuSPUPkt(ptr,len,pts);
     2751                    {
     2752                        dvdmenupktseen = true;
     2753                        ringBuffer->DVD()->GetMenuSPUPkt(ptr,len,curstream->id);
     2754                    }
    27332755                    else if (pkt->stream_index == subIdx)
    27342756                    {
    27352757                        QMutexLocker locker(&avcodeclock);
  • libs/libmythtv/tv_play.cpp

     
    23112311            if (prbuffer->isDVD())
    23122312            {
    23132313                if (prbuffer->InDVDMenuOrStillFrame())
    2314                     UpdateOSDSeekMessage(tr("Skipping Back Not Allowed"),
     2314                    UpdateOSDSeekMessage(tr("Skip Back Not Allowed"),
    23152315                                         osd_general_timeout);
    23162316                else if (prbuffer->DVD()->NumPartsInTitle() < 2)
    23172317                {
  • libs/libmythtv/DVDRingBuffer.cpp

     
    3030      title(0),         gotStop(false),
    3131      cellHasStillFrame(false), dvdWaiting(false),
    3232      titleLength(0),  spuchanged(false),
    33       menuBuflength(0),  buttonCoords(0),
    34       skipstillorwait(true), spuStreamLetterbox(false),
     33      menuBuflength(0), skipstillorwait(true),
     34      spuStreamLetterbox(false),
    3535      cellstartPos(0), buttonSelected(false),
    36       buttonExists(false), menuspupts(0),
    37       parent(0)
     36      buttonExists(false), cellid(0),
     37      lastcellid(0), vobid(0),
     38      lastvobid(0), cellRepeated(false),
     39      buttonstreamid(0), gotoCellStart(false),
     40      menupktpts(0), parent(0)
    3841{
    3942    dvdMenuButton = (AVSubtitleRect*)av_mallocz(sizeof(AVSubtitleRect));
    4043}
     
    119122            {
    120123                dvdnav_get_number_of_parts(dvdnav, curTitle, &titleParts);
    121124                VERBOSE(VB_IMPORTANT,
    122                         QString("There are title %1 has %2 parts.")
     125                        QString("Title %1 has %2 parts.")
    123126                        .arg(curTitle).arg(titleParts));
    124127            }
    125128        }
     
    222225                dvdnav_get_position(dvdnav, &pos, &length);
    223226                titleLength = length *DVD_BLOCK_SIZE;
    224227                cellstartPos = GetReadPosition();
    225                 buttonSelected = false;
    226 
    227                 if (parent && parent->GetOSD())
     228                buttonSelected = false;
     229                if (gotoCellStart)
    228230                {
    229                     parent->GetOSD()->HideSet("subtitles");
    230                     parent->GetOSD()->ClearAll("subtitles");
     231                    lastvobid = lastcellid = 0;
     232                    gotoCellStart = false;
    231233                }
     234                else
     235                {
     236                    lastvobid = vobid;
     237                    lastcellid = cellid;
     238                }
     239                vobid = 0;
     240                cellid = 0;
     241                cellRepeated = false;
     242                menupktpts = 0;
     243               
     244                if (parent)
     245                   parent->HideDVDButton(true);
    232246
    233247                if (blockBuf != dvdBlockWriteBuf)
    234248                {
     
    259273                    spuStreamLetterbox = false;
    260274                spuchanged = true;
    261275                ClearMenuSPUParameters();
    262 
     276                ClearSubtitlesOSD();
     277               
    263278                if (blockBuf != dvdBlockWriteBuf)
    264279                {
    265280                    dvdnav_free_cache_block(dvdnav, blockBuf);
     
    284299            case DVDNAV_NAV_PACKET:
    285300            {
    286301                lastNav = (dvdnav_t *)blockBuf;
    287                 if (IsInMenu() && NumMenuButtons() > 0 &&
    288                         !buttonSelected)
     302                if (vobid == 0 && cellid == 0)
    289303                {
    290                     pci_t *pci = dvdnav_get_current_nav_pci(dvdnav);
    291 
    292                     uint8_t button = pci->hli.hl_gi.fosl_btnn;
    293                     if (button > 0)
    294                         dvdnav_button_select(dvdnav,pci,button);
    295                     else
    296                         dvdnav_button_select(dvdnav,pci,1);
    297 
    298                     buttonSelected = true;
    299                     spuchanged = false;
     304                    dsi_t *dsi = dvdnav_get_current_nav_dsi(dvdnav);
     305                    vobid  = dsi->dsi_gi.vobu_vob_idn;
     306                    cellid = dsi->dsi_gi.vobu_c_idn;
     307                    if ((lastvobid == vobid) && (lastcellid == cellid)
     308                            && IsInMenu())
     309                    {
     310                        cellRepeated = true;
     311                    }
    300312                }
    301313                if (blockBuf != dvdBlockWriteBuf)
    302314                {
     
    348360
    349361                if (DVDButtonUpdate(false))
    350362                    buttonExists = DrawMenuButton(menuSpuPkt,menuBuflength);
    351 
     363                ClearSubtitlesOSD();
    352364                if (blockBuf != dvdBlockWriteBuf)
    353365                {
    354366                    dvdnav_free_cache_block(dvdnav, blockBuf);
     
    521533    }
    522534}
    523535
    524 void DVDRingBufferPriv::GetMenuSPUPkt(uint8_t *buf, int buf_size,long long pts)
    525 {   
     536void DVDRingBufferPriv::GetMenuSPUPkt(uint8_t *buf, int buf_size, int stream_id)
     537{
    526538    if (buf_size < 4)
    527539        return;
    528540
    529     menuspupts = pts;   
    530     if (buf_size == menuBuflength)
     541
     542    if ((buttonstreamid < stream_id) &&
     543        (buttonstreamid > 0))
    531544        return;
    532     else if (spuStreamLetterbox)
    533     {
    534         if ((buf_size < menuBuflength) && menuBuflength > 0)
    535             return;
    536     }
    537     else
    538     {
    539         if ((buf_size > menuBuflength) && (menuBuflength > 0))
    540             return;
    541     }
     545   
     546    buttonstreamid = stream_id;
    542547    ClearMenuSPUParameters();
    543548    uint8_t *spu_pkt;
    544549    spu_pkt = (uint8_t*)av_malloc(buf_size);
    545550    memcpy(spu_pkt, buf, buf_size);
    546551    menuSpuPkt = spu_pkt;
    547552    menuBuflength = buf_size;
    548     buttonCoords = 0;
     553    if (!buttonSelected)
     554    {
     555        SelectDefaultButton();
     556        buttonSelected = true;
     557        spuchanged = false;
     558    }
    549559    if (DVDButtonUpdate(false))
    550560        buttonExists = DrawMenuButton(menuSpuPkt,menuBuflength);
     561   
    551562}
    552563
    553564AVSubtitleRect *DVDRingBufferPriv::GetMenuButton(void)
    554565{
    555     if (MenuButtonChanged() && buttonExists)
     566    if ((menuBuflength > 4) && buttonExists)
    556567        return dvdMenuButton;
    557568
    558569    return NULL;
     
    684695
    685696bool DVDRingBufferPriv::DVDButtonUpdate(bool b_mode)
    686697{
     698    if (!parent)
     699        return false;
     700    int videoheight = parent->GetVideoHeight();
     701    int videowidth = parent->GetVideoWidth();
    687702    int32_t button;
    688703    pci_t *pci;
    689704    dvdnav_highlight_area_t hl;
     
    702717    hl_starty = hl.sy;
    703718    hl_height  = hl.ey - hl.sy;
    704719
    705     int total_start_pos = hl.sx + hl.sy;
    706     if ( total_start_pos == 0 || total_start_pos > (720 + 576 ))
    707         return false;
     720    if (((hl.sx + hl.sy) > 0) &&
     721            (hl.sx < videowidth && hl.sy < videoheight))
     722        return true;
    708723
    709     return true;
     724    return false;
    710725}
    711726
    712727void DVDRingBufferPriv::ClearMenuSPUParameters(void)
     
    727742    dvdMenuButton->y = 0;
    728743    hl_startx = hl_starty = 0;
    729744    hl_width = hl_height = 0;
    730     buttonCoords = (720+480+100);
    731745}
    732746
    733 bool DVDRingBufferPriv::MenuButtonChanged(void)
    734 {
    735     if (menuBuflength < 4 || buttonCoords > (720+576))
    736         return false;
    737 
    738     int x = hl_startx;
    739     int y = hl_starty;
    740     if (buttonCoords != (x+y))
    741     {
    742         buttonCoords = (x+y);
    743         return true;
    744     }
    745     return false;
    746 }
    747 
    748747int DVDRingBufferPriv::NumMenuButtons(void)
    749748{
    750749    pci_t *pci = dvdnav_get_current_nav_pci(dvdnav);
     
    755754        return 0;
    756755}
    757756
    758 void DVDRingBufferPriv::HideMenuButton(bool hide)
    759 {
    760     if (hide)
    761         buttonCoords = (720+480+100);
    762     else
    763         buttonCoords = 0;
    764 }
    765 
    766757uint DVDRingBufferPriv::GetCurrentTime(void)
    767758{
    768759    // Macro to convert Binary Coded Decimal to Decimal
     
    778769    return currentTime;
    779770}
    780771
     772long long DVDRingBufferPriv::GetCellStartPos(void)
     773{
     774    gotoCellStart = true;
     775    return cellstartPos;
     776}
     777
    781778uint DVDRingBufferPriv::GetAudioLanguage(int id)
    782779{
    783780    int8_t channel = dvdnav_get_audio_logical_stream(dvdnav,id);
     
    810807    return 0;
    811808}
    812809
     810void DVDRingBufferPriv::SelectDefaultButton(void)
     811{
     812    pci_t *pci = dvdnav_get_current_nav_pci(dvdnav);
     813    int button = pci->hli.hl_gi.fosl_btnn;
     814    if (button > 0 && !cellRepeated)
     815    {
     816        dvdnav_button_select(dvdnav,pci,button);
     817        return;
     818    }
     819    dvdnav_get_current_highlight(dvdnav,&button);
     820    if (button > 0 && button <= NumMenuButtons())
     821        dvdnav_button_select(dvdnav,pci,button);
     822    else
     823        dvdnav_button_select(dvdnav,pci,1);   
     824}
     825
     826int DVDRingBufferPriv::SelectedAudioTrack(void)
     827{
     828    return dvdnav_get_active_audio_stream(dvdnav);
     829}
     830
     831uint8_t DVDRingBufferPriv::GetNumAudioChannels(int id)
     832{
     833    unsigned char channels = dvdnav_audio_get_channels(dvdnav,id);
     834    if (channels == 0xff)
     835        return 0;
     836   return (uint8_t)channels + 1;
     837}
     838
     839void DVDRingBufferPriv::ClearSubtitlesOSD(void)
     840{
     841    if (parent && parent->GetOSD())
     842    {
     843        parent->GetOSD()->HideSet("subtitles");
     844        parent->GetOSD()->ClearAll("subtitles");
     845    }
     846}
     847
    813848void DVDRingBufferPriv::guess_palette(uint32_t *rgba_palette,uint8_t *palette,
    814849                                        uint8_t *alpha)
    815850{
  • libs/libmythtv/avformatdecoder.h

     
    2727{
    2828  public:
    2929    StreamInfo() : av_stream_index(-1), language(-2), language_index(0) {}
    30     StreamInfo(int a, int b, uint c)
    31         : av_stream_index(a), language(b), language_index(c) {}
     30    StreamInfo(int a, int b, uint c, int d)
     31        : av_stream_index(a), language(b), language_index(c), stream_id(d) {}
    3232  public:
    3333    int  av_stream_index;
    3434    int  language; ///< ISO639 canonical language key
    3535    uint language_index;
     36    int  stream_id;
     37    bool operator<(const StreamInfo& b) { return (this->stream_id < b.stream_id) ; }
    3638};
    3739typedef vector<StreamInfo> sinfo_vec_t;
    3840
     
    266268
    267269    // DVD
    268270    int lastdvdtitle;
     271    bool dvdmenupktseen;
    269272};
    270273
    271274#endif
  • libs/libavcodec/mpeg12.c

     
    30333033        }
    30343034    }
    30353035
     3036    /* look for SEQ_END_CODE at the last data in this buffer*/
     3037    /* dvd's won't send the next frame start on still images*/
     3038    /* state should hold the last startcode if one was found above*/
     3039    /* i will point to the position after that startcode */
     3040    if(!pc->frame_start_found){
     3041        if(state == SEQ_END_CODE){
     3042            pc->state=-1;
     3043            return i;
     3044        }
     3045    }
     3046   
    30363047    if(pc->frame_start_found){
    30373048        /* EOF considered as end of frame */
    30383049        if (buf_size == 0)
  • libs/libmythdvdnav/dvdnav.c

     
    877877  return attr.lang_code;
    878878}
    879879
     880unsigned char dvdnav_audio_get_channels(dvdnav_t *this, uint8_t stream){
     881  audio_attr_t  attr;
     882
     883  if(!this) {
     884    printerr("Passed a NULL pointer.");
     885    return 0xff;
     886  }
     887  if(!this->started) {
     888    printerr("Virtual DVD machine not started.");
     889    return 0xff;
     890  }
     891
     892  pthread_mutex_lock(&this->vm_lock);
     893  attr = vm_get_audio_attr(this->vm, stream);
     894  pthread_mutex_unlock(&this->vm_lock);
     895
     896  return attr.channels;
     897             
     898}
     899
    880900uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *this, uint8_t stream) {
    881901  subp_attr_t  attr;
    882902 
  • libs/libmythdvdnav/dvdnav.h

     
    550550uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *self, uint8_t stream);
    551551
    552552/*
     553 * Get number of audio channels.
     554 * (1 -> 2 channels , 5 -> 6 channels)
     555 * (returns 0xff if no such stream).
     556 */
     557unsigned char dvdnav_audio_get_channels(dvdnav_t *self, uint8_t stream);
     558
     559/*
    553560 * Converts a *logical* subpicture stream id into country code
    554561 * (returns 0xffff if no such stream).
    555562 */