Skip to content

Commit

Permalink
Merge branch 'master' into loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jehutting committed Dec 24, 2016
2 parents 401b015 + 12b472e commit d6f7321
Show file tree
Hide file tree
Showing 18 changed files with 2,338 additions and 324 deletions.
6 changes: 3 additions & 3 deletions KeyConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int convertStringToAction(string str_action)
if(str_action == "EXIT")
return KeyConfig::ACTION_EXIT;
if(str_action == "PAUSE")
return KeyConfig::ACTION_PAUSE;
return KeyConfig::ACTION_PLAYPAUSE;
if(str_action == "DECREASE_VOLUME")
return KeyConfig::ACTION_DECREASE_VOLUME;
if(str_action == "INCREASE_VOLUME")
Expand Down Expand Up @@ -116,8 +116,8 @@ map<int, int> KeyConfig::buildDefaultKeymap()
keymap['f'] = ACTION_INCREASE_SUBTITLE_DELAY;
keymap['q'] = ACTION_EXIT;
keymap[KEY_ESC] = ACTION_EXIT;
keymap['p'] = ACTION_PAUSE;
keymap[' '] = ACTION_PAUSE;
keymap['p'] = ACTION_PLAYPAUSE;
keymap[' '] = ACTION_PLAYPAUSE;
keymap['-'] = ACTION_DECREASE_VOLUME;
keymap['+'] = ACTION_INCREASE_VOLUME;
keymap['='] = ACTION_INCREASE_VOLUME;
Expand Down
6 changes: 4 additions & 2 deletions KeyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class KeyConfig
ACTION_DECREASE_SUBTITLE_DELAY = 13,
ACTION_INCREASE_SUBTITLE_DELAY = 14,
ACTION_EXIT = 15,
ACTION_PAUSE = 16,
ACTION_PLAYPAUSE = 16,
ACTION_DECREASE_VOLUME = 17,
ACTION_INCREASE_VOLUME = 18,
ACTION_SEEK_BACK_SMALL = 19,
Expand All @@ -40,7 +40,9 @@ class KeyConfig
ACTION_SHOW_SUBTITLES = 31,
ACTION_SET_ALPHA = 32,
ACTION_SET_ASPECT_MODE = 33,
ACTION_CROP_VIDEO = 34
ACTION_CROP_VIDEO = 34,
ACTION_PAUSE = 35,
ACTION_PLAY = 36,
};

#define KEY_LEFT 0x5b44
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ include Makefile.include

CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST

LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz
LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound

INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include

DIST ?= omxplayer-dist

SRC=linux/XMemUtils.cpp \
SRC= linux/XMemUtils.cpp \
linux/OMXAlsa.cpp \
utils/log.cpp \
DynamicDll.cpp \
utils/PCMRemap.cpp \
Expand Down
2 changes: 1 addition & 1 deletion Makefile.ffmpeg
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ clean:

.PHONY : checkout
checkout:
git clone git://source.ffmpeg.org/ffmpeg ffmpeg -b release/3.0 --depth=1
git clone git://source.ffmpeg.org/ffmpeg ffmpeg -b release/3.1 --depth=1

.PHONY : install
install:
Expand Down
7 changes: 6 additions & 1 deletion OMXAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ bool COMXAudio::PortSettingsChanged()
if(!m_omx_render_hdmi.Initialize("OMX.broadcom.audio_render", OMX_IndexParamAudioInit))
return false;
}
if (m_config.device == "omx:alsa")
{
if(!m_omx_render_analog.Initialize("OMX.alsa.audio_render", OMX_IndexParamAudioInit))
return false;
}

UpdateAttenuation();

Expand Down Expand Up @@ -235,7 +240,7 @@ bool COMXAudio::PortSettingsChanged()

OMX_CONFIG_BRCMAUDIODESTINATIONTYPE audioDest;
OMX_INIT_STRUCTURE(audioDest);
strncpy((char *)audioDest.sName, "local", strlen("local"));
strncpy((char *)audioDest.sName, m_config.device == "omx:alsa" ? m_config.subdevice.c_str() : "local", sizeof(audioDest.sName));
omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigBrcmAudioDestination, &audioDest);
if (omx_err != OMX_ErrorNone)
{
Expand Down
1 change: 1 addition & 0 deletions OMXAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class OMXAudioConfig
COMXStreamInfo hints;
bool use_thread;
CStdString device;
CStdString subdevice;
enum PCMLayout layout;
bool boostOnDownmix;
bool passthrough;
Expand Down
11 changes: 5 additions & 6 deletions OMXAudioCodecOMX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize, double dts, double pts)
if (!m_pCodecContext) return -1;

AVPacket avpkt;
if (!m_iBufferOutputUsed)
{
m_dts = dts;
m_pts = pts;
}
if (m_bGotFrame)
return 0;

Expand Down Expand Up @@ -194,12 +199,6 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize, double dts, double pts)
m_pFrame1->data[0], m_pFrame1->data[1], m_pFrame1->data[2], m_pFrame1->data[3], m_pFrame1->data[4], m_pFrame1->data[5], m_pFrame1->data[6], m_pFrame1->data[7]
);
}

if (!m_iBufferOutputUsed)
{
m_dts = dts;
m_pts = pts;
}
return iBytesUsed;
}

Expand Down
Loading

0 comments on commit d6f7321

Please sign in to comment.