~ubuntu-branches/ubuntu/precise/liboggz/precise

« back to all changes in this revision

Viewing changes to src/tools/oggzed.c

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Wilkinson
  • Date: 2005-04-16 01:19:44 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050416011944-5ipwrrc260ihkpp8
Tags: 0.9.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
 
160
160
      vorbis_info_init (&vi);
161
161
      vorbis_comment_init (&vc);
162
 
      
 
162
 
163
163
      if ((ret = vorbis_synthesis_headerin (&vi, &vc, op)) == 0) {
164
164
        if (vi.rate != 0) {
165
165
          printf ("Got vorbis info: version %d\tchannels %d\trate %ld\n",
166
166
                  vi.version, vi.channels, vi.rate);
167
 
          
 
167
 
168
168
          init_stream (serialno, vi.rate, 1, 0);
169
169
        }
170
170
      }
172
172
    } else if (!strncmp ((char *)&op->packet[0], "Speex   ", 8)) {
173
173
#ifdef HAVE_SPEEX
174
174
      SpeexHeader * header;
175
 
    
 
175
 
176
176
      header = speex_packet_to_header ((char *)op->packet, op->bytes);
177
 
    
 
177
 
178
178
      if (header) {
179
179
        init_stream (serialno, header->rate, 1, 0);
180
180
 
181
181
        printf ("Got speex samplerate %d\n", header->rate);
182
 
        
 
182
 
183
183
        free (header);
184
184
      }
185
185
#endif
215
215
  long n;
216
216
 
217
217
  if (argc < 2) {
218
 
    printf ("usage: %s filename\n", argv[0]);
 
218
    printf ("Usage: %s filename\n", argv[0]);
 
219
    return (1);
219
220
  }
220
221
 
221
222
  granule_rate = 1000000;
227
228
 
228
229
  if ((oggz = oggz_open ((char *)argv[1], OGGZ_READ)) == NULL) {
229
230
    printf ("unable to open file %s\n", argv[1]);
230
 
    exit (1);
 
231
    return (1);
231
232
  }
232
233
 
233
234
  oggz_set_metric (oggz, -1, gp_metric, NULL);
245
246
 
246
247
  oggz_close (oggz);
247
248
 
248
 
  exit (0);
 
249
  return (0);
249
250
}