annotate rm.c @ 4723:a2390c6a35e6 libavformat

Fix index generation in the way that it was supposed to be used. See the discussion in the ML thread "[PATCH] rmdec.c: merge old/new packet reading code". Over time, this code broke somewhat, e.g. seq was never actually written into (and was thus always 1, therefore the seq condition was always true), whereas it was supposed to be set to the sequence number of the video slice in case the video frame is divided over multiple RM packets (slices). The problem of this is that packets other than those containing the beginning of a video frame would be indexed as well. Secondly, flags&2 is supposed to be true for video keyframes and for these audio packets containing the start of a block. For some codecs (e.g. AAC), that is every single packet, whereas for others (e.g. cook), that is the packet containing the first of a series of scrambled packets that are to be descrambled together. Indexing any of the following would lead to incomplete and thus useless frames. Problem here is that flags would be reset to 2 to indicate that the first packet is ready to be returned, and in addition if no data was left to be returned (which is always true for the first packet), then we wouldn't actually write the index entry anyway. All in all, the idea was good and it probably worked at some point, but that is long ago. This patch should at the very least make it likely for this code to be executed again at the right times, i.e. the way it was originally intended to be used.
author rbultje
date Sun, 15 Mar 2009 20:14:25 +0000
parents aaf07b2acb3c
children 17ad184d14be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4522
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
1 /*
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
2 * "Real" compatible muxer and demuxer common code.
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
3 * Copyright (c) 2009 Aurelien Jacobs <aurel@gnuage.org>
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
4 *
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
5 * This file is part of FFmpeg.
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
6 *
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
11 *
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
15 * Lesser General Public License for more details.
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
16 *
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
20 */
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
21
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
22 #include "rm.h"
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
23
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
24 const char *ff_rm_metadata[4] = {
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
25 "title",
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
26 "author",
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
27 "copyright",
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
28 "comment"
aaf07b2acb3c use new metadata API in rm (de)muxer
aurel
parents:
diff changeset
29 };