1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_GET_STC:
4
5===========
6DMX_GET_STC
7===========
8
9Name
10----
11
12DMX_GET_STC
13
14
15Synopsis
16--------
17
18.. c:function:: int ioctl( int fd, DMX_GET_STC, struct dmx_stc *stc)
19    :name: DMX_GET_STC
20
21Arguments
22---------
23
24``fd``
25    File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
26
27``stc``
28    Pointer to :c:type:`dmx_stc` where the stc data is to be stored.
29
30
31Description
32-----------
33
34This ioctl call returns the current value of the system time counter
35(which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
36Some hardware supports more than one STC, so you must specify which one by
37setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
38The result is returned in form of a ratio with a 64 bit numerator
39and a 32 bit denominator, so the real 90kHz STC value is
40``stc->stc / stc->base``.
41
42
43Return Value
44------------
45
46On success 0 is returned.
47
48On error -1 is returned, and the ``errno`` variable is set
49appropriately.
50
51.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
52
53.. flat-table::
54    :header-rows:  0
55    :stub-columns: 0
56    :widths: 1 16
57
58    -  .. row 1
59
60       -  ``EINVAL``
61
62       -  Invalid stc number.
63
64
65The generic error codes are described at the
66:ref:`Generic Error Codes <gen-errors>` chapter.
67