~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/nuv.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
#include "libavutil/intreadwrite.h"
 
23
#include "libavutil/intfloat.h"
23
24
#include "avformat.h"
 
25
#include "internal.h"
24
26
#include "riff.h"
25
27
 
26
28
typedef struct {
45
47
    return 0;
46
48
}
47
49
 
48
 
//! little macro to sanitize packet size
 
50
/// little macro to sanitize packet size
49
51
#define PKTSIZE(s) (s &  0xffffff)
50
52
 
51
53
/**
52
 
 * \brief read until we found all data needed for decoding
53
 
 * \param vst video stream of which to change parameters
54
 
 * \param ast video stream of which to change parameters
55
 
 * \param myth set if this is a MythTVVideo format file
56
 
 * \return 1 if all required codec data was found
 
54
 * @brief read until we found all data needed for decoding
 
55
 * @param vst video stream of which to change parameters
 
56
 * @param ast video stream of which to change parameters
 
57
 * @param myth set if this is a MythTVVideo format file
 
58
 * @return 1 if all required codec data was found
57
59
 */
58
60
static int get_codec_data(AVIOContext *pb, AVStream *vst,
59
61
                          AVStream *ast, int myth) {
138
140
    avio_rl32(pb); // unused, "desiredheight"
139
141
    avio_r8(pb); // 'P' == progressive, 'I' == interlaced
140
142
    avio_skip(pb, 3); // padding
141
 
    aspect = av_int2dbl(avio_rl64(pb));
 
143
    aspect = av_int2double(avio_rl64(pb));
142
144
    if (aspect > 0.9999 && aspect < 1.0001)
143
145
        aspect = 4.0 / 3.0;
144
 
    fps = av_int2dbl(avio_rl64(pb));
 
146
    fps = av_int2double(avio_rl64(pb));
145
147
 
146
148
    // number of packets per stream type, -1 means unknown, e.g. streaming
147
149
    v_packs = avio_rl32(pb);
152
154
 
153
155
    if (v_packs) {
154
156
        ctx->v_id = stream_nr++;
155
 
        vst = av_new_stream(s, ctx->v_id);
 
157
        vst = avformat_new_stream(s, NULL);
156
158
        if (!vst)
157
159
            return AVERROR(ENOMEM);
158
160
        vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
162
164
        vst->codec->bits_per_coded_sample = 10;
163
165
        vst->sample_aspect_ratio = av_d2q(aspect * height / width, 10000);
164
166
        vst->r_frame_rate = av_d2q(fps, 60000);
165
 
        av_set_pts_info(vst, 32, 1, 1000);
 
167
        avpriv_set_pts_info(vst, 32, 1, 1000);
166
168
    } else
167
169
        ctx->v_id = -1;
168
170
 
169
171
    if (a_packs) {
170
172
        ctx->a_id = stream_nr++;
171
 
        ast = av_new_stream(s, ctx->a_id);
 
173
        ast = avformat_new_stream(s, NULL);
172
174
        if (!ast)
173
175
            return AVERROR(ENOMEM);
174
176
        ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
178
180
        ast->codec->bit_rate = 2 * 2 * 44100 * 8;
179
181
        ast->codec->block_align = 2 * 2;
180
182
        ast->codec->bits_per_coded_sample = 16;
181
 
        av_set_pts_info(ast, 32, 1, 1000);
 
183
        avpriv_set_pts_info(ast, 32, 1, 1000);
182
184
    } else
183
185
        ctx->a_id = -1;
184
186
 
258
260
}
259
261
 
260
262
AVInputFormat ff_nuv_demuxer = {
261
 
    "nuv",
262
 
    NULL_IF_CONFIG_SMALL("NuppelVideo format"),
263
 
    sizeof(NUVContext),
264
 
    nuv_probe,
265
 
    nuv_header,
266
 
    nuv_packet,
267
 
    NULL,
268
 
    NULL,
 
263
    .name           = "nuv",
 
264
    .long_name      = NULL_IF_CONFIG_SMALL("NuppelVideo format"),
 
265
    .priv_data_size = sizeof(NUVContext),
 
266
    .read_probe     = nuv_probe,
 
267
    .read_header    = nuv_header,
 
268
    .read_packet    = nuv_packet,
269
269
    .flags = AVFMT_GENERIC_INDEX,
270
270
};