Skip to content

Commit

Permalink
Add better error message if no video streams
Browse files Browse the repository at this point in the history
Part of #153
  • Loading branch information
otsaloma committed Dec 27, 2020
1 parent 8c996a6 commit 89d1a45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gaupol/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ def set_uri(self, uri):
from gi.repository import GstPbutils
discoverer = GstPbutils.Discoverer()
self._info = discoverer.discover_uri(uri)
streams = self._info.get_stream_list()
stream_types = [x.get_stream_type_nick() for x in streams]
if "video" not in stream_types:
raise Exception(_("No video streams found"))
stream = self._info.get_video_streams()[0]
num = float(stream.get_framerate_num())
denom = float(stream.get_framerate_denom())
Expand Down

0 comments on commit 89d1a45

Please sign in to comment.