Skip to content

Commit

Permalink
Merge pull request #900 from smartdevicelink/hotfix/fix_EXTENDED_MEDI…
Browse files Browse the repository at this point in the history
…A_MODE

Fix EXTENDED_MEDIA_MODE build and runtime failures
  • Loading branch information
Jack-Byrne authored Oct 24, 2016
2 parents 6333e55 + cb7972d commit cba5c4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/appMain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ cmake_policy(POP)
if (EXTENDED_MEDIA_MODE)
set(default_media_inc
${GSTREAMER_gst_INCLUDE_DIR}
${GSTREAMER_gstconfig_INCLUDE_DIR}
)
else(EXTENDED_MEDIA_MODE)
set(default_media_inc
Expand Down
4 changes: 4 additions & 0 deletions src/components/media_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
add_definitions(${GLIB2_CFLAGS})
set(default_includes
${GSTREAMER_gst_INCLUDE_DIR}
${GSTREAMER_gstconfig_INCLUDE_DIR}
${GLIB_glib_2_INCLUDE_DIR}
)
set(default_sources
Expand All @@ -63,6 +64,8 @@ set(LIBRARIES
glib-2.0
)
else(EXTENDED_MEDIA_MODE)
set(default_includes
)

set(default_sources
${COMPONENTS_DIR}/media_manager/src/audio/socket_audio_streamer_adapter.cc
Expand Down Expand Up @@ -96,6 +99,7 @@ include_directories (
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
${COMPONENTS_DIR}/policy/include/
${default_includes}
${LOG4CXX_INCLUDE_DIRECTORY}
)

Expand Down
10 changes: 8 additions & 2 deletions src/components/media_manager/src/media_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ void MediaManagerImpl::Init() {

#if defined(EXTENDED_MEDIA_MODE)
LOG4CXX_INFO(logger_, "Called Init with default configuration.");
a2dp_player_ =
new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer());
from_mic_recorder_ = new FromMicRecorderAdapter();
#endif

Expand Down Expand Up @@ -157,6 +155,14 @@ void MediaManagerImpl::Init() {

void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
LOG4CXX_AUTO_TRACE(logger_);

#if defined(EXTENDED_MEDIA_MODE)
if (!a2dp_player_ && protocol_handler_) {
a2dp_player_ =
new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer());
}
#endif

if (a2dp_player_) {
a2dp_player_->StartActivity(application_key);
}
Expand Down

0 comments on commit cba5c4a

Please sign in to comment.