Menu

#747 Use -frames 0 for -identify, so mplayer doesn’t play back the file.

stable
closed-fixed
nobody
5
2016-04-24
2016-04-23
No

Currently, smplayer uses -frames 1 during identifying when adding files to the playlist. This causes mplayer to play back the entire file. Which can take very long and serves no point. (I added ~12 mp4 music files, and had to kill smplayer after waiting over an hour for it to be done.)

The mplayer man page suggest setting it to -frames 0, to avoid that.

I created a patch to change that, but somehow on execution, smplayer still uses -frames 1. So I’m stuck. Could you help, and make it actually use -frames 0?

1 Attachments

Discussion

  • Ricardo Villalba

    What version of mplayer are you using? It works fine for me with -frame 1.

    Anyway I think the file to patch is infoprovider.cpp

     
    • Navid Zamani

      Navid Zamani - 2016-04-24

      I use mplayer 1.2.1.

       
      • Ricardo Villalba

        I was using an older version of mplayer but I compiled the latest svn (r37856) and it still works fine with -frame 1.

        Do you also have problems with the option Video -> Thumbnail generator? It also uses -frame 1.

         
        • Navid Zamani

          Navid Zamani - 2016-04-24

          The problems only appear when adding audio files. And the same failing appears with the thumbnail generator as well. Which obviosly shouldn’t even be available for audio files.
          Did you only test with video files? Because with those, everythng’s working fine here too.

          And as I said, the mplayer man page says that -identify is just a shorthand for raising the message level to 4. The file is still played back, even with no audio or video being rendered. If you only want the log text, you gotta use -frames 0. :)
          (Yes, I too think that’s stupid. :)

           

          Last edit: Navid Zamani 2016-04-24
          • Ricardo Villalba

            Yes I was testing with videos.
            I tested now with an audio file. Now I can see the problem.

             
            • Navid Zamani

              Navid Zamani - 2016-04-24

              Sorry for failing to make that clear earlier… My own fault. :)

               
    • Navid Zamani

      Navid Zamani - 2016-04-24

      Ah, I didn’t find it in infoprovider.cpp, because I looked for the string “identify” too.

      I’ve now created a proper patch, which does what I expected. (I gave it the same name, as the other one is obsolete.)
      It’s still a bit slow, but in the range that you expect from running mplayer -identify on every file added to the playlist.

      But say, how come it appears to work fine for you? What’s different?
      Do you, perchance, have the setting “Get info automatically about files added (slow)”. (under “Playlist”) disabled? Because then it’s always fast, as -identify isn’t used.

       
      • Ricardo Villalba

        Yes, that option is enabled.

         
  • Navid Zamani

    Navid Zamani - 2016-04-24

    Can you add the working patch?

     

    Last edit: Navid Zamani 2016-04-24
    • Ricardo Villalba

      The code is also used for mpv and I'm afraid --frames=0 doesn't work with mpv.

       
      • Navid Zamani

        Navid Zamani - 2016-04-24

        That’s why there are lines like

        if (PlayerID::player(mplayer_bin) == PlayerID::MPV) {
        

        in the code.

        Sorry, I assumed you were a developer of smplayer.

        Nobody cares about mpv anyway. ;)

         

        Last edit: Navid Zamani 2016-04-24
        • Ricardo Villalba

          Yes but if possible I prefer to use the same code for both players.

          I've just fixed the issue in svn r7729.

           
          • Navid Zamani

            Navid Zamani - 2016-04-24

            I agree. Although they’ll drift apart by definition, obviously that would be more elegant. :)

            Thank you. :)

             
  • Ricardo Villalba

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB