[FFmpeg-devel] [PATCH] BluRay protocol using libbluray

Michael Niedermayer michaelni at gmx.at
Wed Feb 15 07:23:52 CET 2012


On Mon, Feb 13, 2012 at 01:22:02PM +0200, Petri Hintukainen wrote:
[...]
> +    BlurayContext *bd = (BlurayContext *)h->priv_data;

useless cast


> +    const BLURAY_DISC_INFO *disc_info;
> +
> +    disc_info = bd_get_disc_info(bd->bd);
> +    if (!disc_info) {
> +        av_log(h, AV_LOG_ERROR, "bd_get_disc_info() failed\n");
> +        return 0;

within ffmpeg negative values are generally used as errors
for consistency and avoiding confusing its probably best to do this
here too


[...]
> +static int bluray_open(URLContext *h, const char *path, int flags)
> +{
> +    BlurayContext *bd = (BlurayContext *)h->priv_data;
> +    int num_title_idx;
> +    const char *diskname = path;
> +
> +    av_strstart(path, BLURAY_PROTO_PREFIX, &diskname);
> +
> +    bd->bd = bd_open(diskname, NULL);
> +    if (!bd->bd) {
> +        av_log(h, AV_LOG_ERROR, "bd_open() failed\n");
> +        return AVERROR(EIO);
> +    }
> +
> +    /* check if disc can be played */
> +    if (!check_disc_info(h)) {
> +        return AVERROR(EIO);
> +    }
> +
> +    /* setup player registers */
> +    /* region code has no effect without menus
> +    if (bd->region > 0 && bd->region < 5) {
> +        av_log(h, AV_LOG_INFO, "setting region code to %d (%c)\n", bd->region, 'A' + (bd->region - 1));
> +        bd_set_player_setting(bd->bd, BLURAY_PLAYER_SETTING_REGION_CODE, bd->region);
> +    }
> +    */
> +
> +    /* load title list */
> +    num_title_idx = bd_get_titles(bd->bd, TITLES_RELEVANT, MIN_PLAYLIST_LENGTH);

> +    av_log(0, AV_LOG_INFO, "%d usable playlists:\n", num_title_idx);

s/0/h/

also, if you want to officially maintain this code for ffmpeg, then
please add yourself to MAINTAINERS as well

overall the code looks good

nice work!

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120215/7ab7e5ba/attachment.asc>


More information about the ffmpeg-devel mailing list