Commit c942e8b1 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '07584eaf'

* commit '07584eaf':
  mpegts: check substreams before discarding
  Add a smooth streaming segmenter muxer
  file: Add an avoption for disabling truncating existing files on open
  img2dec: always close AVIOContexts
  rtpdec_jpeg: Error out on other unsupported type values as well
  rtpdec_jpeg: Disallow using the reserved q values
  rtpdec_jpeg: Fold the default qtables case into an existing if statement
  rtpdec_jpeg: Store and reuse old qtables for q values 128-254
  rtpdec_jpeg: Simplify the calculation of the number of qtables
  rtpdec_jpeg: Add more comments about the fields in the SOF0 section
  rtpdec_jpeg: Clarify where the subsampling magic numbers come from
  rtpdec_jpeg: Don't use a bitstream writer for the EOI marker
  rtpdec_jpeg: Don't needlessly use a bitstream writer for the header
  rtpdec_jpeg: Simplify writing of the jpeg header
  rtpdec_jpeg: Merge two if statements
  rtpdec_jpeg: Write the DHT section properly

Conflicts:
	libavformat/Makefile
	libavformat/allformats.c
	libavformat/version.h
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b5bea2f9 07584eaf
......@@ -60,6 +60,7 @@ version next:
- CPiA decoder
- decimate filter ported from MPlayer
- RTP depacketization of JPEG
- Smooth Streaming live segmenter muxer
version 0.11:
......
......@@ -318,6 +318,7 @@ OBJS-$(CONFIG_SIFF_DEMUXER) += siff.o
OBJS-$(CONFIG_SMACKER_DEMUXER) += smacker.o
OBJS-$(CONFIG_SMJPEG_DEMUXER) += smjpegdec.o smjpeg.o
OBJS-$(CONFIG_SMJPEG_MUXER) += smjpegenc.o smjpeg.o
OBJS-$(CONFIG_SMOOTHSTREAMING_MUXER) += smoothstreamingenc.o
OBJS-$(CONFIG_SMUSH_DEMUXER) += smush.o
OBJS-$(CONFIG_SOL_DEMUXER) += sol.o pcm.o
OBJS-$(CONFIG_SOX_DEMUXER) += soxdec.o pcm.o
......
......@@ -223,6 +223,7 @@ void av_register_all(void)
REGISTER_DEMUXER (SIFF, siff);
REGISTER_DEMUXER (SMACKER, smacker);
REGISTER_MUXDEMUX (SMJPEG, smjpeg);
REGISTER_MUXER (SMOOTHSTREAMING, smoothstreaming);
REGISTER_DEMUXER (SMUSH, smush);
REGISTER_DEMUXER (SOL, sol);
REGISTER_MUXDEMUX (SOX, sox);
......
......@@ -20,6 +20,7 @@
*/
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include <fcntl.h>
#if HAVE_IO_H
......@@ -45,9 +46,23 @@
/* standard file protocol */
typedef struct FileContext {
const AVClass *class;
int fd;
int trunc;
} FileContext;
static const AVOption file_options[] = {
{ "truncate", "Truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
static const AVClass file_class = {
.class_name = "file",
.item_name = av_default_item_name,
.option = file_options,
.version = LIBAVUTIL_VERSION_INT,
};
static int file_read(URLContext *h, unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
......@@ -93,9 +108,13 @@ static int file_open(URLContext *h, const char *filename, int flags)
av_strstart(filename, "file:", &filename);
if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) {
access = O_CREAT | O_TRUNC | O_RDWR;
access = O_CREAT | O_RDWR;
if (c->trunc)
access |= O_TRUNC;
} else if (flags & AVIO_FLAG_WRITE) {
access = O_CREAT | O_TRUNC | O_WRONLY;
access = O_CREAT | O_WRONLY;
if (c->trunc)
access |= O_TRUNC;
} else {
access = O_RDONLY;
}
......@@ -140,6 +159,7 @@ URLProtocol ff_file_protocol = {
.url_get_file_handle = file_get_handle,
.url_check = file_check,
.priv_data_size = sizeof(FileContext),
.priv_data_class = &file_class,
};
#endif /* CONFIG_FILE_PROTOCOL */
......
......@@ -812,7 +812,8 @@ static int mpegts_push_data(MpegTSFilter *filter,
code = pes->header[3] | 0x100;
av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
if ((pes->st && pes->st->discard == AVDISCARD_ALL) ||
if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
(!pes->sub_st || pes->sub_st->discard == AVDISCARD_ALL)) ||
code == 0x1be) /* padding_stream */
goto skip;
......
......@@ -47,6 +47,13 @@
# define fstat(f,s) _fstati64((f), (s))
#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */
#ifdef _WIN32
#include <direct.h>
#define mkdir(a, b) _mkdir(a)
#else
#include <sys/stat.h>
#endif
static inline int is_dos_path(const char *path)
{
#if HAVE_DOS_PATHS
......
This diff is collapsed.
This diff is collapsed.
......@@ -30,8 +30,8 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 26
#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_MINOR 27
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment