File: dump-mplayer.c

package info (click to toggle)
w-scan 20210218-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,800 kB
  • sloc: ansic: 12,757; sh: 4,310; xml: 33; makefile: 17
file content (74 lines) | stat: -rw-r--r-- 2,519 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Simple MPEG/DVB parser to achieve network/service information without initial tuning data
 *
 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Winfried Koehler 
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * The author can be reached at: w_scan AT gmx-topmail DOT de
 *
 * The project's page is http://wirbel.htpc-forum.de/w_scan/index2.html
 */

/* 20110702 --wk */

#include <stdio.h>
#include <stdlib.h>
#include "extended_frontend.h"
#include "scan.h"
#include "dump-mplayer.h"
#include "dump-xine.h"


void mplayer_dump_service_parameter_set (FILE * f, 
                                struct service * s,
                                struct transponder * t,
                                struct w_scan_flags * flags)
{
        int i;

        fprintf (f, "%s:", s->service_name);
        xine_dump_dvb_parameters (f, t, flags);
        fprintf (f, ":%i:", s->video_pid);

        // build '+' separated list of mpeg audio and ac3 audio pids
        if (s->audio_pid[0] || s->ac3_pid[0]) {

           // prefer ac3 audio.
           if (s->ac3_pid[0]) {
              fprintf(f, "%i", s->ac3_pid[0]);
              for (i = 1; i < s->ac3_num; i++) {
                  fprintf (f, "+%i", s->ac3_pid[i]);
                  }
              if (s->audio_pid[0])
                  fprintf (f, "%s", "+");
              }
           // standard audio pids follow.
           if (s->audio_pid[0]) {
              fprintf(f, "%i", s->audio_pid[0]);
              for (i = 1; i < s->audio_num; i++) {
                  fprintf (f, "+%i", s->audio_pid[i]);
                  }
              }
           }

        else
           // no audio or ac3 audio pids found.
           fprintf(f, "%i", 0);

        fprintf (f, ":%i\n", s->service_id);
}