Skip to content

Commit

Permalink
Select a correct audio/dolby track.
Browse files Browse the repository at this point in the history
  • Loading branch information
rofafor authored and pesintta committed Apr 4, 2018
1 parent fafe836 commit b1f79f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@ extern int device_read_audio_data(void *opaque, unsigned char *data, int size);
/// Set buffering mode for callback from codec
extern void device_set_mode(int mode);

/// Get Videotype from vdr for codec
/// Get Video/Audiotype from vdr for codec
extern int device_get_vtype();
extern int device_get_atype();
21 changes: 18 additions & 3 deletions vaapidevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2123,10 +2123,16 @@ int cVaapiDevice::DeviceGetVtype()

int cVaapiDevice::DeviceGetAtype()
{
if (!cDevice::IsPlayingVideo())
return -1;
eTrackType track = GetCurrentAudioTrack();

if (IS_AUDIO_TRACK(track)) {
return PatPmtParser()->Atype(int(track - ttAudioFirst));
}
else if (IS_DOLBY_TRACK(track)) {
return PatPmtParser()->Dtype(int(track - ttDolbyFirst));
}

return PatPmtParser()->Atype(0); // FIXME: is this always the stream that is being played
return -1;
}

void cVaapiDevice::DeviceSetMode(int mode)
Expand Down Expand Up @@ -2252,6 +2258,15 @@ extern "C" int device_get_vtype()
return MyDevice->DeviceGetVtype();
}

extern "C" int device_get_atype()
{
if (!MyDevice) {
return 0;
}

return MyDevice->DeviceGetAtype();
}

/**
** Call rgb to jpeg for C Plugin.
*/
Expand Down

0 comments on commit b1f79f7

Please sign in to comment.