aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/a64.c
diff options
context:
space:
mode:
authorTobias Bindhammer <tobias.bindhammer@uni-ulm.de>2010-10-05 12:14:30 +0000
committerTobias Bindhammer <tobias.bindhammer@uni-ulm.de>2010-10-05 12:14:30 +0000
commit2a26520a97cffeab6b803ce2742ece827e003781 (patch)
tree4e7644ed0d9c4a3b70e9a7f3314828b2af547e7c /libavformat/a64.c
parentbbc26bae117b9bfb85a129e5705715bd1df08380 (diff)
downloadffmpeg-2a26520a97cffeab6b803ce2742ece827e003781.tar.gz
Cosmetics, lots of.
Originally committed as revision 25348 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/a64.c')
-rw-r--r--libavformat/a64.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libavformat/a64.c b/libavformat/a64.c
index 66fbcaee40..2dc475cd5f 100644
--- a/libavformat/a64.c
+++ b/libavformat/a64.c
@@ -86,7 +86,7 @@ static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
* the data for colram from/to ram first and waste too much time. If we interleave and send the
* charset beforehand, we assemble a new charset chunk by chunk, write current screen data to
* screen-ram to be displayed and decode the colram directly to colram-location $d800 during
- * the overscan, while reading directly from source
+ * the overscan, while reading directly from source.
* This is the only way so far, to achieve 25fps on c64 */
if(avctx->extradata) {
/* fetch values from extradata */
@@ -96,33 +96,35 @@ static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
frame_size = AV_RB32(avctx->extradata + 12);
/* TODO: sanity checks? */
- }
- else {
+ } else {
av_log(avctx, AV_LOG_ERROR, "extradata not set\n");
return AVERROR(EINVAL);
}
+
ch_chunksize=charset_size/lifetime;
/* TODO: check if charset/size is % lifetime, but maybe check in codec */
+
if(pkt->data) num_frames = lifetime;
else num_frames = c->prev_frame_count;
+
for(i = 0; i < num_frames; i++) {
if(pkt->data) {
/* if available, put newest charset chunk into buffer */
put_buffer(s->pb, pkt->data + ch_chunksize * i, ch_chunksize);
- }
- else {
+ } else {
/* a bit ugly, but is there an alternative to put many zeros? */
for(j = 0; j < ch_chunksize; j++) put_byte(s->pb, 0);
}
+
if(c->prev_pkt.data) {
/* put frame (screen + colram) from last packet into buffer */
put_buffer(s->pb, c->prev_pkt.data + charset_size + frame_size * i, frame_size);
- }
- else {
+ } else {
/* a bit ugly, but is there an alternative to put many zeros? */
for(j = 0; j < frame_size; j++) put_byte(s->pb, 0);
}
}
+
/* backup current packet for next turn */
if(pkt->data) {
/* no backup packet yet? create one! */
@@ -136,6 +138,7 @@ static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return AVERROR(ENOMEM);
}
}
+
c->prev_frame_count = frame_count;
break;
}