Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Why is Java stdin/stdout failing with gplay on ubuntu?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to change gplay's volume level programmatically in a Java app. The video plays fine; I see gplay's menu; I get my first "Playing" prompt, and I write a "v" for "[v]Volume" but I never see the volume prompt "Set volume." I get all of the data I expect from BufferedReader, but BufferedWriter does not seem to be working. Everything works as expected when I run gplay from the console. Can anyone see what I'm doing wrong?

Thank you.

 
Marshal
Posts: 73738
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you know the flush calls are actually being invoked?
 
Bartender
Posts: 732
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing in the code you have posted will create a prompt with the text "Set volume". Where is this done?
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Campbell Ritchie: I don't know that the flush calls are actually being invoked.

Fred Kleinschmidt: It is part of the gplay interface. Here is the edited output of an interactive session with gplay where I am setting the volume:

> gplay demoVideo.mp4

FSL_PLAYER_01.00_LINUX build on Jul 19 2015 04:44:35
[p]Play
[s]Stop
[e]Seek
[a]Pause when playing, play when paused
[v]Volume
...
[x]eXit
[Playing ][Vol=01][00:00:00/00:02:39][fps:0]
[Playing ][Vol=01][00:00:02/00:02:39][fps:36]
v
Set volume[0-10]: 10
[Playing ][Vol=10][00:00:11/00:02:39][fps:31]
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What output does that debugging line produce:

?
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Internal gplay status; nothing insightful. Things like "INFO: --> maximum bitrate: 256000" (bitrate will vary slightly)

BTW, thanks to all of you that are looking at this issue! If the Java code looks correct, then my guess is that the trouble is more than likely with how gplay is handling I/O.
 
Dave Tolls
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so you see all the stuff up to but not including the volume setting.

That's what I needed confirming.

Now look at the gplay output you posted:

[Playing ][Vol=01][00:00:00/00:02:39][fps:0]
[Playing ][Vol=01][00:00:02/00:02:39][fps:36]
v
Set volume[0-10]: 10

The [Playing] lines are lines. They end in a newline, so readLine picks them up.
But look at "Set volume". No new line. So readLine can't pick it up.

You might need to use something other than readLine to pick that up.
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave Tolls: Brilliant! That was staring me in the face the whole time and I kept looking past it... thank you.
 
Acetylsalicylic acid is aspirin. This could be handy too:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic