annotate raw.h @ 4633:0c69b895a01f libavformat

Don't let finalize_packet() touch pkt->stream_index. Instead, let individual payload handlers take care of that themselves at their own option. What this patch really does is "fix" a bug in MS-RTSP protocol where incoming packets are always coming in over the connection (UDP) or interleave-id (TCP) of the stream-id of the first ASF packet in the RTP packet. However, RTP packets may contain multiple ASF packets (and usually do, from what I can see), and therefore this leads to playback bugs. The intended stream-id per ASF packet is given in the respective ASF packet header. The ASF demuxer will correctly read this and set pkt->stream_index, but since the "stream" parameter can not be known to rtpdec.c or any of the RTP/RTSP code, the "st" parameter in all these functions is basically invalid. Therefore, using st->id as pkt->stream_index leads to various playback bugs. The result of this patch is that pkt->stream_index is left untouched for RTP/ASF (and possibly for other payloads that have similar behaviour). The patch was discussed in the "[PATCH] rtpdec.c: don't overwrite pkt->stream_index in finalize_packet()" thread on the mailinglist.
author rbultje
date Tue, 03 Mar 2009 13:51:34 +0000
parents 41542d2edcf4
children 61cc005602fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2545
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
1 /*
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
2 * RAW muxer and demuxer
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
3 * Copyright (C) 2007 Aurelien Jacobs <aurel@gnuage.org>
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
4 *
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
5 * This file is part of FFmpeg.
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
6 *
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
11 *
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
15 * Lesser General Public License for more details.
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
16 *
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
20 */
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
21
3852
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3617
diff changeset
22 #ifndef AVFORMAT_RAW_H
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3617
diff changeset
23 #define AVFORMAT_RAW_H
2545
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
24
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
25 #include "avformat.h"
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
26
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
27 int pcm_read_seek(AVFormatContext *s,
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
28 int stream_index, int64_t timestamp, int flags);
213268d7594e move unrelated functions declarations out of allformats.h
aurel
parents:
diff changeset
29
4610
41542d2edcf4 Separate the raw FLAC demuxer from raw.c and put in a new file,
jbr
parents: 3852
diff changeset
30 int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
41542d2edcf4 Separate the raw FLAC demuxer from raw.c and put in a new file,
jbr
parents: 3852
diff changeset
31
3852
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3617
diff changeset
32 #endif /* AVFORMAT_RAW_H */