~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libmpdemux/demux_mpc.c

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  float length;
28
28
} da_priv_t;
29
29
 
30
 
extern void free_sh_audio(sh_audio_t* sh);
31
 
 
32
30
static uint32_t get_bits(da_priv_t* priv, stream_t* s, int bits) {
33
31
  uint32_t out = priv->dword;
34
32
  uint32_t mask = (1 << bits) - 1;
80
78
  sh_audio = new_sh_audio(demuxer,0);
81
79
 
82
80
  {
83
 
    char *wf = (char *)calloc(1, sizeof(WAVEFORMATEX) + HDR_SIZE);
 
81
    char *wf = calloc(1, sizeof(WAVEFORMATEX) + HDR_SIZE);
84
82
    char *header = &wf[sizeof(WAVEFORMATEX)];
85
83
    const int freqs[4] = {44100, 48000, 37800, 32000};
86
84
    int frames;
104
102
    demuxer->movi_end = s->end_pos;
105
103
  }
106
104
 
107
 
  priv = (da_priv_t *)malloc(sizeof(da_priv_t));
 
105
  priv = malloc(sizeof(da_priv_t));
108
106
  priv->last_pts = -1;
109
107
  priv->pts_per_packet = (32 * 36) / (float)sh_audio->wf->nSamplesPerSec;
110
108
  priv->length = seconds;
147
145
    priv->last_pts = 0;
148
146
  else
149
147
    priv->last_pts += priv->pts_per_packet;
150
 
  ds->pts = priv->last_pts - (ds_tell_pts(demux->audio) -
151
 
              sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
 
148
  dp->pts = priv->last_pts;
152
149
  ds_add_packet(ds, dp);
153
150
  return 1;
154
151
}
179
176
    if (s->eof) break;
180
177
  }
181
178
  if (!sh_audio) return;
182
 
  sh_audio->delay = priv->last_pts - (ds_tell_pts(demuxer->audio) -
183
 
                     sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
184
179
}
185
180
 
186
181
static void demux_close_mpc(demuxer_t* demuxer) {