summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-03-10 21:09:27 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-03-10 21:09:27 +0000
commit6ed4eec550c816b732ac893af6ba1b975d9a4946 (patch)
tree8f9414132584253fad9f6ffa043a612fdb4227d2 /libavformat/matroskadec.c
parent30a3ad750b6bae0657b233bd343c6f656f8cc99c (diff)
downloadffmpeg-6ed4eec550c816b732ac893af6ba1b975d9a4946.tar.gz
add a temporary variable to simplify the code
Originally committed as revision 12415 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 61aacb7569..8040388e84 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2380,6 +2380,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
uint32_t *lace_size = NULL;
int n, flags, laces = 0;
uint64_t num;
+ int stream_index;
/* first byte(s): tracknum */
if ((n = matroska_ebmlnum_uint(data, size, &num)) < 0) {
@@ -2398,11 +2399,12 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
av_free(origdata);
return res;
}
- if (matroska->tracks[track]->stream_index < 0) {
+ stream_index = matroska->tracks[track]->stream_index;
+ if (stream_index < 0) {
av_free(origdata);
return res;
}
- st = matroska->ctx->streams[matroska->tracks[track]->stream_index];
+ st = matroska->ctx->streams[stream_index];
if (st->discard >= AVDISCARD_ALL) {
av_free(origdata);
return res;
@@ -2545,7 +2547,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
memcpy(pkt->data, audiotrack->buf
+ a * (h*w / a - audiotrack->pkt_cnt--), a);
pkt->pos = pos;
- pkt->stream_index = matroska->tracks[track]->stream_index;
+ pkt->stream_index = stream_index;
matroska_queue_packet(matroska, pkt);
}
} else {
@@ -2562,7 +2564,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
if (n == 0)
pkt->flags = is_keyframe;
- pkt->stream_index = matroska->tracks[track]->stream_index;
+ pkt->stream_index = stream_index;
pkt->pts = timecode;
pkt->pos = pos;