comparison idcin.c @ 775:c5077fdab490 libavformat

AVPacket.pos
author michael
date Thu, 26 May 2005 20:17:12 +0000
parents 0fdc96c2f2fe
children feca73904e67
comparison
equal deleted inserted replaced
774:820863425158 775:c5077fdab490
253 253
254 chunk_size = get_le32(pb); 254 chunk_size = get_le32(pb);
255 /* skip the number of decoded bytes (always equal to width * height) */ 255 /* skip the number of decoded bytes (always equal to width * height) */
256 url_fseek(pb, 4, SEEK_CUR); 256 url_fseek(pb, 4, SEEK_CUR);
257 chunk_size -= 4; 257 chunk_size -= 4;
258 if (av_new_packet(pkt, chunk_size)) 258 ret= av_get_packet(pb, pkt, chunk_size);
259 ret = AVERROR_IO; 259 if (ret != chunk_size)
260 return AVERROR_IO;
260 pkt->stream_index = idcin->video_stream_index; 261 pkt->stream_index = idcin->video_stream_index;
261 pkt->pts = idcin->pts; 262 pkt->pts = idcin->pts;
262 ret = get_buffer(pb, pkt->data, chunk_size);
263 if (ret != chunk_size)
264 ret = AVERROR_IO;
265 } else { 263 } else {
266 /* send out the audio chunk */ 264 /* send out the audio chunk */
267 if (idcin->current_audio_chunk) 265 if (idcin->current_audio_chunk)
268 chunk_size = idcin->audio_chunk_size2; 266 chunk_size = idcin->audio_chunk_size2;
269 else 267 else
270 chunk_size = idcin->audio_chunk_size1; 268 chunk_size = idcin->audio_chunk_size1;
271 if (av_new_packet(pkt, chunk_size)) 269 ret= av_get_packet(pb, pkt, chunk_size);
270 if (ret != chunk_size)
272 return AVERROR_IO; 271 return AVERROR_IO;
273 pkt->stream_index = idcin->audio_stream_index; 272 pkt->stream_index = idcin->audio_stream_index;
274 pkt->pts = idcin->pts; 273 pkt->pts = idcin->pts;
275 ret = get_buffer(&s->pb, pkt->data, chunk_size);
276 if (ret != chunk_size)
277 ret = AVERROR_IO;
278 274
279 idcin->current_audio_chunk ^= 1; 275 idcin->current_audio_chunk ^= 1;
280 idcin->pts += FRAME_PTS_INC; 276 idcin->pts += FRAME_PTS_INC;
281 } 277 }
282 278