mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/mpjpegdec: fix mixed declarations and code
This commit is contained in:
parent
b46dcd5209
commit
9ac5beaa86
@ -39,10 +39,12 @@ typedef struct MPJPEGDemuxContext {
|
|||||||
|
|
||||||
static void trim_right(char *p)
|
static void trim_right(char *p)
|
||||||
{
|
{
|
||||||
|
char *end;
|
||||||
|
|
||||||
if (!p || !*p)
|
if (!p || !*p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char *end = p + strlen(p);
|
end = p + strlen(p);
|
||||||
while (end > p && av_isspace(*(end-1)))
|
while (end > p && av_isspace(*(end-1)))
|
||||||
*(--end) = '\0';
|
*(--end) = '\0';
|
||||||
}
|
}
|
||||||
@ -330,8 +332,10 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
while ((ret = av_append_packet(s->pb, pkt, read_chunk - remaining)) >= 0) {
|
while ((ret = av_append_packet(s->pb, pkt, read_chunk - remaining)) >= 0) {
|
||||||
/* scan the new data */
|
/* scan the new data */
|
||||||
|
char *start;
|
||||||
|
|
||||||
len = ret + remaining;
|
len = ret + remaining;
|
||||||
char *start = pkt->data + pkt->size - len;
|
start = pkt->data + pkt->size - len;
|
||||||
do {
|
do {
|
||||||
if (!memcmp(start, mpjpeg->searchstr, mpjpeg->searchstr_len)) {
|
if (!memcmp(start, mpjpeg->searchstr, mpjpeg->searchstr_len)) {
|
||||||
// got the boundary! rewind the stream
|
// got the boundary! rewind the stream
|
||||||
|
Loading…
Reference in New Issue
Block a user