Ticket #7640: dvdnav_set_active_audio_stream.patch

File dvdnav_set_active_audio_stream.patch, 3.4 KB (added by skamithi, 2 years ago)

you go to the DVD menu and then back to the movie, the audio track would get reset to the internal dvdnav vm's default. this path from martin kittel keeps it at the audio track you selected from the osd.

  • mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c

    commit d88751e1242d0d59861f9d14660de22db78f0be8
    Author: Martin Kittel <martin@egon.zuhause.de>
    Date:   Mon Dec 21 21:13:07 2009 +0100
    
        DVD: pass down new audio stream number to dvdnav vm when changing audio stream via osd
    
    diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c
    index c03c78b..df4039e 100644
    a b int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) { 
    10611061  return retval; 
    10621062} 
    10631063 
     1064int8_t dvdnav_set_active_audio_stream(dvdnav_t *this, int8_t stream) { 
     1065  int8_t        retval; 
     1066 
     1067  if(!this->started) { 
     1068    printerr("Virtual DVD machine not started."); 
     1069    return -1; 
     1070  } 
     1071 
     1072  pthread_mutex_lock(&this->vm_lock); 
     1073  if (!this->vm->state.pgc) { 
     1074    printerr("No current PGC."); 
     1075    pthread_mutex_unlock(&this->vm_lock); 
     1076    return -1; 
     1077  } 
     1078 
     1079  retval = vm_set_audio_active_stream(this->vm, stream); 
     1080  pthread_mutex_unlock(&this->vm_lock); 
     1081 
     1082  return retval; 
     1083} 
     1084 
    10641085int8_t dvdnav_get_active_spu_stream(dvdnav_t *this) { 
    10651086  int8_t        retval; 
    10661087 
  • mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h

    diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
    index f183d4d..1e4c825 100644
    a b dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *self, uint8_t audio_mum, subp_attr 
    627627int8_t dvdnav_get_active_audio_stream(dvdnav_t *self); 
    628628 
    629629/* 
     630 * Set active audio stream 
     631 */ 
     632int8_t dvdnav_set_active_audio_stream(dvdnav_t *self, int8_t stream); 
     633 
     634/* 
    630635 * Get active spu stream. 
    631636 */ 
    632637int8_t dvdnav_get_active_spu_stream(dvdnav_t *self); 
  • mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c

    diff --git a/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c b/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
    index 15448a0..c8f25eb 100644
    a b int vm_get_audio_active_stream(vm_t *vm) { 
    775775  return streamN; 
    776776} 
    777777 
     778int vm_set_audio_active_stream(vm_t *vm, int audioN) { 
     779 
     780    if (audioN >= 8) 
     781      return -1; 
     782 
     783    /* verify that stream exists */ 
     784    if(! (vm->state).pgc->audio_control[audioN] & (1<<15)) 
     785        return -1; 
     786 
     787    (vm->state).AST_REG = audioN; 
     788    return 0; 
     789} 
     790 
    778791int vm_get_subp_active_stream(vm_t *vm, int mode) { 
    779792  int subpN; 
    780793  int streamN; 
  • mythtv/libs/libmythdvdnav/dvdnav/vm/vm.h

    diff --git a/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.h b/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.h
    index 9edcff8..c015596 100644
    a b int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); 
    153153int vm_get_audio_stream(vm_t *vm, int audioN); 
    154154int vm_get_subp_stream(vm_t *vm, int subpN, int mode); 
    155155int vm_get_audio_active_stream(vm_t *vm); 
     156int vm_set_audio_active_stream(vm_t *vm, int audioN); 
    156157int vm_get_subp_active_stream(vm_t *vm, int mode); 
    157158void vm_get_angle_info(vm_t *vm, int *current, int *num_avail); 
    158159#if 0 
  • mythtv/libs/libmythtv/DVDRingBuffer.cpp

    diff --git a/mythtv/libs/libmythtv/DVDRingBuffer.cpp b/mythtv/libs/libmythtv/DVDRingBuffer.cpp
    index ec22f1a..30c66a6 100644
    a b void DVDRingBufferPriv::SetTrack(uint type, int trackNo) 
    11661166    { 
    11671167        m_curAudioTrack = trackNo; 
    11681168        m_autoselectaudio = false; 
     1169        dvdnav_set_active_audio_stream(m_dvdnav, trackNo); 
    11691170    } 
    11701171} 
    11711172