Skip to content

Instantly share code, notes, and snippets.

- pb = avio_alloc_context(framebuf, 1000*1000, URL_RDONLY, opaque, read_packet_from_queue, NULL, NULL);
- pb->is_streamed = 1;
+ pb = avio_alloc_context(framebuf, 1000*1000, 0, opaque, read_packet_from_queue, NULL, NULL);
+ pb->seekable = 0;
+ avfc->pb = pb;
On Sun, Nov 27, 2011 at 10:07:55PM +0200, Asen Lekov wrote:
> --- a/libavcodec/snow.c
> +++ b/libavcodec/snow.c
> @@ -35,46 +35,51 @@
>
> s->b_width = w;
> - s->b_height= h;
> + s->b_height = h;
Here (and in similar places) the '=' should end up vertically aligned,
i.e.:
@lu-zero
lu-zero / yuv4mpeg-review.diff
Created November 30, 2011 10:57
Some corrections for you
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index e1db1a3..f80d2bc 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -42,7 +42,8 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
width = st->codec->width;
height = st->codec->height;
- av_reduce(&raten, &rated, st->codec->time_base.den, st->codec->time_base.num, (1UL<<31)-1);
+ av_reduce(&raten, &rated, st->codec->time_base.den,
diff --git a/avprobe.c b/avprobe.c
index 8d2ec24..848d278 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -63,6 +63,207 @@ void exit_program(int ret)
exit(ret);
}
+static int print_section_separator;
+static int print_chapter_separator;
@lu-zero
lu-zero / libmpv.h
Created June 26, 2013 16:33
High level api, missing player reconfiguration on the fly. It is _really_ simple and easy to use, Ideally you create a playlist or load a playlist, with the default playlist being NULL. The items abstraction let you put in the playlist items and possibly add offsets within the file (later) the player abstraction let you seek and play within the …
typedef struct MPVPlayer;
MPVPlayer *mpv_alloc();
int mpv_parse(MPVPlayer *m, int argc, char *argv, char *envp);
int mpv_play(MPVPlayer *m);
int mpv_pause(MPVPlayer *m);
@lu-zero
lu-zero / amf_dump.c
Last active December 23, 2015 13:39
In case you need it to debug flvdec.c
static void amf_dump(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int v;
char buf[1024];
if (pb->eof_reached)
return;
switch ((v = avio_r8(pb))) {
@lu-zero
lu-zero / gist:9400fc7b2fba1f35d118
Created August 20, 2014 15:07
Building libav for ios/arm64
../configure \
--cc=`xcrun -f --sdk iphoneos7.1 clang` \
--arch=aarch64 \
--cpu=generic \
--sysroot=`xcrun --sdk iphoneos7.1 --show-sdk-path` \
--target-os=darwin \
--extra-cflags='-arch arm64' \
--extra-ldflags='-arch arm64 -miphoneos-version-min=7.0' \
--enable-cross-compile

Keybase proof

I hereby claim:

  • I am lu-zero on github.
  • I am lu_zero (https://keybase.io/lu_zero) on keybase.
  • I have a public key whose fingerprint is 1965 8F02 6BD4 3483 3265 5B05 6DEF F12B 9916 8B55

To claim this, I am signing this object:

@lu-zero
lu-zero / gist:75a260874bb9931c6304
Created January 9, 2015 17:35
gnutls build system is horrid...
SRC_nettle="http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz"
SRC_libtasn1="http://distfiles.gentoo.org/distfiles/libtasn1-4.2.tar.gz"
SRC_gmp="http://distfiles.gentoo.org/distfiles/gmp-6.0.0a.tar.xz"
SRC_gnutls="http://distfiles.gentoo.org/distfiles/gnutls-3.3.11.tar.xz"
#AUTOTOOL_SRC="gmp nettle libtasn1 gnutls"
AUTOTOOL_SRC="gmp nettle libtasn1 gnutls"
ROOTDIR="$PWD";
@lu-zero
lu-zero / mms_open.c
Created January 21, 2015 09:59
How to open mms:// url in Libav
/*
* How to open mms:// url in Libav
*
* Libav 12 will sport a chained protocol that aliases to the following
*
*/
int example_open(AVFormatContext **ic, const char *url)
{