diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 03:13:10 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 03:13:10 +0000 |
commit | 3f72636dbb271877bf0200f6acab411507303b6d (patch) | |
tree | 8e36115fa591fc556f1bcf1a9b49a731bf6c3101 /media | |
parent | ffd121db20964313184ddfc9261792a156dbf317 (diff) | |
download | chromium_src-3f72636dbb271877bf0200f6acab411507303b6d.zip chromium_src-3f72636dbb271877bf0200f6acab411507303b6d.tar.gz chromium_src-3f72636dbb271877bf0200f6acab411507303b6d.tar.bz2 |
Adding support for playing audio only also files through player_x11 application. Currently the application just hangs without doing anything if an audio only file is given as input to it.
Patch by sashinde@nvidia.com:
http://codereview.chromium.org/2075018
BUG=none
TEST=Try playing an audio only file before and after this change.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/tools/player_x11/player_x11.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc index 69d7fc5..73846ed 100644 --- a/media/tools/player_x11/player_x11.cc +++ b/media/tools/player_x11/player_x11.cc @@ -140,6 +140,7 @@ int main(int argc, char** argv) { std::string filename = CommandLine::ForCurrentProcess()->GetSwitchValueASCII("file"); bool enable_audio = CommandLine::ForCurrentProcess()->HasSwitch("audio"); + bool audio_only = false; // Install the signal handler. signal(SIGTERM, &TerminateHandler); @@ -159,14 +160,20 @@ int main(int argc, char** argv) { enable_audio, &pipeline)) { // Main loop of the application. g_running = true; + + // Check if video is present. + audio_only = !pipeline->IsRendered(media::mime_type::kMajorTypeVideo); + while (g_running) { if (XPending(g_display)) { XEvent e; XNextEvent(g_display, &e); if (e.type == Expose) { - // Tell the renderer to paint. - DCHECK(Renderer::instance()); - Renderer::instance()->Paint(); + if (!audio_only) { + // Tell the renderer to paint. + DCHECK(Renderer::instance()); + Renderer::instance()->Paint(); + } } else if (e.type == ButtonPress) { // Stop the playback. break; |